Gil,

You can do this in many different ways with the sort. Assuming an
80-byte record the following control cards is one way you can accomplish
this:

        INREC FIELDS=(1,80,SEQNUM,4,BI)

        SORT FIELDS=(81,4,BI,D)
.
        OUTFIL OUTREC=(1,80),ENDREC=1

John Reda
Syncsort, Inc.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Paul [EMAIL PROTECTED]
Sent: Friday, July 20, 2007 10:14 AM
To: [email protected]
Subject: Last Record

There's a thread active in TSO-REXX in which the OP wished
to extract the last record from a data set.  Of course, this
spawns a school of increasingly byzantine suggestions:

    Read into a stem and use the STEM.0th element

    Edit Macro

    Sort into reverse order and take the first.

    Count the legs and divde by four

(I suggested:

    cp "//'DATA.SET.NAME(MEMBER)'" /dev/fd/1 | tail -1

... )

But usually to such questions, Frank chimes in saying
it's a natural for DFSORT.  Is it?

-- gil

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