|
View previous topic :: View next topic
|
| Author |
Message |
VENKATA999 Warnings : 2 New User
.jpg)
Joined: 05 Jan 2006 Posts: 44
|
|
|
|
Hi Friends ,
can any one give example code for skiprec & stopaft options for sort program .
is these options work in dfsort ?
if not in which sort will these options work ?
Thanks
venkata. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| 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 |
|
 |
VENKATA999 Warnings : 2 New User
.jpg)
Joined: 05 Jan 2006 Posts: 44
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Don't worry about it. Just thought you'd want to know. We all know English is a difficult language. |
|
| Back to top |
|
 |
|
|