Having personally spent a large amount of time dealing with this issue, what I can tell you is that for non-VSAM data sets that the best that you can do in most cases (without actually reading the data set) is to look at the DSCBs to get the last used TTR and then calculate an estimate of the data set size based on the recfm and blksize. There are some special cases, like compressed data sets where the catalog can help.
It would be fantastic if somewhere you could get: 1) the number of logical records 2) the total number of bytes 3) fine grained timestamp when the data set was last updated 4) sha256 hash of the data set On Thu, May 14, 2020 at 10:55 AM Farley, Peter x23353 < peter.far...@broadridge.com> wrote: > This question came to me from a co-worker: Is there any API to get the > byte file size of a non-VSAM, non-zFS, non-database file in z/OS? I.E., > byte file size for plain sequential files? > > I am aware of the "old way" of reading the VTOC of a volume to get the > various DSCB's that total up disk extents, but that gets complicated > quickly for multi-volume files, and was never guaranteed to be accurate as > to the actual byte count of data in the file except in the RECFM=FS/FBS > case anyway. > > There is always the performance-killing option of just reading the whole > file and totaling up the length of every record (or block depending on how > you structure the reads), but no one would call that an API. > > As far as I know there is no such API in z/OS, and this is what I told my > co-worker, but am I wrong? Is there an alternative of which I am not aware? > > TIA for your input. > > Peter > -- > > > > This message and any attachments are intended only for the use of the > addressee and may contain information that is privileged and confidential. > If the reader of the message is not the intended recipient or an authorized > representative of the intended recipient, you are hereby notified that any > dissemination of this communication is strictly prohibited. If you have > received this communication in error, please notify us immediately by > e-mail and delete the message and any attachments from your system. > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN