complete solutions
PROC PRINT - correct answer ✔✔ lists all columns and rows in the input table by default. The
OBS= data set option limits the number of rows listed. The VAR statement limits and orders the
columns listed.
PROC PRINT DATA=input-table(OBS=n); VAR col-name(s);RUN;
PROC MEANS - correct answer ✔✔ generates simple summary statistics for each numeric
column in the input data by default. The VAR statement limits the variables to analyze.
PROC MEANS DATA=input-table; VAR col-name(s);RUN;
PROC UNIVARIATE - correct answer ✔✔ also generates summary statistics for each numeric
column in the data by default, but includes more detailed statistics related to distribution and
extreme values. The VAR statement limits the variables to analyze.
PROC UNIVARIATE DATA=input-table; VAR col-name(s);RUN;
PROC FREQ - correct answer ✔✔ creates a frequency table for each variable in the input table
by default. You can limit the variables analyzed by using the TABLES statement.
PROC FREQ DATA=input-table; TABLES col-name(s) < / options>;RUN;
Filtering Rows - correct answer ✔✔ -The WHERE statement is used to filter rows. If the
expression is true, rows are read. If the expression is false, they are not.
-Character values are case sensitive and must be in quotation marks.
-Numeric values are not in quotation marks and must only include digits, decimal points, and
negative signs.
-Compound conditions can be created with AND or OR.
, -The logic of an operator can be reversed with the NOT keyword.
-When an expression includes a fixed date value, use the SAS date constant syntax:
"ddmmmyyyy"d, where dd represents a 1- or 2-digit day, mmm represents a 3-letter month in
any case, and yyyy represents a 2- or 4-digit year.
WHERE Operators - correct answer ✔✔ PROC procedure-name ... ;WHERE expression;RUN;
= or EQ,^= or ~= or NE,> or GT,< or LT,>= or GE,<= or LE
SAS Date Constant - correct answer ✔✔ "ddMONyyyy"
IN Operator - correct answer ✔✔ WHERE col-name IN(value-1<...,value-n>);WHERE col-name
NOT IN (value-1<...,value-n>);
Special WHERE Operators - correct answer ✔✔ WHERE col-name IS MISSING;
WHERE col-name IS NOT MISSING;
WHERE col-name IS NULL;
WHERE col-name BETWEEN value-1 AND value-2;WHERE col-name LIKE "value";
WHERE col-name =* "value";
Filtering Rows with Macro Variables - correct answer ✔✔ %LET macro-variable=value;
Example WHERE Statements with Macro Variables: - correct answer ✔✔ WHERE
numvar=¯ovar;
WHERE charvar="¯ovar";
WHERE datevar="¯ovar"d
-A macro variable stores a text string that can be substituted into a SAS program.
-The %LET statement defines the macro variable name and assigns a value.