Posted: Fri Jul 22, 2005 1:45 am Post subject: Extract a string from an unstructured input file.
Hi ,
I have a requirement ,from an existing sort card ( this is present in a PDS), i need to extract a string of data.
The input file structure looks like this:
------------------------------------------------------------------
SORT FIELDS=COPY
OMIT COND=(089,007,CH,EQ,C'A00009D',
OR,089,007,CH,EQ,C'A20034F',
OR,089,007,CH,EQ,C'A20153B',
OR,089,007,CH,EQ,C'A20631B',
OR,089,007,CH,EQ,C'A22369A',
OR,089,007,CH,EQ,C'A23002J',
OR,089,007,CH,EQ,C'A23928I',
OR,089,007,CH,EQ,C'A25153G')
Hi Darren,
try the below INCLUDE condition.I modifed the Brien's solution a little bit.
Brian's solution:
INCLUDE COND=(1,80,ss,eq,C'A25153G')
change the above include condition to
INCLUDE COND=(1,80,ss,eq,x'123')
see the hex format of C and change the above 1 to hexvalue of C,
see the hex format of ' and change the above 2 to hexvalue of ',
see the hex format of A and change the above 3 to hexvalue of A.
First of all, you have given an OMIT condition but you also listed the value in your output.
Second, if you know the include Literals but if the problem is only their position you can use the SS operator provided by Brian and Bprasanna. Instead of "089,007" you specify "1,100" (i.e 1, LRECL - assuming that your LRECL is 100).
If the above solution does not satisfy your requirement, please post sample input and sample output. Also change OMIT to INCLUDE if you want to actually INCLUDE the records with the given values.
The first post for this has the input and the expected output file.
For your reference I am posting the input and output again.
The input file is a sort card of another job.
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Tue Jul 26, 2005 2:39 am Post subject:
Darren,
With Syncsort, I don't see any direct way to accomplish this. I'm thinking of using CHANGE operator in SORT but even that would be complex in this case. I'm not sure if there is a better way to solve this. Probably someone else can help you out.
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