BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
anming
Pyrite | Level 9
The COMMAw.d informat can be used to read which of the following values?
Options:
A. all the three
 
B. $177.95
 
C. 12,805
 
D. 18 %
 
A or only C? why?
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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

 

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

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

 

anming
Pyrite | Level 9
Great! thanks!

Welcome to the Certification Community

 

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

 

Why Get SAS Certified.jpg

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1514 views
  • 1 like
  • 2 in conversation