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

SAS - How to generate a random number between 1 and n


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 15, 2012 2:17 am
Reply with quote

Hi Charles,

Thanks for the reply icon_smile.gif

The following is what i (thanks to the suppport from Robert and Vasanth) have running now:
Code:
DATA SEEDFILE;                                       
     INFILE SEEDFILE;                                 
     INPUT @014 SEEDVAL;                             
     SEED = INT(MOD (TIME(), SUBSTR(SEEDVAL,1)+0)) ; 
     RANVAL = INT(RANUNI(SEED)*SEEDVAL) + 1 ;         
     FILE RANOUT;                                     
     PUT ' RANDACT  ' RANVAL Z7. ; 

This does not use the "parm" but rather an input file and the random number is written to the RANOUT DD statement.
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 -> All Other Mainframe Topics Goto page Previous  1, 2

 


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