Page 1 of 1

how come to know the file is at end in REXX

PostPosted: Tue May 20, 2008 9:19 am
by Chaitnya
Hi,

Please can anyone let me know in REXX while reading a file into stack how can I come to know that the file is at end.

Thanks!!!

Re: how come to know the file is at end in REXX

PostPosted: Tue May 20, 2008 1:00 pm
by MrSpock
When you receive a non-zero return-code on the EXECIO instruction.

         done = 'no'
         DO WHILE done = 'no'
           "EXECIO 1 DISKR INDD"
            IF RC = 0 THEN          /*  Record was read */
              DO
                PULL record               
              END
            ELSE done = 'yes'
         END
         "EXECIO 0 DISKR INDD (FINIS"
         EXIT 0