I am generating png image files that I want to have standard naming convention. However the files that get generated have names that end with "1". I know that should happen if there is more than one times the image is generated, so that the first time it is called "image.png" and the second time "image1.png." But this happened even if there is one call, and even if there are no other image files in the folder.
I found a previous thread that had similar issue, and it was solved by adding "ods html close" to the top. I added this statement, but it did not help. Below I am listing the code.
%macro dograph(AgeorDate,loantype);
ODS HTML CLOSE;
ODS PDF CLOSE;
ods graphics on /
outputfmt= png
imagemap = on
reset = all
imagename="IJMy"
border=on
width=6.75in
height=5.25in;
ods listing gpath="/sasmart/zkydmjo/IJGraph";
PROC SGPANEL DATA=lalas;
PANELBY gender /SPACING=3 novarname;
series y=smm x=&AgeorDate /
MARKERS MARKERATTRS = (SYMBOL = CircleFilled COLOR = black SIZE = 5)
LINEATTRS = (COLOR = black PATTERN = SOLID);
series y=fit x=&AgeorDate /
MARKERS MARKERATTRS = (SYMBOL = circle COLOR = green SIZE = 5)
LINEATTRS = (COLOR = green PATTERN = SOLID);
COLAXIS grid;
ROWAXIS grid;
RUN;
ods listing close;
%mend dograph;
%dograph(loanage, loc);
Try to define gpath before requesting reset=all and imagename=.
Thank you. I have already tried to switch the line "ods listing gpath = "...." to be above the statement "ods graphics on /". However that did not help.
I was able to solve it by adding
ODS _ALL_ close;
to the top.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.