Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us