View previous topic :: View next topic
Author
Message
nagarajan.dharani New User Joined: 27 Dec 2006Posts: 36 Location: Chennai
Hi,
I have a file with length 571.
I need to replace the value 10 to 60 in the field 2,3.
The format of the field is S9(03) USAGE COMP-3
Please help me out to solve this.
Back to top
shankar.v Active User Joined: 25 Jun 2007Posts: 196 Location: Bangalore
nagarajan.dharani,
Please check with the following code for your requirement.
Code:
// EXEC PGM=SORT
//SORTIN DD DSN=INFILE,DISP=SHR
//SORTOUT DD DSN=OUTFILE,...
//SYSOUT DD SYSOUT=*
OPTION COPY
INREC IFTHEN=(WHEN=(2,2,PD,EQ,10),
OVERLAY=(2:2,2,PD,ADD,+50,TO=PD,LENGTH=2))
/*
//
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
nagarajan.dharani,
If you have a 2-byte PD field in positions 2-3 and you want to replace a value of +10 with a value of +60, but leave all other values unchanged, you can use a DFSORT job like this:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(2,2,PD,EQ,+10),
OVERLAY=(2:+60,TO=PD,LENGTH=2))
/*
If that's not what you want to do, then please explain more clearly exactly what it is you want to do.
Back to top
Please enable JavaScript!