Base SAS Certification Questions and important concepts needed to ace the exams.
ElearnSAS.com
SAS Learning Platform
Base SAS 31
The value 110700 is stored in a numeric variable. Which one of the following SAS formats is used to display the value as $110,700.00 in a report? A. comma8.2 B. comma11.2 C. dollar8.2 D. dollar11.2 Click Comment link to get answer
It can not be C bcz the total width is 11 not 8, so it comes down to either of dollar11.2 or comma11.2. But comma11.2 does not insert dollar sign along with comma. So the answer is D.
It's beacuse when you use comma11.2 as an informat, sas removes dollar signs, commas and percent signs(if they exist in the value you are trying to read) whereas the format dollar11.2 inserts a dollar sign and a comma. Read the SAS help if you are struggeling.
D
ReplyDeleteD
ReplyDeleteAnswer D
ReplyDeleteans is B
ReplyDeleteAnswer C...As format is Dollar8. and informat is comma 10.
ReplyDeleteD
ReplyDeleteIt can not be C bcz the total width is 11 not 8, so it comes down to either of dollar11.2 or comma11.2. But comma11.2 does not insert dollar sign along with comma. So the answer is D.
ReplyDeleteexactly
DeleteTHE ANSWER IS D. DONT THINK TOO MUCH.
ReplyDeleteANSWER IS D 100%
ReplyDeletesakar Sham;
ReplyDeleteyes , those who are in favor of C needs thinking. C chooser what is your logic.Why? If you disagree , give us your logical reason.Thks
data test;
ReplyDeletev1 = 110700;
v2 = 110700;
run;
proc print data=test;
title 'Base SAS 31';
format v1 dollar8.2 v2 dollar11.2;
run;
its interesting how comma11.2 can be used to read $110,700.00 but it cant be used to write 110700 as $110,700.00
ReplyDeleteIt's beacuse when you use comma11.2 as an informat, sas removes dollar signs, commas and percent signs(if they exist in the value you are trying to read) whereas the format dollar11.2 inserts a dollar sign and a comma. Read the SAS help if you are struggeling.
DeleteThank you!
DeleteThat was very helpful
110700
ReplyDeleteDOLLAR11.2 - $110,700.00
COMMA11.2 - 110,700.00
DOLLAR8.2 - 110700.0
COMMA8.2 - 110700.0
Hello!! I'am glad to read the whole content of this blog and am very excited.Thank you.
ReplyDeleteตารางคะแนน