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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1635 views
  • 2 likes
  • 3 in conversation