IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How To generate a random number generation..


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kranti

New User


Joined: 10 Oct 2005
Posts: 27

PostPosted: Thu Oct 20, 2005 12:29 pm
Reply with quote

Hi Guys,
I have a small query in the generation of randon number in a cobol program.Requirement is like I have to produce a reference number which is like

01 Ws-Ref-nbr.

03 ws-field1 pic 9(03).
03 ws-field2 pic 9(03).
03 ws-field3 pic 9(10).
03 ws-field4 pic 9(02).
03 ws-field5 pic 9(05).

like this i have some reference number. This number i want to have randomly for output records which is of sequential file.In This WS-FIELD2
I am using the todays date which is coming from the input file in my program. All others are constant values and the last one WS-FIELD5 is of ascending order.So I am getting all the reference numbers which are satisfying the criteria.

Here the problem I am facing is, this program will run once in a day.
In some cases this may run more than once as per the neccesity.So when we run this program first time we are getting the refernce numbers perfectly.But when we run the second time also we are getting the same reference numbers.Here I want to have the reference number randomly means should not have the same refernce number even when we run the program more than once in a day.Is there anu possibility to know some random value which will change some time to time or else which meets the above criteria???

Could you anybody please provide the solution

Thanks In advance,
Kran.
Back to top
View user's profile Send private message
ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Thu Oct 20, 2005 12:44 pm
Reply with quote

y dont u put time at which this record has got generated....put one constant field as the system time....

ACCEPT ws-time FROM TIME.

suppose when u r running the program, time parameter will b same for all the references got generated...

when u run second time in a day, time will b different and it assigns that time to all the records...

hope i m not wrong....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
Search our Forums:

Back to Top