guruji Warnings : 1 New User
Joined: 13 Apr 2007 Posts: 59 Location: Chennai
|
|
|
|
Hi,
I have an input file sorted on certain fields. I want to replace certain fields in some particular records(depending on certain condition), with some other values. I'll explain with example.
Infile:
aaa12df345vhk67
vjv13b,ug,bml;67
cvm12,mcvbk366
bax13vxcbmluj66
if the 14th and 15th position values are 66 and 4th and 5th position values asre 13, i should replace tha value 13 with 55.
i.e, the forth d should be
bax55cbmluj66, and all the rest should be as such.
Thanks,
Reni |
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Reni,
Try this DFSORT job
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AAA12DF345VHK67
VJV13B,UG,BML;67
CVM12,MCVBK366
BAX13VXCBMLUJ66
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(14,2,CH,EQ,C'66',AND,4,2,CH,EQ,C'13'),
OVERLAY=(4:C'55'))
/*
|
Gerry |
|