Usually people set a switch in the EODAD routine.

--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
עַם יִשְׂרָאֵל חַי
נֵ֣צַח יִשְׂרָאֵ֔ל לֹ֥א יְשַׁקֵּ֖ר

________________________________________
From: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> on behalf 
of David Eisenberg <deisenbe...@optonline.net>
Sent: Wednesday, May 8, 2024 6:35 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Does the GET macro indicate EOF?

I hope someone can help me; my question pertains to the QSAM GET macro. Please 
consider this code snippet:

         OPEN  SYSIN
GETLOOP  GET   SYSIN,BUFFER
MYEODAD  DS    0H
         <branch to label EOF at end-of-file ???>
                 B     GETLOOP
EOF      CLOSE SYSIN
*
SYSIN    DCB   DDNAME=SYSIN,MACRF=GM,DSORG=PS,RECFM=FB,EODAD=MYEODAD,LRECL=80

I've deliberately placed the EODAD address immediately after the GET. My 
question: is there anything I can test immediately after the GET to determine 
whether a) I successfully read a record, or b) I've reached the EOF?

The IBM manual says that after a GET, R1 points to the record that was read; 
however, I don't see any indication in the manual of where R1 points when the 
EOF is encountered, nor do I see any return code setting in R15 at EOF. I have 
empirically observed that at EOF, R1 points to an area in storage containing 
the string 'EOV ', but I don't know if I can rely on that.

Does GET tell me anything when the EOF is reached? Or is there something in the 
DCB that I can test to tell me that I'm at the EOF?

(I know that it looks silly to have the EODAD in the middle of the GET loop. 
This is about my trying to overcome an IDF limitation regarding 
single-stepping.)

Any help would be appreciated; thank you!

David

Reply via email to