Hi
the JCC documentation for fopen, open, etc says that code like
FILE* VTOCfh = fopen("", "rb,vtoc,unit=SYSDA,volser=PUB001");
will open the VTOC and that then you should be able to read its "records" (i.e., its data set control blocks, DSCBs) by means of
char dscb[96];
int r = fread(dscb, 1, 96, VTOCfh);
where 96 is the magic number representing the "data" part of a VTOC DSCB.
Alas, DSCBs are all 140 bytes long and fread correctly reads the first 96 bytes of a DSCB, including the "key" part, which is 44 bytes long. dscb[0..43] correctly holds the "keyid" part of the DSCB, which, for DSCBs of type 0xF1 contains the dataset name.
Now, at a minimum, the documentation is incorrect in stating that fread reads in the DSCB "data" part. OTOH, we do not have a way to properly read in a full DSCB (in Hercules, with JCC).
TRT would be to modify fread reading in the DSCB using the full 140 bytes extent. Note that trying to call fread with a 140 length, does not read correctly the DSCB.
Attached are three files that exhibit the behavior. Apologies for their convolutedness. Just compile the file tstvtocr.c with JCC and run the result at TSO.
all the best
Marco
jccvtocfread.zip
Hi
the JCC documentation for
fopen,open, etc says that code likewill open the VTOC and that then you should be able to read its "records" (i.e., its data set control blocks, DSCBs) by means of
where
96is the magic number representing the "data" part of a VTOC DSCB.Alas, DSCBs are all 140 bytes long and
freadcorrectly reads the first 96 bytes of a DSCB, including the "key" part, which is 44 bytes long.dscb[0..43]correctly holds the "keyid" part of the DSCB, which, for DSCBs of type0xF1contains the dataset name.Now, at a minimum, the documentation is incorrect in stating that
freadreads in the DSCB "data" part. OTOH, we do not have a way to properly read in a full DSCB (in Hercules, with JCC).TRT would be to modify
freadreading in the DSCB using the full 140 bytes extent. Note that trying to callfreadwith a 140 length, does not read correctly the DSCB.Attached are three files that exhibit the behavior. Apologies for their convolutedness. Just compile the file
tstvtocr.cwith JCC and run the result at TSO.all the best
Marco
jccvtocfread.zip