On Wednesday 10 Nov 2010, John Culleton wrote:
I want to have a certain number randomly chosen every time a certain
program runs.
I have this in WORKING-STORAGE:
77 RANDUM PICTURE S9V9(10).
I have this statement:
COMPUTE RANDUM = FUNCTION RANDOM(0).
Every time I run the program the value of RANDUM is the same. If I
change the seed then I get a different number but that is repetitious
also. If I leave off the seed it acts as if the seed was zero.
I think you are misusing this function in regard to OC, form is:
Function returns a numeric value that is a pseudo-random number from a
rectangular distribution. The type of this function is numeric.
function random (argument-1)
the returned value is grater than or equal to zero and less than 1. The domain
of arg-1 values will yield distinct sequences of pseudo random numbers.
[So far so good].
This subset includes the values from 0 through at least 32767.
[Taken from MF manual but the OC docs does not specify this]
1. Try just doing move function random (0) to randum and see what you get.
2. Suggest you also try using a pic of 9(5) (without the implied decimal
placing and see what you get.
I'm saying this just in case OC does NOT stick to values 0 to 1.
Vince
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list