The SYSRANEND macro
variable stores a seed that can be used to start the next step in
your program. In some cases, this seed captures the state of the random
number process when a procedure is completed. Your program can contain
multiple steps and can control the random number sequence without
specifying an explicit seed for each procedure. You can start the
simulation with one seed, and use the SYSRANEND macro variable to
provide the seed in all subsequent procedures. In some cases, you
can also use the SYSRANEND macro variable to stop and restart the
random number generators (RNGs) that are continuing the same stream.
There are two types
of RNGs in SAS procedures. The older RNG, which is used by the RANUNI
function, starts the pseudo-random number stream with a single seed,
and the state of the process can be captured in a new seed. The GLM,
GLIMMIX, MI, OPTEX, PLAN, and other procedures use this older RNG.
When the procedure exits, the value that is stored in SYSRANEND is
the new seed. You can stop and restart the generator from its stopping
point by using the SYSRANEND macro variable.
Other procedures, such
as MCMC, GENMOD, LIFEREG, and PHREG, use the newer Mersenne-Twister
RNG. This RNG is also used in the RAND function and does not propagate
the state of the stream through a single seed. Some procedures use
one RNG for some computations and the other RNG for other computations.
You can use the SYSRANEND macro variable from these procedures to
make a sequence of procedure runs reproducible, but the random streams
will not be equal to that of a single, long, procedure run.