That depends heavily on the compiler and run time system you use.
On todays z/OS and LE, with the current C compiler, and maybe older versions,
too, if you open a file using fopen (fname, "rb,recfm=vb"), the fread calls
return the vb records one by one and the current length.
Normally fread would fill the buffer to the maximum length, but with the fopen
above and with vb files, it does not. So you can track the length of the files
on fread. Same goes for fwrite, IIRC.
Don't know about other compilers, especially GCCMVS or GCCCMS on Hercules.
Am 25.07.2013 21:14, schrieb M.N.:
> Is there a 'C'ish way to read normal IBM OS variable length records? KICKS
> is currently using FREAD to input what it calls "extrapartition transient
> data" files. This works fine for fixed blocked because KICKS just extracts
> the lrecl from the file structure (file->lrecl) and uses it. But I haven't
> found a general way to do this with PDPCLIB for variable blocked files since
> what lives in file->lrecl is probably not the length of the next record.
> My plan is to dump FREAD in favor of my own DCB based I/O, but I thought
> I should check with sounder minds before I do that.