<?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: Setting Parameters To Subtract from other Parameters in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-Parameters-To-Subtract-from-other-Parameters/m-p/848146#M41828</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let ry1=%eval(&amp;amp;ry-1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, as alluded to by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, it may be a better idea to discuss the context on how this will be used, as perhaps we can provide even better solutions if we know the broader context.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 16:08:50 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-12-06T16:08:50Z</dc:date>
    <item>
      <title>Setting Parameters To Subtract from other Parameters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-Parameters-To-Subtract-from-other-Parameters/m-p/848127#M41826</link>
      <description>&lt;P&gt;Hello,&amp;nbsp; I am trying to see if there is a way to set Parameters based off of other Parameters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently I use:&lt;/P&gt;
&lt;P&gt;%Let RY=23;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to set&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%Let RY1 =22;&lt;/P&gt;
&lt;P&gt;%Let RY2 =21;&lt;/P&gt;
&lt;P&gt;etc. for 10 more years.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but instead of manually changing every single one of them at the start of a new year, I was wanting to see if I could set it to be something like&lt;/P&gt;
&lt;P&gt;%Let RY=23;&lt;/P&gt;
&lt;P&gt;%Let RY1 = RY-1; so when it plugs in RY1 it will place 22.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advanced!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 15:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-Parameters-To-Subtract-from-other-Parameters/m-p/848127#M41826</guid>
      <dc:creator>ccaudillo100</dc:creator>
      <dc:date>2022-12-06T15:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Parameters To Subtract from other Parameters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-Parameters-To-Subtract-from-other-Parameters/m-p/848132#M41827</link>
      <description>&lt;P&gt;If you show more of what you are attempting it may help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest that if the values you want are in sequence to use a macro with a loop.&lt;/P&gt;
&lt;PRE&gt;%macro somename (start=, end=);
% do Ry=&amp;amp;start %to &amp;amp;end;

&amp;lt;other code- suffix final output if needed with value of &amp;amp;ry to distinguish&amp;gt;

%end;
%mend;

%somename (start=21, end=31)&lt;/PRE&gt;
&lt;P&gt;You can use %eval function to force INTEGER arithmetic with macro values %let var = %eval(&amp;amp;othervar - 1); If the values are decimals the use %sysevalf.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 15:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-Parameters-To-Subtract-from-other-Parameters/m-p/848132#M41827</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-12-06T15:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Parameters To Subtract from other Parameters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-Parameters-To-Subtract-from-other-Parameters/m-p/848146#M41828</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let ry1=%eval(&amp;amp;ry-1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, as alluded to by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, it may be a better idea to discuss the context on how this will be used, as perhaps we can provide even better solutions if we know the broader context.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 16:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Setting-Parameters-To-Subtract-from-other-Parameters/m-p/848146#M41828</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-06T16:08:50Z</dc:date>
    </item>
  </channel>
</rss>

