The contents of the raw data file AMOUNT are listed below:
--------10-------20-------30
$1,234
$1,234
The following SAS program is submitted:
data test;
infile 'amount';
input @1 salary 6.;
if _error_ then description = 'Problems';
else description = 'No Problems';
run;
infile 'amount';
input @1 salary 6.;
if _error_ then description = 'Problems';
else description = 'No Problems';
run;
Which one of the following is the value of the DESCRIPTION variable?
A. Problems
B. No Problems
C. ' ' (missing character value)
D. The value cannot be determined as the program fails to execute due to errors.
2 comments:
Answer: A
The informat is not right 6. For $1,234 is not right….it should have been comma6.
Try this
data test;
infile cards;
input @1 salary 6.;
if _error_ then description = 'Problems';
else description = 'No Problems';
cards;
$1,234
;
run;
Doller6.
Post a Comment