View previous topic :: View next topic
|
Author |
Message |
Shaheen Kalokhe
New User
Joined: 21 Feb 2008 Posts: 21 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes. |
|
Back to top |
|
|
Shaheen Kalokhe
New User
Joined: 21 Feb 2008 Posts: 21 Location: India
|
|
|
|
Thanks Bill,
Can you help with the SORT card?
Regards
Shaheen |
|
Back to top |
|
|
Aloke Maity
New User
Joined: 25 Mar 2010 Posts: 4 Location: Hyderabad
|
|
|
|
Can you please clear the requirement with a brief example.
Thank you,
Aloke |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
searching the dfsort forum will return quite a few hits on how to do it! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Shaheen Kalokhe
New User
Joined: 21 Feb 2008 Posts: 21 Location: India
|
|
|
|
Thanks Frank,
It worked for me.
Regards
Shaheen |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Of course it worked - it would be interesting to know why it was needed.
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
But if he told you, he'd have to kill you. |
|
Back to top |
|
|
rakesha.hg
Active User
Joined: 21 Mar 2008 Posts: 161 Location: bangalore
|
|
|
|
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
Record 10,28 & 45 ..... kudos & hats off to franks patience |
|
Back to top |
|
|
|