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
 

 

example for skiprec & stoprec in sort

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

New User


Joined: 05 Jan 2006
Posts: 44

PostPosted: Wed Apr 19, 2006 6:33 pm    Post subject: example for skiprec & stoprec in sort
Reply with quote

Hi Friends ,

can any one give example code for skiprec & stoprec options for sort program .


is these options work in dfsort ?

if not in which sort will these options work ?


Thanks
venkata.
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 Apr 19, 2006 9:00 pm    Post subject:
Reply with quote

Yes, SKIPREC=x and STOPAFT=y are DFSORT options.

SKIPREC=x tells DFSORT to skip x records before it starts processing. STOPAFT=y tells DFSORT to stop after y records have been accepted for processing.

As an example, if your input file has:

RECORD 01
RECORD 02
RECORD 03
RECORD 04
RECORD 05
RECORD 06
RECORD 07
RECORD 08
RECORD 09
RECORD 10

and you use this DFSORT statement:

Code:

   OPTION COPY,SKIPREC=4,STOPAFT=3


your output file will have:

RECORD 05
RECORD 06
RECORD 07

SKIPREC=4 tells DFSORT to skip records 01-04. STOPAFT=3 tells DFSORT to stop after the next 3 records which are 05-07.

Another way you can do the same thing is to use:

Code:

   OPTION COPY
   OUTFIL STARTREC=5,ENDREC=7


This tells DFSORT to start at record 5 and end at record 7.

However, note that with STOPAFT, DFSORT actually stops reading the records when the STOPAFT count is satisfied, so only 7 records will be read, whereas with ENDREC, DFSORT reads all of the records. So STOPAFT is actually more efficient.

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: Wed Apr 19, 2006 9:05 pm    Post subject:
Reply with quote

Quote:
please do the needful .


I'm seeing this phrase a lot lately from various people. FYI, the correct English phrase is actually "Please do what's necessary.". Although in this context "Please help." would probably be more appropriate, albeit somewhat redundant since this is a help board.
Back to top
View user's profile Send private message
VENKATA999
Warnings : 2

New User


Joined: 05 Jan 2006
Posts: 44

PostPosted: Thu Apr 20, 2006 12:34 am    Post subject: Re: example for skiprec & stoprec in sort
Reply with quote

Hi Frank ,

i am sorry for that , i should have written like "please help me" . Please excuse me , i will correct myself in future posts .

Thanks a lot ...
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 Apr 20, 2006 12:48 am    Post subject:
Reply with quote

Don't worry about it. Just thought you'd want to know. We all know English is a difficult language.
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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