Thanks for the solution Frank. But unfortunately my system doesn't support DFSORT statements.
I am running on: SYNCSORT FOR Z/OS 1.1CR TPF3A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYNCSORT INC. Any ideas? -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Frank Yaeger Sent: Monday, March 19, 2007 8:16 PM To: [email protected] Subject: Re: Help for SORT requirement 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 **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** ---------------------------------------------------------------------- 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

