Multiple choice technology programming languages

The following code is submitted. data temp; salary='20000'; bonus=0.1*salary; run; What would be the value of BONUS variable in the dataset TEMP?

  1. '2000'

  2. 2000

  3. .

  4. blank

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

SALARY is assigned the character value '20000' (quoted). When SAS processes the arithmetic bonus=0.1*salary, it automatically converts the character to numeric for the calculation. The result 2000 is stored as a numeric value in BONUS, not a character. SAS performs implicit type conversion in arithmetic contexts.