Subject: | |
From: | |
Reply To: | Dave Powell, MMfab |
Date: | Tue, 12 Dec 2006 18:47:58 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Add 1 to the seed each time? Use the previous result as the seed ?
----- Original Message -----
From: "Brian Donaldson" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Tuesday, December 12, 2006 17:35
Subject: [HP3000-L] Cobol Function RANDOM "Problem" Issue
I’m using the combination of the system date (X8) and time (X8) as the seed
for the Cobol function RANDOM (e.g. 2006121309215430 may be the date/time
combo seed). Works fine the first time it is executed. The result being moved
into a PIC S9(18) COMP field.
The problem is that the next time around executing this routine the
date/time combo may not have advanced any, therefore giving me the same
“random”
number.
I thought the date/time combo might be unique but obviously not. Then I
thought by pausing the program for one second before getting the system
date/time again might help things along.
The problem with that -- the run time of the program is significantly
increased.
Has anyone any idea on how to pass a (more) unique seed number to the random
function?
Any and all suggestions will be greatly appreciated.
TIA,
Brian Donaldson.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|