× 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.



To be a bit more precise: the FUNCTION key word is not supported
in COBOL/400. Use ILE COBOL (source member attribute CBLLE).
This gets you past SEU, but it really doesn't help because RANDOM
is not supported in ILE COBOL.


From: Ray Harris <rharris@ntscom.com>
To: <cobol400-l@midrange.com>
Sent: Friday, August 24, 2001 8:39 AM
Subject: RE: RANDOM function with COBOL400?


> There is no random number function in cobol.  There are a couple of
callable
> cobol random number generators in a thread
> http://www.as400network.com/Forums/Thread.cfm?CFApp=19&Thread_ID=17435&mc=3
>
> > -----Original Message-----
> > From: cobol400-l-admin@midrange.com
> > [mailto:cobol400-l-admin@midrange.com]On Behalf Of Kelly Cookson
> > Sent: Friday, August 24, 2001 8:10 AM
> > To: COBOL400-L@midrange.com
> > 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:
> >
> >      COMPUTE X = FUNCTION RANDOM.
> >
> > SEU highlights the line and gives the following error
> > message:
> >
> > "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:
> >
> >     COMPUTE X = RANDOM.
> >
> > 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?




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.