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
 
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: 52
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: 52
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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 5 Thu Nov 23, 2017 3:32 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

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