IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Extract selective records based on record count


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 10, 2011 2:35 pm
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
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 10, 2011 3:29 pm
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

Moderator Emeritus


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

PostPosted: Thu Nov 10, 2011 8:51 pm
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 Developer


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

PostPosted: Fri Nov 11, 2011 12:49 am
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:

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
Reply with quote

Thanks Frank,

It worked for me.



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

Moderator Emeritus


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

PostPosted: Fri Nov 11, 2011 11:52 pm
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 Developer


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

PostPosted: Sat Nov 12, 2011 12:14 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top