karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Hi all,
I have a requirement, in which If there is "40" at posistion 10 AND "09" at position 12 i need to replace the "09" to "90" and write the entire record
if the AND condition is not statisfied i need to write the entire record of the file unaltered to the output file.
hope i have explained the rq clearly ...please write back if not.
could some one please explain me how to do this .. using Sort
Thanks !! |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
R01 4009
R02 4010
R03 4109
R04 4009
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(10,2,CH,EQ,C'40',AND,12,2,CH,EQ,C'09'),
OVERLAY=(12:C'90'))
/*
|
SORTOUT will have:
Code: |
R01 4090
R02 4010
R03 4109
R04 4090
|
|
|