SAS Test
SAS Test
1. SAS date values are the number of days since which date
a. Jan 1, 1900
b. Jan 1, 1950
c. Jan 1, 1960
d. Jan 1, 1970
2. An input date file has date expression in the form 10222001. Which SAS informat
should you use to read dates?
a. DATE6.
b. DATE8.
c. MMDDYY6.
d. MMDDYY8.
3. Which SAS statement repetitively executes several statements while the value of
cholesterol is greater than 200?
a. do cholesterol>200
b. do cholesterol gt 200
c. do while (cholesterol>200);
d. do while cholesterol>200;
4. 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;
a. none
b. weight
c. age, group
d. age, weight, group
5. which statement identifies the name of a raw data file to be read with the fileref
products and specifies the data step read only records 1-15?
a. infile products obs 15;
b. infile products obs = 15;
c. input products obs = 15;
d. input products 1-15;
6. Suppose you run a sas program that causes three data step errors. What is the
value of the automatic variable _error_ when the observation that contains the
third error is processed?
a. 0
b. 1
c. 2
d. 3
7.Based on the input statement in the data step below, in what order will the variables
be stored in the new data set?
Data perm.update;
Infile invent;
Input idnum $ 15-19 item $ 1-13 instock 21-22 backord 24-25;
Total = instock + backord;
Run;
a. idnum item instock baclord total
b. item idnum instock backord total
c. total idnum item instock backord
d. total item idnum instock backord
8.There are two data sets. First data set has variables name, age. Second data set has
variables name, age and date. What happens if you merge the two data sets by
variable name?
a. The values f age in the first data set overwrite the values of age in the second data
set.
b. The values of age in the second data set overwrite the values of age in the first data
set.
C. The DATA step fails because the two data sets contain same named variables that
have different values
d. The values of age in the second data set are set to missing.
15. In a data step, how can you reference a temporary sas data set named forecast?
a. forecast
b. work.forecast
c. sales.forecast
d. both a and b
17. Name any 5 data set options and explain about them?
19. What is the difference between temporary library and permanent library?
20. How do you create library in SAS and how do you store a data set in permanent
library?