Clicky
Skip to Content
Custom Search

Reply to comment

Anonymous
RE:Skip first n records and last n records in a file

 

You can easily skip records from top by using SKIPREC command. But for skipping records from bottom, you may consider the following 
approach
 
 -Add a sequence number atthe end of the file(using SEQNUM,7,ZD as the sortcard
 
 -Sort the file by the sequence number in descending order, which will bring records from bottom to top.
 
 -Now use skiprec to skip n records
 
 -Sort the file again in ascending order of sequence number, to bring it back to original order.
 
 -Remove the sequence number using INREC/OUTREC
 

Reply

  • Allowed HTML tags:
      1. Lines and paragraphs break automatically.

    More information about formatting options

    CAPTCHA
    This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Navigation

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Number of Registered users 713
Theme by Dr. Radut.