HP3000-L Archives

July 1999, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Shawn Gordon <[log in to unmask]>
Reply To:
Shawn Gordon <[log in to unmask]>
Date:
Wed, 28 Jul 1999 11:43:26 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (29 lines)
I'm not sure about keeping it to 4 digits, but here is something you can
use.

01 RAND                    PIC S9(9)   COMP VALUE 0.
01 SEED                    PIC S9(9)   COMP VALUE 0.

 CALL INTRINSIC 'RAND1' GIVING SEED.
CALL INTRINSIC 'RAND' USING SEED GIVING RAND






Connie Sellitto <[log in to unmask]> on 07/28/99 11:29:32 AM

Please respond to Connie Sellitto <[log in to unmask]>

To:   [log in to unmask]
cc:    (bcc: Shawn Gordon/IS/FHM/FHS)
Subject:  COBOL Random number generator




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?

ATOM RSS1 RSS2