Hi:
Question 3 in that same activity is going to ask students about Global statements. That's where they can count the TITLE statement. The point of this activity is to get the students to identify global versus regular statements and to recognize step boundaries.
My take on your thought exercise, if the TITLE statement were inside the PROC PRINT, I would say that there are still 4 PROC PRINT statements and 1 global statement that has been placed INSIDE the PROC PRINT step. But, in the activity program, we want the students to start learning how to read the program -- how to identify the steps, how to identify step boundaries and global statements.
The lecture immediately before that activity is explaining SAS program structure and what a program "step" is. The lecture covers how a "step" is composed of statements and typically ends with a RUN or QUIT statement. The lecture explains that a SAS program can also contain global statements (like TITLE or FOOTNOTE or LIBNAME,etc) which do not end with a RUN or QUIT.
The program for the activity looks like this (I've added the color coding):
But why bother with the emphasis on global statements at all? What if the PROC PRINT statement was as you coded it, but there was not any TITLE statement before the PROC MEANS? A new SAS programmer might not expect these results from the changed program:
The TITLE statement is still a GLOBAL statement whether it is placed inside or outside of the PROC step where it is used. One of the reasons our programs always show the TITLE and FOOTNOTE statements placed immediately BEFORE the PROC statement in our starter programs is so students get into the habit of thinking first about the global statements, such as OPTIONS, LIBNAME and TITLE and FOOTNOTE, that their steps will need to have in effect before the step runs.
Cynthia
... View more