Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JCC Library misaligned handling of DSCBs in VTOC #3

Open
marcoxa opened this issue May 27, 2021 · 0 comments
Open

JCC Library misaligned handling of DSCBs in VTOC #3

marcoxa opened this issue May 27, 2021 · 0 comments

Comments

@marcoxa
Copy link

marcoxa commented May 27, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant