BASIC query
Moderators: chulett, rschirm, roy
BASIC query
Hi,
i am reading a sequential file in a job control(pipe delimited), having just 2 records. First record is header ( ValidFrom | ValidTo) & second is having some data values (like, 10 | 15).
I need to directly read the data record(10 | 15) and separate the field values and use them for further logic.
for now, i have just read the file in loop and after exiting from loop it gives me the desired result. but i feel there could be a way to directly read a particular record from seq file. i checked BASIC guide, but couldn't find any.
Any help on this would be appreciated.
i am reading a sequential file in a job control(pipe delimited), having just 2 records. First record is header ( ValidFrom | ValidTo) & second is having some data values (like, 10 | 15).
I need to directly read the data record(10 | 15) and separate the field values and use them for further logic.
for now, i have just read the file in loop and after exiting from loop it gives me the desired result. but i feel there could be a way to directly read a particular record from seq file. i checked BASIC guide, but couldn't find any.
Any help on this would be appreciated.
Rgds,
MB
MB
-
- Premium Member
- Posts: 353
- Joined: Mon Jan 17, 2011 5:03 am
- Location: Mumbai, India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
"Sequential" means just that - you must read past every byte in the file to get to the next. Your simplest solution is two ReadSeq statements - discard the results of the first and process the results of the second.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
if you are insisting to use jobcontrol code , then READSEQ is the way you need to follow;
If you are ok with a job, then read header separately using and read remaining using in filter option in sequential file stage.
If you are ok with a job, then read header separately using
Code: Select all
head -1
Code: Select all
sed -e '1d'
pandeeswaran
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 353
- Joined: Mon Jan 17, 2011 5:03 am
- Location: Mumbai, India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: