223k views
3 votes
The following SAS program is submitted: data ; length word $7; amount = 4; if amount = 4 then word = 'FOUR'; else if amount = 7 then word = 'SEVEN'; else word = 'NONE!!!'; amount = 7; run; What are the values of the AMOUNT and WORD variables in the SAS dataset?

a) AMOUNT = 4, WORD = 'FOUR'
b) AMOUNT = 7, WORD = 'SEVEN'
c) AMOUNT = 4, WORD = 'SEVEN'
d) AMOUNT = 7, WORD = 'NONE!!!'

1 Answer

3 votes

Final answer:

The values of the AMOUNT and WORD variables in the SAS dataset are AMOUNT = 7 and WORD = 'SEVEN'.

Step-by-step explanation:

The values of the AMOUNT and WORD variables in the SAS dataset are:

  • AMOUNT = 7
  • WORD = 'SEVEN'

In the given SAS program, the initial value of AMOUNT is set to 4. However, after the first if statement, the value of AMOUNT is changed to 7. Therefore, the first if condition is not satisfied, and the else if condition is also not satisfied. Hence, the final value assigned to WORD is 'SEVEN' in the output dataset.

User GregMa
by
8.1k points