SAS Learning, Edition 1.0
Now Available
SAS Learning, Edition 1.0
[Home] | [Suggested Books & Videos] | [Study Tips] | [Mock Exams] | [SAS Jobs] | [Links] | [Feedback]

Mock Exam #1 Answers

If you find any errors or wish to dispute any answers, please drop me an e-mail.


1. The following is an example of.... (Choose one)

data employee;
  infile 'employee.dat'; /* Assuming directory-based system */
  input id $6. name $20. @30 locale $10.;
run;

A. List -- This is both list and column

B. Column

C. Formatted

D. Mixed

E. Standard


2. True or False...(Choose one)

The extesion of ".sas" is required for sas program files.

A. True

B. False -- Try it and see. This just a convention as suggested by SAS. .LIS and .LOG files are standard.


3. Which of the following are valid statements concerning reading raw data files using list input: (Choose all that apply)

All are correct.

A. The DLM= is an option for the infile statement for specifying delimiters.

B. All variables have a default length of 8 bytes.

C. When the input statement runs into an end-of-line marker, it stops reading data even though there are more fields specified.

D. You use a $ after a variable name to specify a character variable.

E. Fields are read from left to right.


4. Given the following raw data file, offices.dat, in a directory-based system, which data step would create a SAS data set with one observation for each region: (Choose One)


         1    1    2    2    3    3    4
1234567890123456789012345678901234567890
East Maryland Vermont Maine
Central Illinois Iowa Kansas Missouri
West California Washington

A.

data offices;
  infile 'offices.dat' stopover;
  input region $ state1-state4 $;
run;

B.

See reference manual for missover option.

data offices;
  infile 'offices.dat' missover;
  input region $ (state1-state4) ($);
run;

C.

data offices;
  infile 'offices.dat' delim=" ";
  input region $ state1 $ state2 $ state3 $ state4 $;
run;

D.

data offices;
  infile 'offices.dat';
  input region $ state1-state4 $.;
run;

E. None of the above.


5. The double trailing "@@" in an input statement...(Choose all that apply)

A, B, C

A. holds the current data line in the buffer for another input statement to process

B. can be used to read multiple observations from a single data line

C. loads a new record into the input buffer if an end-of-record is found in the current record

D. is a syntax error.

E. None of the above.


6. Which SAS statement below wil change the characteristics of a variable if it was used in a data step?

A. SCAN

B. ATTRIB

C. FORMAT

D. PUT

E. ARRAY


7. Which X variable has a value of 1 at the end of an input file?

A. END = X

B. OBS = X

C. EOF = X

D. LASTOBS = X

E. NOOBS = X


8. Given a data file with 100 columns of data, you only need to read in the first 70 colums. Which of the following could you use:

A. infile x line = 70;

B. infile x length = 71;

C. infile x missover = 70;

D. infile x ls=70;

E. infile x linesize=70;


9. In the following code sample:

data xyz;
  infile abc;
  input h i +3 j;
run;

What does the +3 do?

A. It moves the pointer down 3 records

B. It moves the column pointer to column 3

C. It adds 3 to the value read into variable i

D. It advances the column pointer 3 places

E. It advances the column pointer 4 places


10. What does the following SAS statement do?

  if location =: 'C';

A. It selects the observation if there is a 'C' in the location value.

B. It selects the observation if there is a 'C' at the first position in the location value.

C. It selects the observation if the location value is 'C'.

D. It selects the observation if the location value contains a lowercase 'c'.

E. None of the above, it's a typo.

SAS Learning, Edition 1.0
Now Available
SAS Learning, Edition 1.0
[Home] | [Suggested Books & Videos] | [Study Tips] | [Mock Exams] | [SAS Jobs] | [Links] | [Feedback]

Send mail to Webmaster with questions or comments about this web page.
SAS.CertifiedProgrammer.com