0% found this document useful (0 votes)
238 views4 pages

SAS Test

1. SAS date values are the number of days since January 1, 1960. The MMDDYY8 informat should be used to read dates in the form 10222001. The DO WHILE statement repetitively executes code while a condition is true. If the data set clinic.fitness is subset on group=2 and age>40, only the variables age and group will appear in the new data set work.cardiac. 2. The INFILE statement identifies the raw data file to be read and the OBS= option specifies to read only records 1-15. When the third error occurs in a DATA step, the value of the automatic variable _ERROR_ will be 2.

Uploaded by

parnampavan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
238 views4 pages

SAS Test

1. SAS date values are the number of days since January 1, 1960. The MMDDYY8 informat should be used to read dates in the form 10222001. The DO WHILE statement repetitively executes code while a condition is true. If the data set clinic.fitness is subset on group=2 and age>40, only the variables age and group will appear in the new data set work.cardiac. 2. The INFILE statement identifies the raw data file to be read and the OBS= option specifies to read only records 1-15. When the third error occurs in a DATA step, the value of the automatic variable _ERROR_ will be 2.

Uploaded by

parnampavan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

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.

9. The following SAS program is submitted.


DATA flatten;
Input jobcode $ salary name $;
Cards;
Flat1 70000 bob
Flat2 60000 joe
Flat3 30000 ann
;
Run;
Data desc;
Set flatten;
If salary > 60000then description = ‘over 60’;
Else description = ‘under60’;
Run;
What is the value of the variable description when the value of salary is 30000?
a. under 6
b. under 60
c. over 60
d. Missing character value

10. The following sas program is submitted


DATA work.inventory;
Products = 7;
Do until(products gt 6);
Products + 1;
End;
Run;
What is the value of products in the output data set?
a. 5
b. 6
c. 7
d. 8

11. The following program is submitted


Data test;
Average = mean (6, 4, ., 2);
Run;
What is the value of the variable average?
a. 0
b. 3
c. 4
d. .

12. The following SAS program is submitted.


DATA work.travel;
Do I = 1 to 6 by 2;
Trip + I;
End;
Run;
Which one of the following is the value of the variable trip in the output data set?
a. 2
b. 3
c. 9
d. 10

13.Which of the following variable names is valid?


a. 4birthdate
b. $cost
c. _items_
d. tax-rate

14. Which of the following files is a permanent sas file?


a. sashelp.prdsales
b. sasuser.mysales
c. profits.quarter1
d. all of the above.

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

16. Which one is correct:


a. 2 + .(missing value) = 2
b. 2 + .(missing value) = .(missing value)

17. Name any 5 data set options and explain about them?

18. Name any 5 system 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?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy