Joined: 17 Jul 2007 Posts: 6 Topics: 2 Location: India
Posted: Wed Jul 18, 2007 12:20 am Post subject: Extract first and fourth word
Can I extract first and fifth words using DFSort, My problem is the input file was not allined prefectly
If I refrase my requirement , I need first word ( prefectly allingned )
and word following INCLUDE using DFSORT, any other JCL utility is OK
For example my input file looks like below
Code:
PBAT011 63 008012 INCLUDE LDSYR20
PBAT011 667 008016 INCLUDE LDSYR00
PBAT011 671 008020 INCLUDE LDOJT20
PBAT011 675 008024 INCLUDE LDOJT00
PBAT011 679 008028 INCLUDE LDOTO20
PBAT011 683 008032 INCLUDE LDOTO00
PBAT011 687 008036 INCLUDE LDOTT20
Thank u for ur time...... _________________ regards
Venkata Ratnam Mutyala
The following is an explanation from the SortTricksPDF, substitute INCLUDE for COPY
Quote:
Here's how it works:
ENDAT=C'COPY' finds the end of the 'COPY' string in each record. % is used because we don't need to
extact anything at this point.
STARTAFT=BLANKS finds the next non-blank character after 'COPY'. FIXLEN=8 extracts the 8 bytes
starting at that non-blank into the %00 fixed parsed field.
BUILD creates an output record with the 8-bytes we extracted into %00.
With the job above, if 'COPY' is not found in a record, the output record will contain blanks. If you don't want blank output records when the input doesn't have 'COPY', you can use DFSORT's substring search feature to only keep the records with 'COPY' in them:
INCLUDE COND=(1,n,SS,EQ,C'COPY')
_________________ Dick Brenholtz
American living in Varel, Germany
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Wed Jul 18, 2007 7:41 am Post subject:
m_v_ratnam,
thanks for the response, and I am very glad that it worked. Took me about 10 minutes to search manuals and find examples. Actually, DFSORT Tricks had everything that we needed.
To be honest, I have never used sort other than SORT FIELDS.
I provided you the answer, as I said, based on some really excellent documentation provided by the IBM DFSORT group. If an old fart like me can come up with a solution, anyone can. DFSORT documentation links can be found in Frank's signature on any post. As well as there is a sticky in the Utilities Forum 'Links to Reference Material'. _________________ Dick Brenholtz
American living in Varel, Germany
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