View previous topic :: View next topic
|
Author |
Message |
srkumar422
New User
Joined: 27 Mar 2006 Posts: 16
|
|
|
|
Hi
i have 10 records in a dataset. I want to copy only 9 records into another dataset. How i can do this in JCL. |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
use
|
|
Back to top |
|
|
srkumar422
New User
Joined: 27 Mar 2006 Posts: 16
|
|
|
|
Hi thanks for the quick reply.
My file is too big ... some millinons of records. I dont know the total number of records. So in this case how i can procedd.
or i can put my problem in this way.
I have some number of records in my file. I need to remove the last record. That is my requirement. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
In the inrec, add a sequence number.
Sort decending on the sequence number.
In outrec, skip 1.
Resort ascending on the sequence number.
In outrec, drop the sequence number.
You can skip the sequence number if there is a valid set of sort keys already in the record. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
srkumar422,
Is there some way to identify the last record (e.g. 'TRL' in positions 1-3) or can it only be identified as the last record in the file. If the former, you can use an OMIT statement. If the latter, you can use the technique described in the "Keep the last n records" Smart DFSORT Trick at:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ |
|
Back to top |
|
|
srkumar422
New User
Joined: 27 Mar 2006 Posts: 16
|
|
|
|
It worked............ |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If there's no way to identify the last record (or even if there is), you can use DFSORT's new SUBSET operator available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to do this kind of thing 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) REMOVE INPUT TRAILER
/*
|
For complete details on the new SUBSET function and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|