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
 

 

copying a particular set of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Thu Jan 05, 2006 9:25 pm    Post subject: copying a particular set of records
Reply with quote

I want to copy first 11 records and the last records from a sequential file.
Is there a direct method in sort other than using icetool.
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: Thu Jan 05, 2006 9:37 pm    Post subject:
Reply with quote

Quote:
want to copy first 11 records and the last records from a sequential file.


The "last records"? How many of the "last records"?

Quote:
Is there a direct method in sort other than using icetool.


Why "other than using icetool"?
Back to top
View user's profile Send private message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Thu Jan 05, 2006 9:41 pm    Post subject:
Reply with quote

not records, its just the last record. Its the trailer record.
Frank Yaeger wrote:
Quote:
want to copy first 11 records and the last records from a sequential file.


The "last records"? How many of the "last records"?

Quote:
Is there a direct method in sort other than using icetool.


Why "other than using icetool"?
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: Thu Jan 05, 2006 11:10 pm    Post subject:
Reply with quote

Getting the first 11 records is easy (STOPAFT=11 or ENDREC=11). To get the last record, you can use the method shown in the"Keep the last n records" Smart DFSORT Trick at:

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/

If you don't want to use ICETOOL for some reason, you can use two SORT steps instead of the two SORT operators.

There's also a trick for getting the last n records using COUNT-n with COPYs that's more efficient but if you don't want to use ICETOOL, you probably don't want to use COUNT-n from the Dec, 2004 DFSORT PTF either.
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 309
Location: Vizag / US

PostPosted: Thu Jan 05, 2006 11:30 pm    Post subject: Re: copying a particular set of records
Reply with quote

This can be done by a small rexx program....

Can be more specific requirements

Thanks,
Gau
Back to top
View user's profile Send private message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Fri Jan 06, 2006 12:10 am    Post subject: Re: copying a particular set of records
Reply with quote

I am not good in rexx...
and I need to do this by a sort job...
I have an input file with millions of records.....
i just want to copy the first 10 records and the last one record into another file.
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: Thu Sep 25, 2008 3:14 am    Post subject:
Reply with quote

Quote:
i just want to copy the first 10 records and the last one record into another file.


You can now do this kind of thing quite easily using the new SUBSET operator of DFSORT's ICETOOL available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

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) KEEP INPUT FIRST(10) LAST
/*     


For complete details on the new SUBSET function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am


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