View previous topic :: View next topic
|
Author |
Message |
seahawk789
New User
Joined: 22 Feb 2010 Posts: 56 Location: Cochin
|
|
|
|
I have a file containing 1000 records. I want to extract 200 records from 500th record in the file.
Is it possible to achive it using DFSORT? |
|
Back to top |
|
|
nigelosberry
New User
Joined: 06 Jan 2009 Posts: 88 Location: Ggn, IN
|
|
|
|
seahawk789 wrote: |
I have a file containing 1000 records. I want to extract 200 records from 500th record in the file.
Is it possible to achive it using DFSORT? |
see the dfsort parameter SKIPREC and STOPAFT
go through quick reference for further details. |
|
Back to top |
|
|
seahawk789
New User
Joined: 22 Feb 2010 Posts: 56 Location: Cochin
|
|
|
|
Thanks.. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
If you've the PTF which supports SUBSET operator of ICETOOL, try 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) KEEP INPUT RRN(500,700) |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
FWIW, although SUBSET is generally easier to use and just as efficient, in this particular case, SKIPREC and STOPAFT is actually more efficient since STOPAFT actually stops reading records before end of file whereas SUBSET reads to end of file. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks Frank. It's nice to have you around.
Have a good one, |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Anuj Dhawan wrote: |
Thanks Frank. It's nice to have you around.
|
Hmm.. Really.. I wasn't aware of this fact what Frank mentioned.. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Sometimes I feel , how a product developer might look at us, The Application Developers(AD), something like
hey, kiddo, here is a new tool for you to play!
AD1 - oops! it deos not work!
AD2 - Well, it deos work!
.
.
.
chatter
chatter |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I often wonder if I do more harm than good by mentioning these little tidbits. Both SKIPREC/STOPAFT and SUBSET "work", that is, they produce the correct results.
SKIPREC and STOPAFT are more efficient in some cases vs SUBSET, but limited in what they can do vs SUBSET. So it's six of one and a half dozen of the other. If you have a very large data set, knowing that SKIPREC and STOPAFT are more efficient might make a difference to you. If you don't have a very large data set (or even if you do), you might not care. Choose your poison. |
|
Back to top |
|
|
|