MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Select only x records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
cobcurious
Beginner


Joined: 04 Oct 2003
Posts: 68
Topics: 25

PostPosted: Sat Aug 28, 2010 10:19 am    Post subject: Select only x records Reply with quote

Hi Experts,

We have a dataset containing unique identifiers and associate data. The dataset is sorted on the unique identifiers. The count of unique identifiers may vary from 1 to any number. I need to select 30 records of each unqiue identifier. If there are less than 30 records...say 25 for a given unique identifier then I need all the records (25) corresponding to that identifier.

Please advise as to how we can do using DFSORT? We found a workaround by using EZYTREIVE.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Sat Aug 28, 2010 1:19 pm    Post subject: Reply with quote

Easytrieve is not a workaround - it is currently your solution Smile

Post some sample data and the output you want from the sample data. Mention the dsorg and lrecl of the files and the relevant data positions.
_________________
All the best,

di


Last edited by papadi on Sat Aug 28, 2010 2:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Sat Aug 28, 2010 1:33 pm    Post subject: Reply with quote

cobcurious,

You can now use the SELECT FIRST(n) function to do this more easily like this. I assumed your unique identifier is in the first 8 bytes.
Code:

//STEP0100  EXEC  PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN        DD DSN=...  input file
//FIRST30   DD DSN=...  output file
//TOOLIN    DD *
 SELECT FROM(IN) TO(FIRST30) ON(1,8,CH) FIRST(30)
//*


For complete details on the new FIRST(n) function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cobcurious
Beginner


Joined: 04 Oct 2003
Posts: 68
Topics: 25

PostPosted: Mon Aug 30, 2010 11:18 pm    Post subject: Reply with quote

Hi Kolusu,

Thanks, let me try it out. I am sure it will work. Thanks in advance.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group