AFAIK you must call the CEERAN0 API to get random numbers
in ILE/Cobol (at least up thru V4R5).

Try this link at News400:

if this doesn't work, look at
and access the Cobol forum, then search for "random".  If your still
having a problem, let me know and I'll send it to you.


-----Original Message-----
From: Kelly Cookson []
Sent: Friday, August 24, 2001 9:10 AM
Subject: RANDOM function with COBOL400?

Newbie question.

I have to generate a list of randomly selected
employees for drug testing.  I was thinking of using
the RANDOM function.  Unless someone has a better
idea! :)

I can't seem to get the RANDOM function coded
properly.  When I code the following line using SEU:


SEU highlights the line and gives the following error

"ANS COBOL reserved word FUNCTION will be accepted as
a nonreserved word. A period is required before
RANDOM. Line rejected."

I tried coding the variation:


and got the error message:

"RANDOM not arithmetic expression. Line rejected."

What am I missing here?  How do I use the RANDOM
function in COBOL400?

Thanks in advance.

Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email:
To subscribe, unsubscribe, or change list options,
or email:

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2021 by 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.