Term
A SAS program is
a. a sequence of steps that the user submits for execution.
b. all answer choices
c. compiles, then executes.
d. always made up of either data steps and proc steps.
|
|
Definition
|
|
Term
SAS detects the end of a step when it encounters
I. a RUN statement II. a QUIT statement III. the beginning of another step
- I only
- I and II only
- I and III only
d. I, II and III
|
|
Definition
|
|
Term
DROP= and KEEP= statements apply to what data sets?
a. Output data sets only
b. Input data sets only
c. Both input and output data sets
d. Neither the input nor the output data sets.
|
|
Definition
|
|
Term
The default statistics produced by the MEANS procedure are n-count (N), mean, minimum, maximum, and
a) range.
b) standard deviation.
c) median.
d) standard error of the mean.
|
|
Definition
|
|
Term
When would you use the ODS CSVALL statement?
a. To create a tab-delimited file
b. To read a comma-delimited file
c. To create a comma-delimited file
d. To read a tab-delimited file to a comma-delimited file
|
|
Definition
|
|
Term
What does PROC PRINT display by default?
a) PROC PRINT does not create a default report; you must specify the rows and columns to be displayed.
b) PROC PRINT displays all observations and variables in the data set, a column for observation numbers on the far left, and variables in the order in which they occur in the data set.
c) PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it.
|
|
Definition
|
|
Term
Which function calculates the average of the variables Var1, Var2, Var3, and Var4?
a. mean(of var1-var4)
b. mean(of var1, var4)
c. mean(var1-var4
d. mean(var1, var4) |
|
Definition
|
|
Term
A typical value for the character variable Target is 123,456. Which statement correctly converts the values of Target to numeric values when creating the variable TargetNo?
a. TargetNo=input(target,comma6.);
b. TargetNo=input(target,comma7.);
c. TargetNo=put(target,comma6.);
d. TargetNo=put(target,comma7.); |
|
Definition
|
|
Term
What is a specially structured file that contains data values?
- SAS program
- SAS data set
- SAS code
- SAS proc step
|
|
Definition
|
|
Term
In the SAS Log, notes are written in ___________, warnings are written in ______________, and errors are written in _________________.
- green, blue, red
- black, blue, red
- black, green, red
- blue, green, red
|
|
Definition
|
|
Term
Which of the following SAS names is valid?
- 2006PromCosts
- yr 2006 PromCosts
- $2006Prom_Costs
- _2006Prom_Costs
|
|
Definition
|
|
Term
What happens if you submit the following program?
proc sort data=pe.fit_test; run;
proc print data=pe.fit_test; var age height weight pulse; where sex='F'; run;
- The PROC PRINT step runs successfully, printing observations in their sorted order.
- The PROC SORT step permanently sorts the input data set.
- The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order.
- The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing.
|
|
Definition
|
|
Term
All of the following are created at compile time, except
- the input buffer.
- the program data vector
- the descriptor portion
- the data portion
|
|
Definition
|
|
Term
What is the product of each of the phases of the DATA step?
- The compilation phase creates the data portion and the execution phase creates the descriptor portion.
- The compilation phase creates the descriptor portion and the execution phase creates the data portion.
- The compilation phase and the execution phase creates the data portion.
- The compilation phase and the execution phase creates the descriptor portion.
|
|
Definition
|
|
Term
Which of the following PROC PRINT steps is correct if labels are not stored with the data set?
- proc print data=univ.public label;
label acc='ACC Universities'; run;
- proc print data=univ.public;
label ACC='ACC Universities'; run;
- proc print data univ.public label noobs;
run;
- proc print univ.public label;
run;
|
|
Definition
|
|
Term
Which of the following statements would apply the DOLLARw.d to the value Tuition if you want to show the dollar sign, a comma and no decimal places. The largest value is 15000.
- format tuition dollar5.0;
- format tuition dollar5;
- format tuition dollar8;
- format tuition dollar8.0;
|
|
Definition
|
|
Term
Which of the following FORMAT procedures is written correctly?
- proc format lib=library;
value colorfmt 1='Red' 2='Green' 3='Blue'; run;
- proc format lib=library
value colorfmt; 1='Red' 2='Green' 3='Blue'; run;
- proc format lib=library;
value colorfmt; 1='Red' 2='Green' 3='Blue' run;
- proc format lib=library;
value colorfmt; 1='Red'; 2='Green'; 3='Blue'; run;
|
|
Definition
|
|
Term
Suppose the YEARCUTOFF= system option is set to 1920. Which MDY function creates the date value for January 3, 2020?
- MDY(1,3,20)
- MDY(3,1,20)
- MDY(1,3,2020)
- MDY(3,1,2020)
|
|
Definition
|
|
Term
A typical value for GPA is 3.26541. Which statement correctly rounds to the hundredth position?
- newgpa = round(gpa, 100)
- newgpa = round(gpa, 2)
- newgpa = round(gpa, .01)
- newgpa = round(gpa, '.01')
|
|
Definition
|
|
Term
You can position the input pointer on a specific record by using
- line hold specifiers.
- line pointer controls.
- column specifications.
- column pointer controls.
|
|
Definition
|
|
Term
Which statement is false regarding the sum statement?
- The sum statement ignores missing values.
- The sum statement requires a retain statement.
- The sum statement initializes the variable to zero before the first iteration of the DATA step.
- The sum statement creates the variable on the left side of the plus sign if it does not already exist.
|
|
Definition
|
|
Term
What is the result of submitting the following program? There are 453 students with class = 'F', 436 students with class='S', 398 students with class='J' and 412 students with class = 'Sr'. There are a total of 1752 observations.
data frshmn soph junr senr undef; set ahs.students; if class = 'F' then output frshmn; else if class = 'S' then output soph; else if class = 'J' then ouput junr; else if class = 'Sr' then output senr; run;
- one data set with 752 observations
- four data sets -
frshnm with 453 observations soph with 436 observations junr with 398 observations senr with 412 observations
- four data sets -
frshnm with 605 observations soph with 588 observations junr with 600 observations senr with 564 observations
- No new data sets were created.
|
|
Definition
|
|
Term
What is the result of putting an output statement without a data set name?
- SAS will ignore the current observation.
- SAS will output to every data set on the DATA statement.
- SAS will create a new data set in which to output these observations.
- SAS will not output observations to the data sets in the DATA statement.
|
|
Definition
|
|
Term
If you submit the following program, which variables appear in the new data set?
data work.cardiac(drop=age group); set clinic.fitness(keep=age weight group); if group=2 and age>40; run;
- weight
- group
- age, group
- age, weight
|
|
Definition
|
|
Term
The data set student.seniors includes the following variables. Which is a poor candidate for the PROC MEANS analysis?
- StudID
- GPA
- Age
- SAT
|
|
Definition
|
|
Term
Which statement correctly re-defines the values of the variable Allowance as 100 percent higher?
- allowance=*200;
- allowance=allowance*1.00;
- allowance = allowance*2;
- allowance=allowance+(allowance*2.00);
|
|
Definition
|
|
Term
Which statement correctly creates a SAS data set using a SAS data set as input?
- set vacation.beach;
- set=vacation.beach;
- input vacation.beach;
- input=vacation.beach;
|
|
Definition
|
|
Term
Which function statement will return the same value as the following expression?
save = allow – exp;
- save = diff(allow, -exp)
- save = sum(allow, -exp)
- save = diff(allow, exp)
- save = sum(allow, exp)
|
|
Definition
|
|
Term
Which statement would correctly assign the day of the week from today's date to the variable Day?
- Day = today();
- Day = weekday(today);
- Day = weekday(today());
- Day = today(weekday());
|
|
Definition
|
|
Term
The default title is
- The SAS System
- SAS Programming
- SAS v. 9
- The SAS System v. 9
|
|
Definition
|
|
Term
Which statement is false regarding the use of DO loops?
- They can be used to read data.
- They can contain conditional clauses.
- They can generate multiple observations.
- They can be used to combine DATA and PROC steps.
|
|
Definition
|
|
Term
During each execution of the following DO loop, the value of Earned is calculated and is added to its previous value. How many times does this DO loop execute?
data finance.earnings; Amount=1000; Rate=.075/12; do month=1 to 12; Earned+(amount+earned)*rate; end; run;
- 0
- 1
- 12
- 13
|
|
Definition
|
|
Term
On January 1 of each year, $5,000 is invested in an account. Complete the DATA step below to determine the value of the account after 15 years if a constant interest rate of 10% is expected.
data work.invest; ____________ Capital+5000; capital+(capital*.10); end; run;
- do count=1 to 15;
- do count=1 to 15 by 10%;
- do count=1 to capital;
- do count=capital to (capital*.10);
|
|
Definition
|
|
Term
Which statement is false regarding DO UNTIL statements?
- The condition is evaluated at the top of the loop, before the enclosed statements are executed.
- The enclosed statements are always executed at least once.
- SAS statements in the DO loop are executed until the specified condition is true.
- The DO loop must have a closing END statement.
|
|
Definition
|
|
Term
Select the DO WHILE statement that would generate the same result as the program below.
data work.invest capital=100000 do until(Capital gt 500000); Year+1; capital+(capital*.10); end; run;
- do while(Capital=500000)
- do while(Capital le 500000);
- do while(Capital ge 500000);
- do while(Capital>500000);
|
|
Definition
|
|
Term
In the following program, complete the statement so that the program stops generating observations when Distance reaches 250 miles or when 10 gallons of fuel have been used (this is a conditional statement, which loop would be used).
data work.go250; set perm.cars; do gallons=1 to 10 ... ; Distance=gallons*mpg; output; end; run;
- until(Distance=250)
- over(Distance le 250)
- when(Distance>250)
- while(Distance<250)
|
|
Definition
|
|
Term
Which statement is false regarding an ARRAY statement?
- It must be used to define an array before the array name can be referenced.
- It must contain either all numeric or all character elements.
- It is an executable statement.
- It can be used to create variables.
|
|
Definition
|
|
Term
What belongs within the braces of this ARRAY statement? array contrib{?} qtr1-qtr4;
- 4
- 1-4
- quarter*
- quarter
|
|
Definition
|
|
Term
For the program below, select an iterative DO statement to process all elements in the contrib array.
data work.contrib; array contrib{4} qtr1-qtr4; ____________ contrib{i}=contrib{i}*1.25; end; run;
- do i=4;
- do i=1 to 4;
- do until i=4;
- do while i le 4;
|
|
Definition
|
|
Term
What is the value of the index variable that references Jul in the statements below?
array quarter{4} Jan Apr Jul Oct; do i=1 to 4; yeargoal=quarter{i}*1.2; end;
- 1
- 2
- 3
- 4
|
|
Definition
|
|