DO loops are DATA step
statements and cannot be used in conjunction with PROC steps.
Correct answer: c
The number of iterations
is determined by the DO statement's stop value, which in this
case is 12.
Correct answer: a
Use a DO loop to perform
repetitive calculations starting at 1 and looping 15 times.
Correct answer: d
At the end of the 15th
iteration of the DO loop, the value for Year is incremented to 2005.
Because this value exceeds the stop value, the DO loop ends. At the
bottom of the DATA step, the current values are written to the data
set.
Correct answer: b
The OUTPUT statement
overrides the automatic output at the end of the DATA step. On the
last iteration of the DO loop, the value of Year, 2004,
is written to the data set.
Correct answer: d
The number of observations
is based on the number of times the OUTPUT statement executes. The
new data set has 20 observations, one for each iteration of the DO
loop.
Correct answer: b
Place the monthly calculation
in a DO loop within a DO loop that iterates once for each year. The
DO WHILE and DO UNTIL statements are not used here because the number
of required iterations is fixed. A non-iterative DO group would not
be useful.
Correct answer: a
The DO UNTIL condition
is evaluated at the bottom of the loop, so the enclosed statements
are always executed at least once.
Correct answer: c
Because the DO WHILE
loop is evaluated at the top of the loop, you specify the condition
that must exist in order to execute the enclosed statements.
Correct answer: a
The WHILE expression
causes the DO loop to stop executing when the value of Distance becomes
equal to or greater than 250.