Poorly worded question. You could use the COMMA informat to read "FRED". The result would be a missing value.
I suspect they want you to answer A as it will read all of those strings as numbers.
But the value it gets for the last one is wrong. The string 18% means the number 0.18 and the COMMA informat will read it as 18 instead.
data test;
input id $ value comma12.;
cards;
B. $177.95
C. 12,805
D. 18 %
;
proc print;
run;
Obs id value 1 B. 177.95 2 C. 12805.00 3 D. 18.00
Poorly worded question. You could use the COMMA informat to read "FRED". The result would be a missing value.
I suspect they want you to answer A as it will read all of those strings as numbers.
But the value it gets for the last one is wrong. The string 18% means the number 0.18 and the COMMA informat will read it as 18 instead.
data test;
input id $ value comma12.;
cards;
B. $177.95
C. 12,805
D. 18 %
;
proc print;
run;
Obs id value 1 B. 177.95 2 C. 12805.00 3 D. 18.00
This is a knowledge-sharing community for SAS Certified Professionals and anyone who wants to learn more about becoming SAS Certified. Ask questions and get answers fast. Share with others who are interested in certification and who are studying for certifications.To get the most from your community experience, use these getting-started resources:
Community Do's and Don'ts
How to add SAS syntax to your post
How to get fast, helpful answers
Ready to level-up your skills? Choose your own adventure.