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 

Randomly selecting records

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


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Wed Sep 27, 2006 1:47 pm    Post subject: Randomly selecting records Reply with quote

Hi,

I want to copy the 10% of the total records from input file to output file by randomly picking up the records from input file using any utilities. We have syncsort, fileaid.

For example if the total records in input file is 100 then I need to copy 10 records to output file by randomly selecting (For example 1st,14,21,33,39 60,64,70,81,88 records) the records from input file.

The DCB parameters for input and output files are as follows LRECL=80, RECFM=FB.

Regards,
Chandra.
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 27, 2006 2:10 pm    Post subject: Reply with quote

chandra wrote:

For example if the total records in input file is 100 then I need to copy 10 records to output file by randomly selecting (For example 1st,14,21,33,39 60,64,70,81,88 records) the records from input file.


Chandra,

How did you come with the records no: 1, 14 , 21, 33... ? Do you want the system to generate the random record no: and write it to the output record?

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


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Wed Sep 27, 2006 3:29 pm    Post subject: Reply with quote

Yes Kolusu,

System should generate the random record numbers and copy it to output file. The total records in input file may be different each time.


Thank you,
Chandra.
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 27, 2006 4:51 pm    Post subject: Reply with quote

chandra,

Sort products do not have any built in functions for generating random numbers. You can use a rexx to generate the random numbers and pass it to sort to pick the desired records.

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


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Fri Sep 29, 2006 9:23 am    Post subject: Reply with quote

Thank you Kolusu,

I will try and let you know.


Chandra.
_________________
Regards,
Chandra
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