I have a rather complicated program that I run, it will iterate through a list of variables and do certain things...
One of those things I want to do, is create a scatterplot, so when I'm all done I can open up my HTML results and see a whole list of scatterplots that it created.
For some reason, my code works fine but the scatterplots never appear. In fact I get no HTML results whatsoever (the default in my case)
options source NOnotes NOserror;
%macro plotting(datasetname,xvar,yvar);
proc sgscatter data=&datasetname);
title "&xvar versus &yvar";
plot (&xvar)*(&yvar)
/ pbspline;
run;
%mend plotting;
%macro main;
* do stuff;
%plotting(&datasetname,&xvar,&yvar);
%mend main;
If you run the plot code, not the macro, do you get results?
Is anything in the macro directing where your output goes? If you have an ODS HTML statement you might need to watch where the ODS HTML Close statement is.
If you look in your default results folder do you have a bunch of PNG files corresponding to the graph calls?
If you did something with options regarding the imagefmt that might be an issue with some forms of graphs and options, activex and java both having limits.
Otherwise you may have to turn on OPTIONS MPRINT and look closer at the log for details.
If you run the plot code, not the macro, do you get results?
Is anything in the macro directing where your output goes? If you have an ODS HTML statement you might need to watch where the ODS HTML Close statement is.
If you look in your default results folder do you have a bunch of PNG files corresponding to the graph calls?
If you did something with options regarding the imagefmt that might be an issue with some forms of graphs and options, activex and java both having limits.
Otherwise you may have to turn on OPTIONS MPRINT and look closer at the log for details.
Yeah, if I run the code alone, it prints right to the HTML output tab in E.G.
I also searched for ods statements in the program and there are none. I attempted to wrap the macro in ods HTML file= and ods close; but still nothing.
I'll turn on MPRINT and see if there are any clues...
THANKS!
Mprint showed the issue - it was a silly extraneous character being inserted into the value for xvar from a prior process. Your tip saved me my sanity. Thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.