View previous topic :: View next topic
|
Author |
Message |
pjnithin
Active User
Joined: 22 Dec 2005 Posts: 116
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
pjnithin
Active User
Joined: 22 Dec 2005 Posts: 116
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
Use [URL] BBCode for External Links
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 |
|
|
Gautam512
Active User
Joined: 05 Oct 2005 Posts: 308 Location: Vizag / US
|
|
|
|
This can be done by a small rexx program....
Can be more specific requirements
Thanks,
Gau |
|
Back to top |
|
|
pjnithin
Active User
Joined: 22 Dec 2005 Posts: 116
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|