/**********************************************************************/


data overlap(drop=i);                                     
   retain seed1 38928356 seed2 1642199128;
   do i=1 to 10;                                          
      call ranuni (seed1,x1);                             
      call ranuni (seed2,x2);                             
      output;                                             
   end;                                                   
run;                                                      
                                                          
proc print;                                               
   title 'Related Streams from Consecutive Seeds';        
run;


/**********************************************************************/


data select(drop=i);                                  
   do i=1 to 20;                                      
      sampleid=int(ranuni(6948501)*6864)+1000;
      output;                                         
   end;                                             
run;                                                
                                                    
proc print;                                         
   title 'Twenty Random Integers from 1000 to 7863';
run;                                                


/**********************************************************************/


data indepnor(drop=i);                                 
   retain seed1 1686174032 seed2 844616116;     
   do i=1 to 25;                                       
      call rannor(seed1,stream1);               
      call rannor(seed2,stream2);               
      x=65+15*stream1;                                 
      y=80+10*stream2;                                 
      output;                                          
   end;                                                
run;                                                   
                                                       
proc print;                                            
   title1 'Two Independent Streams of Random Numbers'; 
   title2 'from Normal Distributions';                 
run;                                                   
                                                       
proc corr data=indepnor;                               
   var x y;                                            
   title 'Correlation Coefficients for Generated Data';
run;                                                   


/**********************************************************************/