|
Not sure if the following will help? pass the number of record in the file to the maxRandomNum. PgetRandom B D GetRandom pi 15 5 D maxRandomNum 15 5 const * D RandNum s 15 5 D RandFloat8 s 8f inz D RandInt4 s 10i 0 inz static D RandAlpha8 s 8a inz * C callb(d) 'CEERAN0' C parm RandInt4 C parm RandFloat8 C parm RandAlpha8 C eval RandNum=(maxRandomNum * RandFloat8) * C return RandNum PGetRandom E -----Original Message----- Hans Boldt wrote: First, get the number of records in the file. After the file is opened, the number is in position 156-159 in the INFDS. Next, use your favorite method to compute random numbers (such as the C runtime library function "rand()"), and convert them to the range computed in the first step. Compute as many as you need, checking for duplicates. Finally, read the records by relative record number.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.