Rashmi Nijaguni Mogali wrote on 03/19/2007 05:51:18 AM:
> I have the following requirement:
>
> Input file:
>
---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
> 400000000910024892 123 234
> 400000000100324890 456 567
> 400000000910024891 789 890
>
> Output file:
>
---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
> 400000000910024892 123 234
> 400000000100324890 456 567
> 400000000910024891 789 890
>
> Whenever there the value in column 1 of input file is 4 I need the data
> at position 30 shifted to 25 and data at position 50 shifted to 45. The
> length of this data is fixed i.e. 3 bytes.
>
> The length of the input file is 250 bytes.
>
> How can I do this using SORT?
Here's a DFSORT job that will do what you asked for:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/250)
//SORTOUT DD DSN=... output file (FB/250)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'4'),
OVERLAY=(25:30,3,30:3X,45:50,3,50:3X))
/*
Frank Yaeger - DFSORT Team (IBM) - [EMAIL PROTECTED]
Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html