Sorry, there is a formatting error in my post.  There should NOT be a
blank line between the SUM and OUTFIL control cards.  

Sincerely,
John Reda
Software Services Manager
Syncsort Inc.
201-930-8260

> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
> Behalf Of Reda, John
> Sent: Monday, January 29, 2007 11:16 AM
> To: [email protected]
> Subject: Re: SORT - Logical EOF on SORTIN
> 
> The following solution will work with SyncSort and should work with
> DFSORT also.  It requires 2 passes of the data but if the data volume
is
> not large than this should not present a problem.  In English, the
> approach taken is to have STEP1 build the SORT control card to be used
> by STEP2 (the step that actually produces the output that you want).
In
> this example I changed the X'0000' to ZD'00' to make the example
easier
> to visualize.  I also do not know what the SORT control statement for
> STEP2 should look like so I simply chose 5,4,CH,A but the example can
be
> changed to be whatever it needs to be. In the real-world case the
SORTIN
> data set in both STEP1 and STEP2 are both the same real data set not
> in-stream data.  This was done for the sake of the demonstration.  The
> size of the SEQNUM field may need to be increased in your case.  The
> actual solution looks like:
> 
> //STEP1   EXEC PGM=SYNCSORT
> //SYSOUT  DD  SYSOUT=*
> //SORTIN  DD  *
> 12RECORD 1
> 55RECORD 2
> 00RECORD 3
> 42RECORD 4
> 00RECORD 5
> 32RECORD 6
> //SORTOUT DD DISP=(,PASS),DSN=&&SYSIN,UNIT=SYSDA,SPACE=(CYL,1)
> //SYSIN   DD  *
>  SORT FIELDS=(1,2,ZD,A),EQUALS
>  INREC FIELDS=(1,2,SEQNUM,4,ZD)
>  SUM FIELDS=NONE
> 
>  OUTFIL INCLUDE=(1,2,ZD,EQ,0),
>         OUTREC=(C'  SORT FIELDS=(5,4,CH,A),STOPAFT=',3,4,41C' ')
> //*------------------------------
> //STEP2   EXEC PGM=SYNCSORT
> //SYSOUT  DD  SYSOUT=*
> //SORTIN  DD  *
> 12RECORD 1
> 55RECORD 2
> 00RECORD 3
> 42RECORD 4
> 00RECORD 5
> 32RECORD 6
> //SORTOUT DD SYSOUT=*
> //SYSIN DD DSN=&&SYSIN,DISP=SHR
> 
> 
> I would be happy to work with you further if you would like to discuss
> this approach and I will continue to look for a more efficient method
of
> doing this.
> 
> Sincerely,
> John Reda
> Software Services Manager
> Syncsort Inc.
> 201-930-8260
> 
> > -----Original Message-----
> > From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
> > Behalf Of Gilbert Saint-Flour
> > Sent: Monday, January 29, 2007 10:25 AM
> > To: [email protected]
> > Subject: SORT - Logical EOF on SORTIN
> >
> > Hello:
> >
> > I am looking for a way to tell DFSORT to stop reading the SORTIN
data
> set
> > when
> > it reaches a record with X'0000' in pos 1-2.  I looked at the latest
> > DFSORT
> > doc but didn't see anything that could help me, other than an E15
> exit,
> > which
> > is precisely what I'm trying to stay clear of.  Any idea anyone?
> > Same question with SYNCSORT.
> >
> > --
> >  Gilbert Saint-Flour
> >  GSF Software
> >  http://gsf-soft.com/Freeware/
> >  http://gsf-soft.com/Documents/

----------------------------------------------------------------------
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

Reply via email to