193k views
3 votes
When should a DO group be used in a DATA step?

1) To execute multiple statements for a true IF-THEN expression
2) To execute multiple statements for a false IF-THEN expression
3) To execute multiple statements for a true IF-THEN-ELSE expression
4) To execute a single statement for a true IF-THEN expression

User Akxaya
by
6.9k points

1 Answer

1 vote

Final answer:

A DO group should be used in a DATA step to execute multiple statements for a true IF-THEN expression but can also be used for multiple statements in an IF-THEN-ELSE condition.

Step-by-step explanation:

A DO group in a SAS DATA step should be used when you need to execute multiple statements as part of the same conditional logic. The correct option in this case is: To execute multiple statements for a true IF-THEN expression. If IF-THEN is true, then all the statements within the DO group are executed. Similarly, a DO group can be used with IF-THEN-ELSE for both the true and the false parts of the conditional logic. Therefore, a DO group is not limited to use with just a single true IF-THEN expression but can execute multiple conditional statements.

User Nohup
by
6.9k points