Discussion Locked
0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is there an operator in IBM's DFSORT or ICEMAN that will print or dump the last n records of a dataset? (e.g. The last 10 records of a dataset).
1 reply
by chris.bonner
I've done this in multiple steps, when I don't know how many records there are.
Step 1. SORT FIELDS=COPY the file, appending sequence numbers to the end of each record. I.E., OUTREC FIELDS=(1,80,SEQNUM,8,ZD...
Step 2. sort the output of step 1 in descending order of the sequence number you appended.
Step 3. sort copy the output of step 2, with a STOPAFT=10.
Step 4. sort the output of step 3, ascending order of sequence number, stripping off the sequence number.
You should be left with the last ten records of the file, in the same order as originally.
This discussion is closed to new replies.
Trending Software posts
Sort by Trending
Discussion
Useful software Tip or Shortcut
0 helpful
1 reply
Question Unanswered
Best Low-Latency VPN Protocols for Competitive Mobile and Online Gaming
0 helpful
0 replies
1 helpful
1 reply
Question Unanswered
How Are Teams Testing AI-Generated Code Before Production?
0 helpful
0 replies
0 helpful
5 replies