44.7k views
1 vote
What happens when you submit the following code?

data temperate tropical;
set flora;
output;
run;
a. Because the OUTPUT statement does not specify a data set, both output data sets are empty.
b. All observations in the flora data set are written to both output data sets.
c. The DATA step writes the first observation to each output data set and then stops processing because no RETURN statement is specified.

User Nanju
by
7.8k points

1 Answer

3 votes

Final answer:

Upon submitting the SAS code provided, all observations in the 'flora' data set are written to both 'temperate' and 'tropical' output data sets.

Step-by-step explanation:

When you submit the code:

data temperate tropical; set flora; output; run;

the result is b. All observations in the flora data set are written to both output data sets. The DATA step creates two data sets named temperate and tropical. Since there are no conditions or data processing commands between the SET and OUTPUT statements, the OUTPUT statement causes every observation from the input data set flora to be written to both of these new data sets.

The DATA step processes all observations because a RETURN statement is not necessary for this operation; it implicitly happens at the end of the DATA step loop.

User Egridasov
by
7.7k points