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} = FLOOR(RANUNI(5)*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