Robert A. Rosenberg at IBM Mainframe Discussion List <[email protected]>
wrote on 07/28/2011 09:55:42 AM:
> I was wondering if anyone would suggest this simple solution to the
> problem (you can then do a 2nd sort of the original SORTOUT to
> restore to original order). I forget the function of STARTREC (ie:
> does it suppress the first INPUT or OUTPUT records?). If suppressing
> OUTPUT records this solution will work since you first must sort ALL
> the records to identify the last X records. If it skips X input
> records before sorting the rest then this solution will not work
> since it will not produce the same result as STARTREC=YYYY (where
> YYYY is total records minus X).

STARTREC=n starts at the nth OUTFIL input record.

ENDREC=n stops at the nth OUTFIL input record.

So you could SORT descending and use ENDREC=n to get the last n records,
and then SORT ascending to get those n records back in order.

But the SUBSET operator of DFSORT's ICETOOL is simpler and more efficient
since it uses COPY instead of SORT.

SUBSET FROM(IN) TO(OUT) INPUT KEEP LAST(8)

Frank Yaeger - DFSORT Development Team (IBM) - [email protected]
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, 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

Reply via email to