BookmarkSubscribeRSS Feed
margi123
Fluorite | Level 6
The following SAS program is submitted:
data work.retail;
cost = `20000';
total= .10* cost
run;
What is the result?
A. The value of the variable TOTAL in the output data set is 2000. No messages are written to the SAS log.
B. The value of the variable TOTAL in the output data set is 2000. A note that conversion has taken place is
written to the SAS log.
C. The value of the variable TOTAL in the output data set is missing. An error message is written to the SAS
log.
D. The variable TOTAL in the output data set has no value. The program fails to execute due to a syntax error.
3 REPLIES 3
ballardw
Super User

I suspect that you are going through either certification training materials or some other training. But you should at least have a specific question of  your own abou the posed question.

Maybe something like: I thought the result would be X because of "some idea" but the result is Y? Why is it not Y?

 

 

The "answer" will be in the data set.

Run the code, examine the log and then proc print data=work.retail; run;

 

Note: Posting such things into the body of the forum may reformat code so that what is seen in your post is not the actual code you started with. Post code into a code box opened with the {i} icon in the forum message menu bar.

 

 

Astounding
PROC Star

Is it really easier to post a question here, than to paste the code into the Program Editor and run it?

 

Assuming you posted the code correctly, the answer is "D".  There is a missing semicolon just before the RUN; statement, so you get a syntax error.

 

It's worth learning what happens if you were to add the semicolon.  Try testing it that way.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1906 views
  • 2 likes
  • 3 in conversation