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
 

 

Need to skip particular record and copy rest of the records

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

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Fri May 25, 2007 10:31 pm    Post subject: Need to skip particular record and copy rest of the records
Reply with quote

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
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun May 27, 2007 12:54 am    Post subject:
Reply with quote

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
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Wed Jun 06, 2007 1:38 pm    Post subject: Re: Need to skip particular record and copy rest of the reco
Reply with quote

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
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Wed Jun 06, 2007 2:44 pm    Post subject:
Reply with quote

you can use STOPAFT=60002 and then STARTREC=60004
Back to top
View user's profile Send private message
SREELAKSHMINARAYANAN

New User


Joined: 27 Jul 2006
Posts: 7

PostPosted: Wed Jun 06, 2007 4:49 pm    Post subject: Re: Need to skip particular record and copy rest of the reco
Reply with quote

Where STOPAFT piece of code has to be in SYSIN Card
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Wed Jun 06, 2007 5:33 pm    Post subject: Re: Need to skip particular record and copy rest of the reco
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jun 06, 2007 8:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Thu Jun 07, 2007 9:45 am    Post subject: Re: Need to skip particular record and copy rest of the reco
Reply with quote

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
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Thu Jun 07, 2007 3:52 pm    Post subject:
Reply with quote

Thanks Frank.....
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Sun Jun 17, 2007 6:46 pm    Post subject: Re: Need to skip particular record and copy rest of the reco
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sun Jun 17, 2007 7:05 pm    Post subject:
Reply with quote

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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 Aug 28, 2008 11:38 pm    Post subject:
Reply with quote

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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Sun Aug 31, 2008 7:47 am    Post subject: Reply to: Need to skip particular record and copy rest of th
Reply with quote

Thanks a lot Frank for sharing this information.

Happy weekend

Thanks
Aneeta
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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