sunnyprogrammer
Programmer
Hi,
My REXX program has the below records in the input file:
AAAAAAAAAAAAAAAAAAAAAAAAAAA
11111EEEEEEEEEEEEEEEEEEEEEE
FFFFFFFFFFFFFFFFFFFFFFFFFFF
now my rexx program is to write the records of the input file only when first 3 digits of the input record is NOT '111'.
I noticed that only the record 'AAAAAAAAAAAAAAAAAAA' is written to the output file and the record 'FFFFFFFFFFFFFFFFFFFF' is not written to the o/p file.
The Program is as below:
/*** REXX ***/
ALLOC DA(USERID.INPUT.FILE) F(INPFILE) SHR REUSE
ALLOC DA(USERID.OUTPUT.FILE) F(OUTFILE) SHR REUSE
"EXECIO * DISKR (OPEN STEM INPREC. "
"EXECIO * DISKW (OPEN STEM OUTREC. "
DO I=1 TO INPREC.0
IF SUBSTR(INPREC.I,1,3)=111 THEN
INTERATE
ELSE
OUTREC.I=INPREC.I
END
"EXECIO * DISKW (FINIS STEM OUTREC."
I referred the REXX user guide and the reference guide and learnt that when '*' is provided as line number in the EXECIO WRITE statement, it writes the data into output file until OUTREC.I has a NULL value. This is what has happened in my case.
Can any one please help me solve this problem?
Thanks very much.
My REXX program has the below records in the input file:
AAAAAAAAAAAAAAAAAAAAAAAAAAA
11111EEEEEEEEEEEEEEEEEEEEEE
FFFFFFFFFFFFFFFFFFFFFFFFFFF
now my rexx program is to write the records of the input file only when first 3 digits of the input record is NOT '111'.
I noticed that only the record 'AAAAAAAAAAAAAAAAAAA' is written to the output file and the record 'FFFFFFFFFFFFFFFFFFFF' is not written to the o/p file.
The Program is as below:
/*** REXX ***/
ALLOC DA(USERID.INPUT.FILE) F(INPFILE) SHR REUSE
ALLOC DA(USERID.OUTPUT.FILE) F(OUTFILE) SHR REUSE
"EXECIO * DISKR (OPEN STEM INPREC. "
"EXECIO * DISKW (OPEN STEM OUTREC. "
DO I=1 TO INPREC.0
IF SUBSTR(INPREC.I,1,3)=111 THEN
INTERATE
ELSE
OUTREC.I=INPREC.I
END
"EXECIO * DISKW (FINIS STEM OUTREC."
I referred the REXX user guide and the reference guide and learnt that when '*' is provided as line number in the EXECIO WRITE statement, it writes the data into output file until OUTREC.I has a NULL value. This is what has happened in my case.
Can any one please help me solve this problem?
Thanks very much.