Biostat Macro Library

Randomization

%Random resides in the departments SAS Macro Library and is enabled with the following SAS statements:

Libname biostat '\\BIO2\example\SASMacrosWindows';
Options Mstored SasMstore=biostat;

%Random creates a SAS saveset with blocked random treatment assignments by stratification factor. Order of assignment within block is also created.

Syntax:
%Random(dataset,treatments,stratas,blocks,firstid,seed);
    dataset:        Dataset to create.
    treatments:   Number of treatments.
    stratas:         Number of stratification groups.
    blocks:         List of block sizes within stratification group.
    firstid:           Starting ID number.
    seed:            Random Seed.

Example:
%Random(work.A,4,25,8 4 4 4,1001,12345);