Page 1 of 1

Reading the records from a file using REXX

PostPosted: Mon Aug 04, 2008 4:05 pm
by nbdkygs
Hello all,
I have a flat file with a set of records. when i tried to read from that file using REXX, I am getting the numbers which are not file. I guess these are line numbers.
My code is:
/*****************************REXX*************************************/                                 
"EXECIO * DISKR DATAIN (STEM NEWVAR."                                   
DO I=1 TO NEWVAR.0                                                     
  SAY NEWVAR.I                                                         
END                                                                     
"FREE F(DATAIN)"


The Output I am getting is like:

NBDKYGS.REXX.OUT1
00000100
NBDKYGS.REXX.OUT2
00000200
NBDKYGS.REXX.OUT3
00000300

But i dont want those numbers in the middle ( 00000100, 00000200 ...)
Please help me.

Re: Reading the records from a file using REXX

PostPosted: Mon Aug 04, 2008 4:35 pm
by MrSpock
nbdkygs wrote:I am getting the numbers which are not file. I guess these are line numbers.


They must be in the file. That's the only possible explanation for your results.

Re: Reading the records from a file using REXX

PostPosted: Mon Aug 04, 2008 4:39 pm
by nbdkygs
yes! but i dont want those line numbers in my output.

Re: Reading the records from a file using REXX

PostPosted: Mon Aug 04, 2008 5:32 pm
by MrSpock
Then either get rid of them from your input file, or exclude them in REXX using one of these functions:

LEFT.
SUBSTR.
OVERLAY.

Re: Reading the records from a file using REXX

PostPosted: Mon Aug 04, 2008 7:18 pm
by nbdkygs
Can you tell me how can i get rid of these numbers from input file itself.... without using left/substr/overlay?

Re: Reading the records from a file using REXX

PostPosted: Mon Aug 04, 2008 10:20 pm
by dick scherrer
Hello,

Edit the file (or use some batch utility) and replace the numbers with spaces.

Re: Reading the records from a file using REXX

PostPosted: Tue Aug 05, 2008 1:15 am
by Bill Dennis
If you use ISPF EDIT, try command UNNUMto remove the sequence numbers.