Thursday, July 22, 2010

SORT - Findrep

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 staisfied i need to write the entire record of the file unaltered to the output file.



//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'))
/*