Random sample of dataset in SAS

The code below will give you a random sample of a large dataset. The random sample will contain 25% randomly selected rows from the large dataset.

data Libname.RandomDataset;
set Libname.LargeDataset;
if ranuni(123456789) <= .25;
run;

Leave a Reply

Your email address will not be published. Required fields are marked *