× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



If need a random number for something like this, you may want to use the
pseudo random number generator that's part of the CIPHER MI. I'm not
sure if there is code in the archives for this or not but I know there
are examples of calling CIPHER and calling this function is very easy.
Info on CIPHER can be found at
http://publib.boulder.ibm.com/iseries/v5r1/ic2924/tstudio/tech_ref/mi/CI
PHER.htm.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark Allen
Sent: Wednesday, April 04, 2007 3:12 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Floating point conversion

then I had a heck of a lucky/unlucky run back in 1999-2001 when I worked
for
a company that did random drug testing. Of the 32 months I worked there
I
got selected for a "random" test 16 times.....

On 4/4/07, Doug Palme <dpalme@xxxxxxxxxxx> wrote:

but if it's for something like selecting truck drivers for 'random'
drug
testing you ought to be advised that CEERAN0 doesn't necessarily have
as
long a sequence as we might like.

From what I have been able to extrapolate from the various documents,
including the one you included here (Bruce Viking) CEERANO will
produce
non
repeatable numbers that run into the thousands.

Drug testing reg's require that no less than 50% of the fleet be drug
tested
in a given year and each time a sampling is generated you must run it
over
the entire fleet, it is possible that the same driver could be
selected
theoretically each month for an entire year.

So if you have a fleet of say 5,000 drivers you must test no less than
2,500
in a given year and with most companies doing this on a monthly basis,
you
are selecting on average 209 drivers per month (of course that is
dependent
on the actual number of active drivers in that month).

I would be hard pressed to think that you would get the same number
generated twice in the same run with that low of a number. Of course
you
have me thinking now that a test would be interesting.

Douglas


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Buck
Sent: Wednesday, April 04, 2007 1:39 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Floating point conversion

I think I have a far clearer understanding now.....

One last thing to think about is the reason you want random numbers.
I
don't recall seeing the business case for the random number, but if
it's
for something like selecting truck drivers for 'random' drug testing
you
ought to be advised that CEERAN0 doesn't necessarily have as long a
sequence as we might like.

CEERAN0 generates it's numbers via an algorithm, which makes it
pseudo-random. That is, it appears to be random. But if you track
the
numbers long enough, you'll find that the sequence starts all over
again
from the beginning. How long that takes is the sequence length.

Read this IBM page (Thanks Bruce Vining!) for an alternative API that
has a longer sequence than CEERAN0.


http://www-912.ibm.com/s_dir/slkbase.NSF/0/00599805bfa9117f86256c4800598
9f6
?
OpenDocument

I had to do this very thing in Ye Olde Days. I used the October 1988
issue of Communications of the ACM, article on random numbers authored
by Stephen K Park and Keith W Miller as the basis of my routine (which
held up in court, as it turned out.)
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.








************************************************************************
****
This transmission may contain information that is privileged,
Confidential and/or exempt from disclosure under applicable law.
If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or use of the information
contained herein (including any reliance thereon) is STRICTLY
PROHIBITED. If you received this transmission in error, please
immediately contact the sender and destroy the material in its
entirety, whether in electronic or hard copy format. Thank you.


************************************************************************
****

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.