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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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