Posted: Wed Sep 27, 2006 1:47 pm Post subject: Randomly selecting records
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.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Sep 27, 2006 2:10 pm Post subject:
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?
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Sep 27, 2006 4:51 pm Post subject:
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.
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