Multiple choice technology programming languages

data test; input @1 sal 6.; datalines; $1,234 ; run; What is the value of sal in the test dataset?

  1. Error because of giving formats while the format statement is not provided

  2. Missing

  3. 1234

  4. $1,234
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The informat '6.' with modifier '@1' tells SAS to read starting at column 1 for 6 columns. The data '$1,234' contains a dollar sign and comma. With a numeric informat, SAS encounters non-numeric characters and sets the value to missing, not an error. This is valid SAS behavior - SAS converts invalid numeric data to missing rather than failing.