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: 19243
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 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 XML-GENERATE - atomic node with attri... COBOL Programming 6
No new posts Identify Number of Multivolume Dataset All Other Mainframe Topics 5
No new posts Sort card to generate the DSN DFSORT/ICETOOL 17
No new posts XML Generate - suppression of complex... COBOL Programming 0
No new posts XML Generate issue COBOL Programming 0
Search our Forums:


Back to Top