IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

example for skiprec & stoprec in sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Wed Apr 19, 2006 9:00 pm
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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Apr 19, 2006 9:05 pm
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
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 Developer


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

PostPosted: Thu Apr 20, 2006 12:48 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top