Reading the records from a file using REXX



IBM's Command List programming language & Restructured Extended Executor

Reading the records from a file using REXX

Postby nbdkygs » Mon Aug 04, 2008 4:05 pm

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.
nbdkygs
 
Posts: 8
Joined: Mon Jun 23, 2008 12:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reading the records from a file using REXX

Postby MrSpock » Mon Aug 04, 2008 4:35 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Reading the records from a file using REXX

Postby nbdkygs » Mon Aug 04, 2008 4:39 pm

yes! but i dont want those line numbers in my output.
nbdkygs
 
Posts: 8
Joined: Mon Jun 23, 2008 12:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reading the records from a file using REXX

Postby MrSpock » Mon Aug 04, 2008 5:32 pm

Then either get rid of them from your input file, or exclude them in REXX using one of these functions:

LEFT.
SUBSTR.
OVERLAY.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Reading the records from a file using REXX

Postby nbdkygs » Mon Aug 04, 2008 7:18 pm

Can you tell me how can i get rid of these numbers from input file itself.... without using left/substr/overlay?
nbdkygs
 
Posts: 8
Joined: Mon Jun 23, 2008 12:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reading the records from a file using REXX

Postby dick scherrer » Mon Aug 04, 2008 10:20 pm

Hello,

Edit the file (or use some batch utility) and replace the numbers with spaces.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Reading the records from a file using REXX

Postby Bill Dennis » Tue Aug 05, 2008 1:15 am

If you use ISPF EDIT, try command UNNUMto remove the sequence numbers.
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post