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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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