Functions and CALL Routines 
Category:  Random Number 
Syntax  
Arguments  
Details  
Comparisons  
Examples  
See Also 
Syntax 
CALL RANTBL(seed,p_{1},...p_{i},...p_{n},x); 
is the seed value. A new value for seed is returned each time CALL RANTBL is executed.
Range:  seed < 2^{31}  1 
Note:  If seed 0, the time of day is used to initialize the seed stream. 
See:  Seed Values and Comparison of Seed Values in RandomNumber Functions and CALL Routines for more information about seed values 
Range:  0 p_{i} 1 for 0< i n 
is a numeric SAS variable. A new value for the random variate x is returned each time CALL RANTBL is executed.
Details 
The CALL RANTBL routine updates seed and returns a variate x generated from the probability mass function defined by p_{1} through p_{n}.
By adjusting the seeds, you can force streams of variates to agree or disagree for some or all of the observations in the same, or in subsequent, DATA steps.
An inverse transform method applied to a RANUNI uniform variate is used. The CALL RANTBL routine returns these data:
RANTBL returns only the indices 1 through j, with the probability of occurrence of the index j equal to
For a discussion and example of an effective use of the random number CALL routines, see Starting, Stopping, and Restarting a Stream.
Comparisons 
The CALL RANTBL routine gives greater control of the seed and random number streams than does the RANTBL function.
Examples 
This example uses the CALL RANTBL routine:
options pageno=1 ls=80 ps=64 nodate; data u1(keep=x); seed = 104; do i = 1 to 5; call rantbl(seed, .02, x); output; end; call symputx('seed', seed); run; data u2(keep=x); seed = &seed; do i = 1 to 5; call rantbl(seed, .02, x); output; end; run; data all; set u1 u2; z = rantbl(104, .02); run; proc print label; label x = 'Separate Streams' z = 'Single Stream'; run;
Output from the CALL RANTBL Routine
The SAS System 1 Separate Single Obs Streams Stream 1 2 2 2 2 2 3 2 2 4 2 2 5 2 2 6 2 2 7 2 2 8 2 2 9 2 2 10 2 2
See Also 

Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.