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 selective records based on record count

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

New User


Joined: 21 Feb 2008
Posts: 21
Location: India

PostPosted: Thu Nov 10, 2011 2:20 pm    Post subject: Extract selective records based on record count
Reply with quote

Input file has 100 records, FB, length 80
I want to extract selective records based on their occurenec in the file
E.g. If i want to extract only the 10,28 and 45th record. Can this be done using Sort.


Thanks
Shaheen
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Nov 10, 2011 2:35 pm    Post subject: Reply to: Extract selective records based on record count
Reply with quote

Yes.
Back to top
View user's profile Send private message
Shaheen Kalokhe

New User


Joined: 21 Feb 2008
Posts: 21
Location: India

PostPosted: Thu Nov 10, 2011 2:39 pm    Post subject:
Reply with quote

Thanks Bill,

Can you help with the SORT card?

Regards
Shaheen
Back to top
View user's profile Send private message
Aloke Maity

New User


Joined: 25 Mar 2010
Posts: 4
Location: Hyderabad

PostPosted: Thu Nov 10, 2011 3:27 pm    Post subject:
Reply with quote

Can you please clear the requirement with a brief example.

Thank you,
Aloke
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Nov 10, 2011 3:29 pm    Post subject: Reply to: Extract selective records based on record count
Reply with quote

searching the dfsort forum will return quite a few hits on how to do it!
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 10, 2011 8:51 pm    Post subject:
Reply with quote

Hello,

Quote:
If i want to extract only the 10,28 and 45th record.
Why does someone believe this needs to be done? What kind of business functionality would this support?
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 Nov 11, 2011 12:49 am    Post subject:
Reply with quote

Shaheen,

You can use the SUBSET operator of DFSORT's ICETOOL to select specific records by relative record number, e.g.

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) INPUT KEEP RRN(10) RRN(28) RRN(45)
/*


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:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
Shaheen Kalokhe

New User


Joined: 21 Feb 2008
Posts: 21
Location: India

PostPosted: Fri Nov 11, 2011 12:47 pm    Post subject:
Reply with quote

Thanks Frank,

It worked for me.



Regards
Shaheen
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Nov 11, 2011 11:52 pm    Post subject: Reply to: Extract selective records based on record count
Reply with quote

Hello,

Of course it worked - it would be interesting to know why it was needed.

d
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: Sat Nov 12, 2011 12:14 am    Post subject:
Reply with quote

But if he told you, he'd have to kill you. icon_lol.gif
Back to top
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Wed Dec 14, 2011 3:17 pm    Post subject: Re: Reply to: Extract selective records based on record coun
Reply with quote

dick scherrer wrote:
Hello,

Of course it worked - it would be interesting to know why it was needed.

d


Well i'm taking a wild guess here .... rather than the business requirement, it looks more like a TS's Unit Test requirement icon_exclaim.gif icon_biggrin.gif
Record 10,28 & 45 ..... kudos & hats off to franks patience icon_smile.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 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 split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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