In REXX, how to know that end of file is reached.

Time Sharing Option, Interactive System Productivity Facility and REstructured eXtended eXecutor

Moderator: mickeydusaor

Post Reply
Akshypal
Registered Member
Posts: 54
Joined: Sun Jun 16, 2013 9:51 am

In REXX, how to know that end of file is reached.

Post by Akshypal »

Hi,

Please can anyone let me know in REXX while reading a file into stack, how can we identify about end of file condition?

Thanks
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: In REXX, how to know that end of file is reached.

Post by Anuj Dhawan »

With EXECIO when you receive a non-zero return-code, it should serve what you're looking for. Something on these lines should help you:

Code: Select all

         eof = 'no'
         DO WHILE eof = 'no'
           "EXECIO 1 DISKR INDD"
            IF RC = 0 THEN          /*  read successful*/
              DO
                PULL record                
              END
            ELSE eof = 'yes'
         END
         "EXECIO 0 DISKR INDD (FINIS"
         EXIT 0
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Akshypal
Registered Member
Posts: 54
Joined: Sun Jun 16, 2013 9:51 am

Re: In REXX, how to know that end of file is reached.

Post by Akshypal »

Great - that did work for me.

Thanks for the help! :D
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: In REXX, how to know that end of file is reached.

Post by Anuj Dhawan »

Nice to know that it worked for you.

Thanks for the feedback! :)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “TSO, ISPF & REXX (Do you still do CLIST?!).”