Professional Documents
Culture Documents
if then most commonly used to create new variables with conditional logic
Missing data(.) are viewed as negative numbers. When you use < operator, missing data might get
included
Character values “red” must be enclosed in quotes when specifying using conditional statements
PROC RANK computes rank for one or more numerical variables across observations of a SAS data
set-by default-smallest to largest
OUT=work.master4 GROUPS=5;
VAR age;
RANKS ageRank;
Run;
Var age;
In combination with DO statement, arrays can do group processing of many variables together
ARRAY statement defines a set of variables that you plan to process as a group
ARRAY bpa [2] sbp dbp; *variables name can be put here even if variables have not been created*
DO i=1 to 2; *repeated*
END; RUN;
SHORT in proc contents gives a list of variables so you can copy paste and put in array
ARRAY numa [*] _NUMERIC_ [*] I don’t know how many elements are in the array, you count it
DO i=1 to DIM(numa);
PROC FORMAT defines rules-instructions that SAS follows to write data values to the output window.
Enhance readability of the output.
PROC FORMAT;
VALUE genderf 1=”Male” 2=”female”; *value provides names and rules for the format*
Run;
Var sex;
Run;