View previous topic :: View next topic
|
Author |
Message |
aneeta
New User
Joined: 08 Dec 2005 Posts: 48 Location: Chennai
|
|
|
|
Hi,
I have a file with 1,00,000 records.I want to skip the 60,003th record and copy the remaining 99,999 records into the output file.The records are skipped based on the record count and no specific criteria.
Can this be done thru DFSORT?
Thanks
Aneeta |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Aneeta,
Do you want to copy records 1 to 60002 and 60004 to 100000? Or do you want to do something else? Please clarify using the numbers of all of the records to be copied.
What is the RECFM and LRECL of your input file? |
|
Back to top |
|
|
aneeta
New User
Joined: 08 Dec 2005 Posts: 48 Location: Chennai
|
|
|
|
Hi Frank,
Sorry for the late reply.
Yes.I want to copy records 1 to 60002 and 60004 to 100000.ie.skip 60003.
LRECL:80 and RECFM=FB
Thanks
Aneeta |
|
Back to top |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
you can use STOPAFT=60002 and then STARTREC=60004 |
|
Back to top |
|
|
SREELAKSHMINARAYANAN
New User
Joined: 27 Jul 2006 Posts: 7
|
|
|
|
Where STOPAFT piece of code has to be in SYSIN Card |
|
Back to top |
|
|
skkp2006
New User
Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
Try this .......
//STEP01 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TST5.TEST.FILE.SYAM,DISP=SHR
//SORTOUT DD DSN=TST5.TEST.FILE.SORT,DISP=OLD
//TOOLSMSG DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(81:SEQNUM,8,ZD)
OUTFIL BUILD=(1,80)
OMIT COND=(81,8,ZD,EQ,60003)
/*
Regards
Syam |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Anneeta,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(81:SEQNUM,8,ZD)
OUTFIL OMIT=(81,8,ZD,EQ,60003),BUILD=(1,80)
/*
|
priyamnavada,
It would take two passes to do this with SKIPREC and STOPAFT whereas it can be done with one pass as shown above.
Syam,
If you had bothered to test your "solution" you would have found out that it doesn't work. The OMIT statement is processed before the INREC statement so the OMIT statemenht has no sequence number to operate on. Using INREC and OUTFIL OMIT does work since OUTFIL is processed after INREC. |
|
Back to top |
|
|
skkp2006
New User
Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
Thanks Frank....
You are correct :-(.I tested the job before posting the reply.What happened was that i was using
INREC OVERLAY=(71:SEQNUM,8,ZD) for the overlay and the file was having the default sequence nos over there.The particular record was getting eliminated perfectly and i thought that the OMIT COND is working.Pretty tricky for me....
Regards
Syam |
|
Back to top |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
Thanks Frank..... |
|
Back to top |
|
|
aneeta
New User
Joined: 08 Dec 2005 Posts: 48 Location: Chennai
|
|
|
|
Thanks Frank.Your solutions are simply great.Thanks again for your help.
I am very interested in DFSORT and working hard to explore the options available.
Regards
Aneeta |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Frank Yaeger wrote: |
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
With z/OS DFSORT V1R5 PTF UK90013 (July, 2008) you can use DFSORT's new SUBSET operator to do this kind of thing quite easily 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 RRN(60003)
/*
|
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 |
|
|
aneeta
New User
Joined: 08 Dec 2005 Posts: 48 Location: Chennai
|
|
|
|
Thanks a lot Frank for sharing this information.
Happy weekend
Thanks
Aneeta |
|
Back to top |
|
|
|