BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
acordes
Rhodochrosite | Level 12

The attached code runs successfully, but it generates as many png files as there are plots.

 

Can I tweak it in order to get only one html?

 

pic.png  

 

 

ODS GRAPHICS ON / height=800 width=1400 reset=all border=off antialiasmax=2500 tipmax=2500 
imagemap=on imagename='histogram plus kernel'; 
ods html5 path="/caslibs/reportspr/" (url=none) 
body="hist_&tab..htm";

ods layout gridded columns=2  advance=proc column_gutter=0.1in row_gutter=0.1in;

%macro loop;
   proc sql noprint;
       select distinct _name_ into :vlist separated by '|' from CASUSER.MYDATA_RUSTATS2;
   quit;

   %do i = 1 %to %sysfunc(countw(&vlist,|));
title "Histogram and kernel overlay for outlier treated variable %Qscan(%superq(vlist),&i,|)";
ods proclabel "Histogram & kernel %Qscan(%superq(vlist),&i,|)";

ods graphics / width=8cm;
proc sgplot data=CASUSER.MYDATA_RUSTATS2; 
label value1="value %Qscan(%superq(vlist),&i,|)";  
             where _name_="%Qscan(%superq(vlist),&i,|)";
  histogram value1 / dataskin=sheen fillattrs=(color=bigb)    ;
  density value1 / type=kernel transparency=0.4;
             yaxis label="Density (pdf)";
        run;

    %end;
%mend;
%loop; 

ods layout end;

ods graphics / reset;

ods html5 close;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Can I tweak it in order to get only one html?

 

You do get one HTML file. Each plot that appears in the HTML file requires a .png file on your disk.

--
Paige Miller

View solution in original post

6 REPLIES 6
PaigeMiller
Diamond | Level 26

Can I tweak it in order to get only one html?

 

You do get one HTML file. Each plot that appears in the HTML file requires a .png file on your disk.

--
Paige Miller
acordes
Rhodochrosite | Level 12

Yes, I get already one file. 

and many png files.

But if it's like this, then it's fine. 

Reeza
Super User

It's not in Studio, I suppose it's possible CAS is different, but I suspect you do have another destination open

 

HTML5

 

Reeza_0-1674664523001.png

 

HTML

Reeza_1-1674664639268.png

 

 

 

Reeza
Super User

@PaigeMiller wrote:

Can I tweak it in order to get only one html?

 

You do get one HTML file. Each plot that appears in the HTML file requires a .png file on your disk.


HTML does, HTML5 does not, it embeds the images in the file.

Reeza
Super User

Do you have the regular ODS HTML destination open as well? My initial suggestion was going to be use HTML5 but I see you're already doing that.

 

EDIT: I just tested with HTML5, it doesn't generate separate files, so you likely have another destination open.

acordes
Rhodochrosite | Level 12
I've seen that my file extension is 'htm' while yours is 'html'

Perhaps that's the culprit.
Tomorrow I'll test.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6 replies
  • 536 views
  • 3 likes
  • 3 in conversation