<?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: Each macro submission, new plots with different names are created in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508171#M1617</link>
    <description>&lt;P&gt;the do loop is setting &amp;amp;para.&lt;/P&gt;</description>
    <pubDate>Sun, 28 Oct 2018 21:44:10 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2018-10-28T21:44:10Z</dc:date>
    <item>
      <title>Each macro submission, new plots with different names are created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508162#M1610</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use ODS combining with macro to save png plots. The first time I submit the following codes:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Let param1=Intercept;
%Let param2=x;
/* Save png */
%macro m_hist;
	%Do para=1 %to 2;
	Ods graphics / imagename="&amp;amp;&amp;amp;param&amp;amp;para" imagefmt=png;
	Proc univariate data=combination;
		Title "Histogram of &amp;amp;&amp;amp;param&amp;amp;para";
		Where Variable="&amp;amp;&amp;amp;param&amp;amp;para";
		Var Estimate;
		Histogram Estimate/ odstitle="Histogram of &amp;amp;&amp;amp;param&amp;amp;para";
	Run;
	%End;
%mend;
%m_hist;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get two files&amp;nbsp;Intercept1.png and x1.png.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is unusual since I set the names without number 1 at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I submit the macro program again,&amp;nbsp;%m_hist;, this time I get&amp;nbsp;&lt;SPAN&gt;Intercept3.png and x3.png. The third time I submit I get&amp;nbsp;Intercept5.png and x5.png.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That is not what I expect. Do you have any idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for reading!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Trung Dung.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 20:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508162#M1610</guid>
      <dc:creator>trungdungtran</dc:creator>
      <dc:date>2018-10-28T20:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Each macro submission, new plots with different names are created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508163#M1611</link>
      <description>&lt;P&gt;that is because of this statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token macrostatement"&gt;%Do&lt;/SPAN&gt;&lt;SPAN&gt; para&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; &lt;SPAN class="token macrostatement"&gt;%to&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;so you are getting the results that are specified.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 21:00:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508163#M1611</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-28T21:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Each macro submission, new plots with different names are created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508164#M1612</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122002"&gt;@VDD&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the file names are fixed as&amp;nbsp;&amp;amp;&amp;amp;param&amp;amp;para is resolved as "Intercept" when i=1 and "x" when i=2. Could you explain more?&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 21:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508164#M1612</guid>
      <dc:creator>trungdungtran</dc:creator>
      <dc:date>2018-10-28T21:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Each macro submission, new plots with different names are created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508171#M1617</link>
      <description>&lt;P&gt;the do loop is setting &amp;amp;para.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Oct 2018 21:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508171#M1617</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-28T21:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Each macro submission, new plots with different names are created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508235#M1632</link>
      <description>&lt;P&gt;The numbers at te end if file names have nothing to do with your macro. They are added by the ODS to avoid overwriting existing files as explained here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_odsgraph_sect036.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_self"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_odsgraph_sect036.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change your statement to&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token statement"&gt;Ods&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;graphics&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; imagename&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"&amp;amp;&amp;amp;param&amp;amp;para"&lt;/SPAN&gt; imagefmt&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;png &lt;FONT color="#ff0000"&gt;reset=index&lt;/FONT&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to force overwriting.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 04:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/508235#M1632</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-10-29T04:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Each macro submission, new plots with different names are created</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/509432#M1783</link>
      <description>&lt;P&gt;Yes, the option "reset=index" solves the problem!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 09:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Each-macro-submission-new-plots-with-different-names-are-created/m-p/509432#M1783</guid>
      <dc:creator>trungdungtran</dc:creator>
      <dc:date>2018-11-01T09:30:02Z</dc:date>
    </item>
  </channel>
</rss>

