BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PhanS
Obsidian | Level 7

I follow these codes from 

https://www.youtube.com/watch?v=fFfxPqNzNJc

But I am not sure why it does not run in SAS University Edition.

Appreciates your comments. Phan S.

data _null_;
set sashelp.cars;
where strip(make)='Acura' and strip(model)='MDX';
call symputx('MDX_Price',msrp);
/*%let MDX_Price = msrp;*/
run;

option nosource;
%put ==================================;
%put the MSRP for an Acura MDX is &MDX_Price..;
%put ==================================;
option source;

proc sql noprint;
select age
into: alfred_age
from sashelp.class
where name='Alfred';
quit;

proc sql noprint;
select weight into: MDX_Weight trimmed
from sashelp.cars
where strip(make)='Acura' and strip(model)='MDX';
quit;

option nosource;
%put ==================================;
%put the MSRP for an Acura MDX is &MDX_Weight..;
%put ==================================;
option source;
1 ACCEPTED SOLUTION

Accepted Solutions
PhanS
Obsidian | Level 7

Hello ballardw (Super User),

I closed and reopened SAS and it appears to run (See attached).

 

Phan S.

 
 

 

View solution in original post

6 REPLIES 6
ballardw
Super User

For posts related to "why this didn't run" you should supply the LOG of your attempt to run the code along with any errors or warnings. Copy the text from the LOG and paste into a code box opened on the forum with the </> icon.

 

Pasting into the code box is important because SAS often supplies diagnostic characters that the main message window will reformat so they appear in a position other that SAS wrote them originally.

 

Since %put only writes to the log then you would not see anything appear in other result windows if that is what you expected.

 

I can run the code and get reasonable results from the %put statements.

 

 

PhanS
Obsidian | Level 7

Hello ballardw (Super User),

I closed and reopened SAS and it appears to run (See attached).

 

Phan S.

 
 

 

ballardw
Super User

@PhanS wrote:

Hello ballardw (Super User),

I closed and reopened SAS and it appears to run (See attached).

 

Phan S.

 
 

 


Working with macro code requires significant attention to detail. You can create instances where "something" , varies on what you attempt, isn't closed properly and so code generated or variables are not actually seen by the SAS code compiler as you think.

One symptom is submitting code and nothing happening. At which point often the solution is to save your code and restart SAS. Then very carefully want the macro bits next time as you may have saved an error that will cause this all over again.

PhanS
Obsidian | Level 7
Thank you for your input.
Cynthia_sas
SAS Super FREQ
Hi: Perhaps this is a question for the person who wrote the code. However, since you did NOT post any error messages, no one can guess what error messages you might have received in the SAS log.

It does seem odd that you have code for both SASHELP.CARS and SASHELP.CLASS in the same program. The video you referenced is over an hour long. Did the presenter submit all the code at once at the end of the hour? Are you following the same steps the presenter followed? Did the presenter get error messages in his log? Where did your experience with the code differ from what the presenter showed?

It's nearly impossible to provide any constructive suggestions without understanding exactly how "it does not run in University Edition" -- only you know that -- and of course, the SAS log that shows how it did not run.

Cynthia
PhanS
Obsidian | Level 7

Hi Cynthia,

 

Very sorry for my late reply. I just saw your post. 

My SAS University was freeze.

It has resolved the issue after I saved my codes, closed SAS, and resubmitted the same codes.  

Next time, I will remember to present Log messages. 

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 870 views
  • 0 likes
  • 3 in conversation