<?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 concatenate macro variable  with conditional rule in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/concatenate-macro-variable-with-conditional-rule/m-p/754904#M238156</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a macro variable called vector .&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Condition 1:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;If data set transtbl doesn't exist then&amp;nbsp; vector will get value of 2009+2010+.....+....+current month&lt;/P&gt;
&lt;P&gt;(For example: ?If current month is July 2021 then the macro variable will get value&amp;nbsp; 2009+2010+2011+2012+2101+2102+2103+2104+2105+2106+2107)&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Condition 2:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;If data set&amp;nbsp; transtbl exists then vector will get value of&amp;nbsp; :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one month after min month in data set transtbl +.....................+&amp;nbsp;&amp;nbsp;current month&lt;/P&gt;
&lt;P&gt;(so for example if min month of field date in data set transtbl is 02Mar2021&amp;nbsp; and current month is July 2021 then vector will get value&amp;nbsp; 2103+2104+2105+2106+2107&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data transtbl ;
Format date date9.;
Input Id date : date9. amount;
cards;
1 18MAY2021 100
2 21FEB2021 200
3 08FEB2021 300
4 11MAR2021 100
5 27FEB2021 400
6 02FEB2021 800
7 20JUN2021 900
8 29MAY2021 100
9 17FEB2021 200
10 15FEB2021 300
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Jul 2021 04:39:44 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-07-19T04:39:44Z</dc:date>
    <item>
      <title>concatenate macro variable  with conditional rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-macro-variable-with-conditional-rule/m-p/754904#M238156</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a macro variable called vector .&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Condition 1:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;If data set transtbl doesn't exist then&amp;nbsp; vector will get value of 2009+2010+.....+....+current month&lt;/P&gt;
&lt;P&gt;(For example: ?If current month is July 2021 then the macro variable will get value&amp;nbsp; 2009+2010+2011+2012+2101+2102+2103+2104+2105+2106+2107)&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Condition 2:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;If data set&amp;nbsp; transtbl exists then vector will get value of&amp;nbsp; :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one month after min month in data set transtbl +.....................+&amp;nbsp;&amp;nbsp;current month&lt;/P&gt;
&lt;P&gt;(so for example if min month of field date in data set transtbl is 02Mar2021&amp;nbsp; and current month is July 2021 then vector will get value&amp;nbsp; 2103+2104+2105+2106+2107&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data transtbl ;
Format date date9.;
Input Id date : date9. amount;
cards;
1 18MAY2021 100
2 21FEB2021 200
3 08FEB2021 300
4 11MAR2021 100
5 27FEB2021 400
6 02FEB2021 800
7 20JUN2021 900
8 29MAY2021 100
9 17FEB2021 200
10 15FEB2021 300
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Jul 2021 04:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-macro-variable-with-conditional-rule/m-p/754904#M238156</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-07-19T04:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate macro variable  with conditional rule</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-macro-variable-with-conditional-rule/m-p/754906#M238158</link>
      <description>&lt;P&gt;So what did you try?&amp;nbsp; How did it not work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to have left out a key piece of information.&amp;nbsp; What is the meaning of those four digit strings between the plus signs?&lt;/P&gt;
&lt;P&gt;Are we supposed to guess what they mean?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 04:47:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-macro-variable-with-conditional-rule/m-p/754906#M238158</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-19T04:47:46Z</dc:date>
    </item>
  </channel>
</rss>

