<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979696#M378839</link>
    <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":downcast_face_with_sweat:"&gt;😓&lt;/span&gt; This ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _temp;
do grp1=1 to 3;
	do grp2=1 to 3;
		do ind=1 to 100;
			y=grp1*10+grp2+sin(ind/10); output;
		end;
	end;
end;
run;

title;
ods _all_ close;
options nodate nonumber ;
options leftmargin="0.001in" rightmargin="0.001in" topmargin=1cm;
options papersize=(10.00in 8.50in);

ods printer printer=png300 file="c:\temp\dashboard.png" style=normalprinter nogtitle; 

ods layout gridded columns=3 advance=bygroup column_gutter=0.1in row_gutter=0.1in;
ods graphics / width=3.00in noborder ;
		proc sgplot data=_temp;
			by grp1 grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit; 

ods layout end;
ods printer close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1764322835219.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111641iCE94D29C7614D0F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1764322835219.png" alt="Ksharp_0-1764322835219.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Nov 2025 09:41:33 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-11-28T09:41:33Z</dc:date>
    <item>
      <title>How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979676#M378834</link>
      <description>&lt;P&gt;I am running macro gernerating PLOTS from PROC SGPLOT, and need&amp;nbsp;&lt;/P&gt;
&lt;P&gt;save the plots out with explicit filename/location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How ? Any Help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code below seems generated the file somewhere. But I cannot find anywhere.&lt;/P&gt;
&lt;P&gt;If put dir path, it complains.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
25813  %let plotvar=vol_dif_wt_csum;
25814  title "var=&amp;amp;plotvar.";
25815      ods layout gridded columns=2 rows=2 advance=table;
25816      ods graphics /width=600px height=400px   imagename="_TEST_"  outputfmt=png ;
25817      proc sgplot data=_index_avg_cmp_f_4grp(where=( ind between &amp;amp;endind. -1000 and
25817! &amp;amp;endind.+100));
25818              by  blw_flag abv_flag;
25819              series x=ind y=&amp;amp;plotvar. /  lineattrs=( color=blue thickness=2 pattern=solid);
25820              series x=ind y=&amp;amp;indexout._orig / y2axis   lineattrs=( color=red thickness=2
25820! pattern=solid);
25821              refline  &amp;amp;endind./axis=x lineattrs=(color=blue thickness=2 pattern=solid);
25822              refline  &amp;amp;refind./axis=x lineattrs=(color=lime thickness=1 pattern=solid);
25823      run;

25823!         quit;
NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.76 seconds
      cpu time            0.14 seconds

NOTE: There were 1972 observations read from the data set WORK._INDEX_AVG_CMP_F_4GRP.
      WHERE (ind&amp;gt;=6100 and ind&amp;lt;=7200);

25824      ods layout end;
25825  %let plotvar=vol_dif_wt_csum;
25826  title "var=&amp;amp;plotvar.";
25827      ods layout gridded columns=2 rows=2 advance=table;
25828      ods graphics /width=600px height=400px   imagename="D:\_TEST_"  outputfmt=png ;
WARNING: The IMAGENAME option or the output name contains invalid characters. D___TEST_ will be used
         as the image name prefix.
25829      proc sgplot data=_index_avg_cmp_f_4grp(where=( ind between &amp;amp;endind. -1000 and
25829! &amp;amp;endind.+100));
25830              by  blw_flag abv_flag;
25831              series x=ind y=&amp;amp;plotvar. /  lineattrs=( color=blue thickness=2 pattern=solid);
25832              series x=ind y=&amp;amp;indexout._orig / y2axis   lineattrs=( color=red thickness=2
25832! pattern=solid);
25833              refline  &amp;amp;endind./axis=x lineattrs=(color=blue thickness=2 pattern=solid);
25834              refline  &amp;amp;refind./axis=x lineattrs=(color=lime thickness=1 pattern=solid);
25835      run;

25835!         quit;
NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.44 seconds
      cpu time            0.09 seconds

NOTE: There were 1972 observations read from the data set WORK._INDEX_AVG_CMP_F_4GRP.
      WHERE (ind&amp;gt;=6100 and ind&amp;lt;=7200);

25836      ods layout end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2025 07:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979676#M378834</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-28T07:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979677#M378835</link>
      <description>&lt;P&gt;Hardly possible to suggest something useful without knowing the code of the macro.&lt;/P&gt;
&lt;P&gt;The ods gpath option may be used to set the location images are stored, see&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatug/p0cmojsdkiab8cn1k2qk3rp3a8s0.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatug/p0cmojsdkiab8cn1k2qk3rp3a8s0.htm&lt;/A&gt;&amp;nbsp;for details.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2025 07:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979677#M378835</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2025-11-28T07:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979678#M378836</link>
      <description>&lt;P&gt;My code generates 2*2 plot. How to Save the 2*2 into&amp;nbsp; one file?! Thanks,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/saving-the-grid-plot-created-with-high-resolution-300-dpi/m-p/920333#M362470" target="_blank"&gt;saving the grid plot created with high resolution 300 dpi - SAS Support Communities&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2025 07:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979678#M378836</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-28T07:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979679#M378837</link>
      <description>&lt;P&gt;Check this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2022/09/10/complex-layouts-using-the-sg-procedures/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2022/09/10/complex-layouts-using-the-sg-procedures/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods _all_ close;
options nodate nonumber;
options leftmargin="0.001in" rightmargin="0.001in";
options papersize=(7.35in 3.00in);

title "Sales Dashboard";
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ods printer printer=png300 file="dashboard.png" style=normalprinter;
&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Nov 2025 08:02:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979679#M378837</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-28T08:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979693#M378838</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; But still have issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The picture is saved out. But only one out of n-by-M.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _temp;
do grp1=1 to 3;
	do grp2=1 to 3;
		do ind=1 to 100;
			y=grp1*10+grp2+sin(ind/10); output;
		end;
	end;
end;
run;quit;

ods _all_ close;
options nodate nonumber;
options leftmargin="0.001in" rightmargin="0.001in";
options papersize=(7.35in 3.00in);

ods printer printer=png300 file="dashboard.png" style=normalprinter; 
	proc sgplot data=_temp;
			by grp1 grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Even just the code from the link. It does not show up right.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data heart;
set sashelp.heart;
if (weight_status eq '') then weight_status="Unknown";
run;
proc sort data=heart; by weight_status; run;

ods printer printer=png300 file="bygroups.png" style=normalprinter;
ods layout gridded columns=2 rows=2 advance=bygroup
    column_gutter=0.1in row_gutter=0.1in;
ods graphics / width=3.5in;
title "#byval1";
proc sgplot data=heart noautolegend uniform=xscale;
by weight_status;
yaxis offsetmin=0.05;
histogram cholesterol;
density cholesterol;
fringe cholesterol;
run;
ods layout end;
ods printer close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bygroups.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111640i980D0DCA8D0A3E87/image-size/large?v=v2&amp;amp;px=999" role="button" title="bygroups.png" alt="bygroups.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2025 08:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979693#M378838</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-28T08:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979696#M378839</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":downcast_face_with_sweat:"&gt;😓&lt;/span&gt; This ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _temp;
do grp1=1 to 3;
	do grp2=1 to 3;
		do ind=1 to 100;
			y=grp1*10+grp2+sin(ind/10); output;
		end;
	end;
end;
run;

title;
ods _all_ close;
options nodate nonumber ;
options leftmargin="0.001in" rightmargin="0.001in" topmargin=1cm;
options papersize=(10.00in 8.50in);

ods printer printer=png300 file="c:\temp\dashboard.png" style=normalprinter nogtitle; 

ods layout gridded columns=3 advance=bygroup column_gutter=0.1in row_gutter=0.1in;
ods graphics / width=3.00in noborder ;
		proc sgplot data=_temp;
			by grp1 grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit; 

ods layout end;
ods printer close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1764322835219.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111641iCE94D29C7614D0F6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1764322835219.png" alt="Ksharp_0-1764322835219.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2025 09:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979696#M378839</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-28T09:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979711#M378840</link>
      <description>&lt;P&gt;Thanks. This is IT.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Nov 2025 19:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979711#M378840</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-28T19:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979716#M378841</link>
      <description>&lt;P&gt;How to set ODS to the default, BTW?!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run the code below. It says "&lt;CODE class=" language-sas"&gt;WARNING: No output destinations active."&amp;nbsp;and&amp;nbsp;no&amp;nbsp;output&amp;nbsp;in&amp;nbsp;SAS.&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;26305          proc sgplot data=_temp;
26306              by grp1 grp2;
26307              series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);
26308      run;

26308!         quit;
NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.09 seconds
      cpu time            0.03 seconds

WARNING: No output destinations active.
NOTE: There were 900 observations read from the data set WORK._TEMP.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Nov 2025 11:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979716#M378841</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-29T11:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979722#M378842</link>
      <description>&lt;P&gt;For example, if you want to open HTML ODS destination :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ods html;&lt;/STRONG&gt;&lt;/FONT&gt;
ods graphics on;
proc sgplot data=sashelp.class;
scatter x=weight y=height;
run;
&lt;/PRE&gt;
&lt;PRE&gt;7    ods html;
NOTE: 正在写入 HTML Body（主体）文件: sashtml.htm
8    ods graphics on;
9    proc sgplot data=sashelp.class;
10   scatter x=weight y=height;
11   run;

NOTE: “PROCEDURE SGPLOT”所用时间（总处理时间）:
      实际时间          1.17 秒
      CPU 时间          0.34 秒

NOTE: 从数据集 SASHELP.CLASS. 读取了 19 个观测
&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Nov 2025 00:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979722#M378842</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-30T00:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to Save Out PLOT from PROC SGPLOT into A PIC FILE with explicit filename and location?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979723#M378843</link>
      <description>&lt;P&gt;For example, if you only want PDF ODS, you could close all these ODS firstly and open PDF secondly, then you would only have PDF .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;ods _all_ close;&lt;/STRONG&gt;

&lt;STRONG&gt;ods pdf file='c:\temp\temp.pdf';&lt;/STRONG&gt;
proc sgplot data=sashelp.class;
scatter x=weight y=height;
run;
ods pdf close;
&lt;/PRE&gt;
&lt;P&gt;P.S. For SAS the default ODS is HTML . You could set other default ODS at somewhere in configure menu, but I've never done that before.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Nov 2025 00:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Save-Out-PLOT-from-PROC-SGPLOT-into-A-PIC-FILE-with/m-p/979723#M378843</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-30T00:54:06Z</dc:date>
    </item>
  </channel>
</rss>

