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
 

 

Extract n records from xth record using DFSORT

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

New User


Joined: 22 Feb 2010
Posts: 47
Location: Cochin

PostPosted: Tue May 24, 2011 3:35 pm    Post subject: Extract n records from xth record using DFSORT
Reply with quote

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
View user's profile Send private message

nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Tue May 24, 2011 3:40 pm    Post subject: Re: Extract n records from xth record using DFSORT
Reply with quote

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
View user's profile Send private message
seahawk789

New User


Joined: 22 Feb 2010
Posts: 47
Location: Cochin

PostPosted: Tue May 24, 2011 3:55 pm    Post subject:
Reply with quote

Thanks..
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed May 25, 2011 2:47 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed May 25, 2011 10:32 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu May 26, 2011 2:07 pm    Post subject:
Reply with quote

Thanks Frank. It's nice to have you around.

Have a good one, icon_smile.gif
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu May 26, 2011 2:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu May 26, 2011 3:00 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu May 26, 2011 3:16 pm    Post subject:
Reply with quote

Lolz.... icon_lol.gif icon_lol.gif
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: Fri May 27, 2011 9:08 pm    Post subject:
Reply with quote

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. icon_wink.gif
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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