Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us