SyncSort supports the application that Frank proposed. It is the
simplest and most straight forward way to handle the situation.
Unfortunately you appear to be using an older version of the product
that does not have this support in it. You need to be using 1.2.1 or
later. Since you don't have access to that I can propose a slightly
more costly solution but it should work.
//STEP1 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=your.input.dataset
//SORTOF01 DD DISP=(,PASS),DSN=&&OUT1,UNIT=SYSDA,SPACE=(CYL,50)
//SORTOF02 DD DISP=(,PASS),DSN=&&OUT2,UNIT=SYSDA,SPACE=(CYL,50)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(1,250,SEQNUM,4,ZD)
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(1,1,CH,EQ,C'4'),
OUTREC=(1,24,30,3,28,2,3C' ',33,12,50,3,48,2,3C' ',53,202)
OUTFIL FILES=02,
INCLUDE=(1,1,CH,NE,C'4')
/*
//STEP2 EXEC PGM=SORT
//SORTIN DD DISP=OLD,DSN=&&OUT1
// DD DISP=OLD,DSN=&&OUT2
//SORTOUT DD DSN=your.output.dataset,DISP=(,CATLG),UNIT=SYSDA
//SYSIN DD *
SORT FIELDS=(251,4,CH,A)
OUTREC FIELDS=(1,250)
/*
//SYSOUT DD SYSOUT=*
I am unclear from your original post of the exact columns of your data.
Your graphic seemed to imply one set of column numbers but your write up
seemed slightly different. Please check the columns to be sure.
If this doesn't work, please let me know. If you would like to get to a
more current version of the sort please contact support.
Sincerely,
John Reda
Software Services Manager
Syncsort Inc.
201-930-8260
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
> Behalf Of Rashmi Nijaguni Mogali
> Sent: Tuesday, March 20, 2007 2:53 AM
> To: [email protected]
> Subject: Re: Help for SORT requirement
>
> 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---
> > 400000000910024892 123 234
> > 400000000100324890 456 567
> > 400000000910024891 789 890
> >
> > Output file:
> >
>
---+----1----+----2----+----3----+----4----+----5----+----6----+----7---
> > 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))
> /*
----------------------------------------------------------------------
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