Online File

How to use this page


Rick Aster: Professional SAS Programming Shortcuts: Contents

Chapter 41
Program
Random sample based on array of random numbers


data work.sample (drop=i j size);
   array ran{1000} _temporary_;
   size = dim(ran) min nobs;
   do i = 1 to size;
      do until (ran{i} > 0);
         ran{i} = floorz(rand('uniform')*nobs + 1);
         do j = 1 to i - 1 while (ran{i} > 0);
            if ran{i} = ran{j} then ran{i} = 0;
            end;
         end;
      end;
   do i = 1 to size;
      point = ran{i};
      set work.complete point=point nobs=nobs;
      output;
      end;
   stop;
run;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Rick Aster

Professional SAS Programming Shortcuts

Contents/Online Files

Corrections

Catalog Page