Add a POST85 to your $CONTROL line and use the random function as follows:
WORKING-STORAGE
01 MY-NUMBER PIC 9(04) VALUE 0.
PROCEDURE DIVISION.
COMPUTE MY-NUMBER = FUNCTION RANDOM (1).
The number in () is a seed number.
#Joseph Norris (Perl - what else is there?/HP3000/Linux/CGI/Msql)
print @c=map chr $_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,
-68,4,-3,-1,7,1,14,-68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);
On Wed, 28 Jul 1999, Connie Sellitto wrote:
Writing in COBOLII on an HP3000 937, I need a routine to generate a 4-digit
random number, either on the fly, or to set up as a table. Any
suggestions?
|