View previous topic :: View next topic
|
Author |
Message |
kumara.kranthi
New User
Joined: 03 Nov 2006 Posts: 21
|
|
|
|
Hello All,
Please help me my file contain N records , i want to copy N-1 records and skip Last records,Please give Sort Card for this.
Thanks,
KK |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
kumara.kranthi
Please do not start a new topic in an existing thread.
Topic split. |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
You can use the folowing code.
Code: |
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INDD DD DSN= INPUT FILE
//OUTDD DD DISP=OUTPUT FILE
//TOOLIN DD *
SUBSET FROM (INDD) TO (OUTDD) REMOVE INPUT LAST
/*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
KK,
Note that you will need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) in order to use the new SUBSET operator. Ask your System Programmer to install that PTF (it's free). For complete details on all of the new functions available with that PTF, see:
Use [URL] BBCode for External Links
In the meantime, you can use the technique described in the "Keep the last n records" Smart DFSORT Trick at:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
kumara.kranthi
New User
Joined: 03 Nov 2006 Posts: 21
|
|
|
|
Frank,
Thanks for yours help!!
Example: My file contain 1000 records or N records (include header and trailer),now i want to do Skip 1st and last record and copy all the records.
Could you please help me for Sort card on this.
Thanks,
KK |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Again, you can use the new SUBSET operator as follows if you have z/OS DFSORT V1R5 PTF UK90013 (July, 2008):
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 HEADER TRAILER
/*
|
I can show you a more complex way to do this without SUBSET, but I need to know the RECFM and LRECL of the input file. |
|
Back to top |
|
|
kumara.kranthi
New User
Joined: 03 Nov 2006 Posts: 21
|
|
|
|
Thanks for yours quick response.
LRECL=210 and RECFM=FB |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Frank,
Just I want to ask a question on version of DFSORT.
How can we check whether the SORT we are using is z/OS DFSORT V1R5 PTF UK90013 or not?
When I am executing SORT, getting the following.
Quote: |
CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5.
|
Is this updated version to execute newly included options like SUBSET? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
How can we check whether the SORT we are using is z/OS DFSORT V1R5 PTF UK90013 or not? |
Run a DFSORT job and look at the ICE201I message. If it has an F after ICE201I, you have PTF UK90013.
ICE201I F RECORD TYPE ...
If it has an E after ICE201I, you don't have PTF UK90013.
Note that your System Programmer must install PTF UK90013 in order to make it available.
Quote: |
When I am executing SORT, getting the following.
CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5.
Is this updated version to execute newly included options like SUBSET?
|
That message just tells you you're using z/OS DFSORT V1R5 ... it doesn't tell you which PTFs are installed. You need PTF UK90013 to use SUBSET (see ICE201I to determine if you have that PTF). |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
kumara.kranthi,
Here's a DFSORT job that will do what you asked for without PTF UK90013:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/210)
//C1 DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=C1,REMOVECC,NODETAIL,
BUILD=(80X),
TRAILER1=(' OPTION COPY,SKIPREC=1,',
'STOPAFT=',COUNT-2=(M11,LENGTH=8))
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/210)
//SORTOUT DD DSN=... output file (FB/210)
//SYSIN DD DSN=&&C1,DISP=(OLD,PASS)
|
|
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
Frank Yaeger wrote: |
Quote: |
How can we check whether the SORT we are using is z/OS DFSORT V1R5 PTF UK90013 or not? |
Run a DFSORT job and look at the ICE201I message. If it has an F after ICE201I, you have PTF UK90013.
ICE201I F RECORD TYPE ...
If it has an E after ICE201I, you don't have PTF UK90013.
Note that your System Programmer must install PTF UK90013 in order to make it available.
Quote: |
When I am executing SORT, getting the following.
CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5.
Is this updated version to execute newly included options like SUBSET?
|
That message just tells you you're using z/OS DFSORT V1R5 ... it doesn't tell you which PTFs are installed. You need PTF UK90013 to use SUBSET (see ICE201I to determine if you have that PTF). |
Hi Frank i found this :
Code: |
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
|
Does this mean that PTFs are installed. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Look at your message and Frank's info.
Your message has an E following ICE201I - which is not PTF UK90013 (which is an F). |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
dick scherrer wrote: |
Hello,
Look at your message and Frank's info.
Your message has an E following ICE201I - which is not PTF UK90013 (which is an F). |
Little confused earlier..Now Got it..Thank you dick.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
Quote: |
Little confused earlier.. |
Not to worry, we all get there sometimes
d |
|
Back to top |
|
|
|