Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Fri Aug 15, 2014 4:02 am Post subject: Find specific string in file and copy x records
I imagine my requirement is simple, but all the examples I see seem to assume you want to replace values in the file.
Basically, I simply want to be able to find a specific string in a specific column in the file and then copy, say, 1000 records from that starting record.
How would I do this (or if you'd prefer, simply give me the keywords I need and I'll experiment on my own) _________________ Michael
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Fri Aug 15, 2014 5:15 am Post subject: Thanks Kolusu.
I actually arrived at the same conclusionas your post. I'll just append my results so anyone else can find it as well
Code:
//* NOTE THAT THE STARTING COLUMN FOR THE INCLUDE COND IS 4 GREATER THAN
//* COLS WOULD SHOW (SINCE THE INPUT FILE IS VARIABLE)
//*
//SYSIN DD *
INCLUDE COND=(45,11,CH,GE,C'00083411181')
OPTION COPY,STOPAFT=1000
//*
(granted, it is the same as your append, but I'll bet people trip up over and over again on the actual extra 4 byte offset for variable files) _________________ Michael
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum