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

I have a program loop that creates a html report. The program is called, and uses the input to create a new html report. But each time I create a new report, the png files in the graphs folder. About 20 graphs are created. 

ods html file = "&modell_id..htm"
path = "...\Reports\TreeBoost"
gpath = "...\Reports\TreeBoost\graphs"

In the folder, the files are named SGplot1-SGplot39. It skips every even number (2,4,6,8)

 

Shouldnt the proc create new files ? And what is with the skipping of even numbers? I have tried changing the output folder name to a fresh folder, with the same results. I seems to be stuck in some index for naming the files, and starts over each time. In previous iterations of the code, It would create new files with higher numbers. I had previously deleted some old files, before this issue appeared.

1 ACCEPTED SOLUTION

Accepted Solutions
Ullsokk
Pyrite | Level 9

I added imagename="&modell_id.", which solved the issue for now. Will consider trying the html5 option as well, that sounds a lot simpler to manage

View solution in original post

8 REPLIES 8
Cynthia_sas
Diamond | Level 26
Hi:
Are you resetting the index?
ods graphics / reset=index; OR
ods graphics / reset=all;

Otherwise, without seeing what the rest of your code is, it's hard to comment. I've not had ODS GRAPHICS or SGPLOT only create odd numbered graphs. This might be a question for Tech Support.

Cynthia
Ullsokk
Pyrite | Level 9

No, I have no RESET statement in my code, should I have? Or shouldn't I?

 

The entire code is very long and convoluted with %includes and macros. Besides, untill I deleted some old pngs, there was no issue. 

DanH_sas
SAS Super FREQ

The skip in the numbers is probably due to having two destinations open (maybe LISTING and HTML?). I agree with @Cynthia_sas  that there is probably a RESET occurring on an ODS GRAPHICS statement somewhere in your code.

 

Thanks!
Dan

Ullsokk
Pyrite | Level 9

Triple checked, there is no RESET anywhere. Beside, as stated previously, before deleting old pngs in the folder, all worked fine. The overwriting happened after deleting old png, files the code is not altered.

Tom
Super User Tom
Super User

@Ullsokk wrote:

Triple checked, there is no RESET anywhere. Beside, as stated previously, before deleting old pngs in the folder, all worked fine. The overwriting happened after deleting old png, files the code is not altered.


It really seems strange that after deleting the files it now starts overwriting actual files.  Do you perhaps mean that before it would make unique names for the files and now that the old files are gone it is re-using those names?  Not sure how it could know not to do that if the files are gone.

 

If it really did start overwriting existing files then perhaps by deleting the files you removed files that had permission settings that made it impossible for the SAS process to delete them.  But now the new files have been created with permission settings that let SAS delete them.

Ullsokk
Pyrite | Level 9

Yes, before, the numbers ran to about 400. Now it just starts at 1 (and skips every even number). I will have to try to reset somehow. Will try changing the paths again.

Cynthia_sas
Diamond | Level 26
If you do accidentally have multiple destinations open, then having
ODS _ALL_ CLOSE;
before you start running anything may close all the open (and possibly unnecessary) destinations.

It is possible for ODS GRAPHICS to start overwriting image files. I believe there is a finite limit to the size of the name that can be assigned to the image file and when the limit is reached, the numbers will cycle around again. (Or at least they used to). I am in the habit of doing this:
ods graphics/reset=image;

for my jobs if and when having certain names/numbers to my images is important. Other things you can do that bypass the numbering completely are to use a destination that does NOT create an external file: ODS PDF, ODS RTF and ODS HTML5 all will allow you to embed the image in the output file, so there is no external image file and thus, no numbering to worry about.

Cynthia
Ullsokk
Pyrite | Level 9

I added imagename="&modell_id.", which solved the issue for now. Will consider trying the html5 option as well, that sounds a lot simpler to manage

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 8 replies
  • 3851 views
  • 0 likes
  • 4 in conversation