49.4k views
4 votes
When you run this program, which title or titles appear in the final PROC PRINT results?

title1 'The First Line';
title2 'The Second Line';
proc print data=sales;
run;
title2 'The Next Line';
proc print data=sales;
run;
title 'The Top Line';
proc print data=sales;
run;

a. The Top Line
b. The Top Line
The Next Line
c. The Top Line
The Second Line
d. The Top Line
The First Line
The Next Line

1 Answer

1 vote

Final answer:

When the SAS program is run, the final 'PROC PRINT' results show the title 'The Top Line' only, because the previous title statements are replaced with this last title statement before the third 'PROC PRINT'. a. The Top Line

Step-by-step explanation:

When you run the given program, the titles in the PROC PRINT results change with each PROC PRINT step because each title statement applies to all subsequent procedures until a new title statement is encountered or the session ends. Here is what happens at each step:

  • For the first PROC PRINT, the titles 'The First Line' and 'The Second Line' will be displayed as they were defined before the first PROC PRINT step.
  • After the first PROC PRINT, 'The Second Line' is replaced by 'The Next Line'. So, in the second PROC PRINT, the titles will be 'The First Line' and 'The Next Line'.
  • Before the third PROC PRINT, all previous titles are overridden by 'The Top Line'. Therefore, only 'The Top Line' will be displayed.

The correct answer is that 'The Top Line' will appear in the final PROC PRINT results.

User Arildo Junior
by
8.3k points