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

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;

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

3 REPLIES 3
ballardw
Super User

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.

JBerry
Quartz | Level 8

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

JBerry
Quartz | Level 8

 

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!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 2293 views
  • 0 likes
  • 2 in conversation