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

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);

 

1 ACCEPTED SOLUTION

Accepted Solutions
phdism
Fluorite | Level 6

I was able to solve it by adding

ODS _ALL_ close;

 

to the top.

View solution in original post

3 REPLIES 3
PGStats
Opal | Level 21

Try to define gpath before requesting reset=all and imagename=.

PG
phdism
Fluorite | Level 6

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.

phdism
Fluorite | Level 6

I was able to solve it by adding

ODS _ALL_ close;

 

to the top.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 950 views
  • 0 likes
  • 2 in conversation