The SAS Output Delivery System and reporting techniques

how to suppress the increment number in ods listing

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

how to suppress the increment number in ods listing

Hi,

 

I am using proc sgplot to generate graphs and trying to save the generated graphs using ods listing. The generated graphs are then imported into excel using DDE.

 

My current problem is that an increment number is automatically appended at the end of the file name (e.g., filename.png for the first time execution, filename1.png for the 2nd time execution, and so forth). Anyone knows how to surppress this setting? By the way, I am on 9.4.

 

The following is how my code looks like:

 

goptions reset=all gsfmode=replace;
ods graphics/imagename="MSS_freq" Imagefmt=PNG ;
ods listing gpath="C:\temp";

 

proc sgplot;

<snip>

 

Thanks ahead,

 

C.


Accepted Solutions
Solution
‎12-07-2016 10:56 AM
SAS Super FREQ
Posts: 3,630

Re: how to suppress the increment number in ods listing

?? What do you want instead?  If you just want every file to be called "MSS_freq," then either

1. Delete the previous copy of that file before you create the new file.

2. Put RESET=ALL or RESET=INDEX on the ODS GRAPHICS statement, like this

    ods graphics / imagename="A" imagefmt=png reset=index;

 

The RESET=IMAGE option was added in SAS 9.4m3. Here is the documentation of the RESET=INDEX option.

 

View solution in original post


All Replies
Super User
Super User
Posts: 7,720

Re: how to suppress the increment number in ods listing

Sorry, this sounds all weird to me.  Firstly DDE is very ancient (pre 2003) and really isn't the way forward.  Secondly, why create graphs in SAS, then paste them as images into Excel, doesn't that defeat the purpose of either technology?  Either output graphs as data + report from a SAS standpoint, or send the data to Excel and do your graph in that.  Otherise you have a picture whichis not editable in either.

 

As for the filenaming, that is pretty standard, each time a new image is created its incremented.

 

Personally I would drop Excel, create your reports in SAS.  However if you have to use Excel, then dump the data there and graph in that. 

Occasional Contributor
Posts: 8

Re: how to suppress the increment number in ods listing

Hi, 

 

Thank you for the quick reply. I am working on a review file (format) that was previously put in excel (multiple sheets in different tabs, automatically colored cells given some criteria, and the a few graphs in different tabs). The review file needs to be automatically generated. I understand that DDE is quite old and not receving much support from Microsoft, but I need to add the graphs into excel automatically.

 

It sounds like there is no way around avoiding SAS generating the increment file name using ods listing???

 

 

Super User
Posts: 11,134

Re: how to suppress the increment number in ods listing

Specify a different imagename in an ODS graphics statement before each SGPLOT procedure call.

Though if you use by group processing the image names will still get incremented.

 

I do agree that putting images into Excel this way borders on unnatural though I suspect you have someone that insists on Excel output.

If that is the case I would be tempted to see if I could get by with creating an HTML document with all the graphs and then converting that.

Solution
‎12-07-2016 10:56 AM
SAS Super FREQ
Posts: 3,630

Re: how to suppress the increment number in ods listing

?? What do you want instead?  If you just want every file to be called "MSS_freq," then either

1. Delete the previous copy of that file before you create the new file.

2. Put RESET=ALL or RESET=INDEX on the ODS GRAPHICS statement, like this

    ods graphics / imagename="A" imagefmt=png reset=index;

 

The RESET=IMAGE option was added in SAS 9.4m3. Here is the documentation of the RESET=INDEX option.

 

Occasional Contributor
Posts: 8

Re: how to suppress the increment number in ods listing

Yes, I do want each graph to be named the same so that I can pass on the names as macro variables when inserting the graphs. 

 

I tried RESET=INDEX, it worked. 

 

Many thanks, Rick and all of you that replied!!!

 

C.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 269 views
  • 3 likes
  • 4 in conversation