IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get last 100 Record from a SYNCSORT file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Tue Aug 19, 2008 11:24 pm
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
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 Developer


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

PostPosted: Wed Aug 20, 2008 3:13 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top