Need Answers.............

Occasional Contributor
Posts: 8

Need Answers.............

1.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.

2.The double trailing “@@” in an input statement…(Choose all that apply)

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.

3.Given the contents of the raw data file TYPECOLOR.DAT:



The following SAS program is submitted: data FLOWERS; infile 'TYPECOLOR.DAT' truncover; length Type $ 5 Color $ 11; input Type $ Color $;run; What are the values of the variables Type and Color? Options:

1. Type=daisy, Color=yellow
2. Type=daisy, Color=w
3. Type=daisy, Color=daisyyellow
4. Type=daisy, Color=

4.The below code is submitted

Data abc;

Infile rawdt;

Input id $ @;

if id ne ‘ ‘ then input Sex $ 5;

else input age 7-8;

input numrecs;


How many records from rawdt file will be read in one iteration after submitting the below code.

A. 0

B. 1

C. 2

D. program fails due to syntax error.


Super Contributor
Posts: 305

Re: Need Answers.............


2- A, B, C

3- 4

4 - C

Esteemed Advisor
Esteemed Advisor
Posts: 7,229

Re: Need Answers.............

It looks like these are test questions from book/exam and hence should be answered by the individual not really posted here.

Esteemed Advisor
Posts: 5,198

Re: Need Answers.............

Agree. And it's annoying that it seems that the persons that ask these question quite often didn't even try to understand the question, or try to test the different alternatives themselves.

The forums are for experience and knowledge exchange, yes. But being served correct answers upfront is a lousy learning technique.

Data never sleeps
Occasional Contributor
Posts: 16

Re: Need Answers.............

2- A, B, C

3- 3

4- C

Ask a Question
Discussion stats
  • 4 replies
  • 5 in conversation