Sas Cheat Sheet
Sas Cheat Sheet
Sas Cheat Sheet
To know the duration when End Date and Start Date is given
INTCK("UNIT", DATE1, DATE2)
6. IF-THEN-ELSE 5. SQL IN SAS
IF X 6. CREATING MACROS
DATA LIB.M;
MERGE LIB.A(IN = X) LIB.C(IN = Y); %MACRO UNI(DT, VA, OB)
BY M; PROC UNIVARIATE DATA= &DT
IF X; RUN; NEXTROBS= &OB; VAR &VA;RUN;MEND;
IF Y 7. REMOVAL OF DUPLICATES
DATA LIB.M;
MERGE LIB.A(IN = X) LIB.C(IN = Y); BY VARIABLES
BY M; PROC SORT DATANAME NODUPKEY;
IF Y; RUN; OUT= LIB.O DUPOUT= LIB.D; BY SEX;
RUN;
BY ALL OBSERVATIONS
PROC SORT DATANAME NODUP;
OUT= LIB.O DUPOUT=LIB.D;BY SEX;
RUN;
8. CREATING PLOT
VAR A; RUN;