Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to get last 100 Record from a SYNCSORT file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
krishna_Murty
Warnings : 2

New User


Joined: 17 Sep 2006
Posts: 24

PostPosted: Tue Aug 19, 2008 8:55 pm    Post subject: How to get last 100 Record from a SYNCSORT file
Reply with quote

As we have option called OPTION COPY,STOPAFT=10000
to pull first 10000 records. Do we have any option to pull last 100 records or so like that.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 19, 2008 11:24 pm    Post subject:
Reply with quote

Hello,

Quote:
Do we have any option to pull last 100 records or so like that
Not directly. There is no COPYLAST=nnnn feature that i'm aware of.
Back to top
View user's profile Send private message
Venugopalsubbiah

New User


Joined: 12 Aug 2008
Posts: 7
Location: Bangalore

PostPosted: Wed Aug 20, 2008 1:33 am    Post subject:
Reply with quote

If you know the total number of records in that file, you can use the sort card to achieve your requirement.

Lets say you have 1000 records in that file and want to select only last 10 records. Then

SORT FIELDS=COPY
OUTFIL FILES=1, STARTREC=901

I we do not have any way to just say lastrec=100

Hope this helps.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Aug 20, 2008 3:13 am    Post subject:
Reply with quote

Krishna,

If by any chance you have access to DFSORT, you could use this DFSORT/ICETOOL job:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) INPUT KEEP LAST(100)
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us