<?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: assign value to macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506999#M135983</link>
    <description>&lt;P&gt;No big deal about the size of the &lt;STRONG&gt;long&lt;/STRONG&gt; dataset. OK, Before I attempt to code, please provide or confirm a clear sample of HAVE and WANT. I pointed out there is only one non matches sept-oct and your conclusion&amp;nbsp;&lt;SPAN&gt;flag&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;c&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and d has confused me.&amp;nbsp; It would also help us going back and forth. Kindly review and confirm.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if my understanding is correct, you don;t need a macro however Hash would make it easy, which would be my approach.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PS I am not clear with table z. &lt;EM&gt;&lt;U&gt;My understanding so far is comparison of by sequential groups sets of 2&lt;/U&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Oct 2018 20:01:19 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-10-23T20:01:19Z</dc:date>
    <item>
      <title>assign value to macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506986#M135975</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset A like:&lt;/P&gt;&lt;P&gt;month&amp;nbsp; flag&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;B&lt;/P&gt;&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;C&lt;/P&gt;&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;D&lt;/P&gt;&lt;P&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;C&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;nov&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;nov&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;i want to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;find unmatch rows for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;two consecutive&amp;nbsp;months&lt;/STRONG&gt;, eg, difference between month sep and oct,&amp;nbsp; flag&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;c&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and d are&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in month oct;&lt;/P&gt;&lt;P&gt;for month oct and nov, flag c is not&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;nov.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;able z: for example.(&lt;STRONG&gt;table z will change, so last obs of n can be any number&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;n&amp;nbsp; month&lt;/P&gt;&lt;P&gt;1&amp;nbsp; sep&lt;/P&gt;&lt;P&gt;2&amp;nbsp; oct&lt;/P&gt;&lt;P&gt;3&amp;nbsp; nov&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assign all n and month in :&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select month,n into: month1:-,:n1-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;macro n is generate from another data step, which is&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;BR /&gt;set z(keep=n) end=eof;&lt;BR /&gt;if eof then output; run; ----------&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;I just want last obs from column n.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and then I want to create a do loop,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;do n=1 to &amp;amp;eof.&amp;nbsp; &amp;nbsp;eg, if last obs of n=3, then &amp;amp;eof should be 3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;basically idea I use except: this is a wrong program, just want to explain my idea.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;%let n=&amp;amp;eof;&lt;/P&gt;&lt;P&gt;%let i=%eval(&amp;amp;n+1);&lt;BR /&gt;%let dates=&amp;amp;dates;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc sql;create table lost&amp;amp;n as&lt;/P&gt;&lt;P&gt;select&amp;nbsp;*&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from&amp;nbsp;table A&lt;/P&gt;&lt;P&gt;where month=&lt;STRONG&gt;&amp;amp;&amp;amp;month&amp;amp;n&lt;/STRONG&gt;&amp;nbsp;and flag not in&amp;nbsp;&lt;/P&gt;&lt;P&gt;(select flag from table A where month=&lt;STRONG&gt;&amp;amp;&amp;amp;month&amp;amp;i&lt;/STRONG&gt;); --so this lost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want to create a macro can automatically track last obs of n and put n into proc sql process to generate unmatch flag value between consecutive month.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;so output should include&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;table lost1 (contain unmatching row between sep and oct)&lt;/P&gt;&lt;P&gt;table lost2 (contain unmatch rows between otc and nov)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;aww...idk if i clarify my question clearly...but any help will be appreciated! Thank you !&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 19:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506986#M135975</guid>
      <dc:creator>jojozheng</dc:creator>
      <dc:date>2018-10-23T19:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506988#M135977</link>
      <description>&lt;P&gt;Before taking a look at the bold macro parts,&lt;/P&gt;
&lt;P&gt;To your question&amp;nbsp;&lt;SPAN&gt;i want to&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;find unmatch rows for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;two consecutive&amp;nbsp;months&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;B&lt;/P&gt;
&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;C&lt;/P&gt;
&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;D&lt;/P&gt;
&lt;P&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;
&lt;P&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;B&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;C&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To my eyes,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Unmatched row i s&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sep D&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you clarify your requirement clearly plz&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should the logic check&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. sep-oct&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;then 2 oct-nov&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and so on?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you just have 2 vars/columns in dataset or there are many others too&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 19:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506988#M135977</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-23T19:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506998#M135982</link>
      <description>yes. your logic is right:&lt;BR /&gt;1. sep-oct&lt;BR /&gt;then 2 oct-nov&lt;BR /&gt;and so on&lt;BR /&gt;&lt;BR /&gt;I have only these two var in table but dataset is huge.&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Oct 2018 19:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506998#M135982</guid>
      <dc:creator>jojozheng</dc:creator>
      <dc:date>2018-10-23T19:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506999#M135983</link>
      <description>&lt;P&gt;No big deal about the size of the &lt;STRONG&gt;long&lt;/STRONG&gt; dataset. OK, Before I attempt to code, please provide or confirm a clear sample of HAVE and WANT. I pointed out there is only one non matches sept-oct and your conclusion&amp;nbsp;&lt;SPAN&gt;flag&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;c&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and d has confused me.&amp;nbsp; It would also help us going back and forth. Kindly review and confirm.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if my understanding is correct, you don;t need a macro however Hash would make it easy, which would be my approach.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PS I am not clear with table z. &lt;EM&gt;&lt;U&gt;My understanding so far is comparison of by sequential groups sets of 2&lt;/U&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 20:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/506999#M135983</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-23T20:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/507003#M135985</link>
      <description>&lt;P&gt;month&amp;nbsp; flag&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;B&lt;/P&gt;&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;C&lt;/P&gt;&lt;P&gt;sep&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;D&lt;/P&gt;&lt;P&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;oct&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;C&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;nov&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;nov&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;between sep and oct, only D is different;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;column n in table z is what I want to create to call value.&lt;/P&gt;&lt;P&gt;data zz;&lt;BR /&gt;set z(keep=n) end=eof;&lt;BR /&gt;if eof then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set zz;&lt;BR /&gt;call symput('eof',n);run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data do;&lt;BR /&gt;do c=1 to &amp;amp;eof;&lt;BR /&gt;n=c;call symput('n',n);-------want to assign every n with a macro&amp;nbsp;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let n=&amp;amp;n;&lt;BR /&gt;%let i=%eval(&amp;amp;n+1); ---so here, when I run code, &lt;STRONG&gt;n&lt;/STRONG&gt; can return me obs contain month sep,&amp;nbsp; &lt;STRONG&gt;i&lt;/STRONG&gt; can return me row of month oct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so these can be return like&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp;month&amp;amp;n=sep&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp;month&amp;amp;1=oct&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I will not manually to assign macro like&lt;/P&gt;&lt;P&gt;%let n=&amp;amp;n1;&lt;BR /&gt;%let i=%eval(&amp;amp;n+1);&lt;/P&gt;&lt;P&gt;then return me n=1,i=2&lt;/P&gt;&lt;P&gt;i don't want to manully assign&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let n=&amp;amp;n2;&lt;BR /&gt;%let i=%eval(&amp;amp;n+1);&amp;nbsp; then return me n=2,i=3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want n assign value automatically like a do loop, then generates me all the reports.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 20:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/507003#M135985</guid>
      <dc:creator>jojozheng</dc:creator>
      <dc:date>2018-10-23T20:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/507020#M135995</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215650"&gt;@jojozheng&lt;/a&gt;&amp;nbsp;See if this is what you are after or something close to what you are after. If yes, we can do some cosmetics after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input (month  flag) ($);   
cards;
sep       A       
sep        B
sep        C
sep        D
oct         A
oct         B
oct         C
nov        A
nov        B
;

data _null_;
if _n_=1 then do;
 dcl hash H () ;
   h.definekey  ("flag") ;
   h.definedata ("month","flag") ;
   h.definedone () ;
end;
k=_n_;
do until(last.month);
	set have;
	by month notsorted;
	if k&amp;gt;1 then do;
	rc=h.check();
	if rc=0 then rc=h.remove();
	else rc=h.add();
	if last.month then do; 
		h.output(dataset:cats('LOST',k));
		h.clear();
	end;
end;
end;
do until(last.month);
	set have;
	by month notsorted;
	rc=h.add();
end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Oct 2018 21:24:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/507020#M135995</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-23T21:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/507110#M136045</link>
      <description>&lt;P&gt;You say your table is huge. If that is because you have many flags and not many months, then something like this may work better than the hash solution:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data diff;
  merge
    have(where=(month='sep') in=in1)
    have(where=(month='oct') in=in2)
    have(where=(month='nov') in=in3)
    ;
  by flag;
  if in1 and not in2 then do;
    month='oct';
    output;
    end;
  if in2 and not in3 then do;
    month='nov';
    output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you do not know the months beforehand, you can generate the code using a datastep:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename tempsas temp;
filename tempsas2 temp;
data _null_;
  do until(last.month);
    set have;
    by month notsorted;
    end; 
  file tempsas;
  put "have(where=(month='" month "') in=in" _N_ ')';
  file tempsas2;
  if _N_&amp;gt;1 then do;
    prev=_N_-1;
    put 
      'if in' prev 'and not in' _N_ 'then do;'/
      "  month='" month "';" / 
      "  output;" /
      "  end;";
    end;
run;

data diff;
  merge
    %include tempsas/source2;
	;
  by flag;
  %include tempsas2/source2;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 11:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/507110#M136045</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-10-24T11:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/507668#M136283</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/215650"&gt;@jojozheng&lt;/a&gt;: You gave my suggestion a like. Does that mean that it works for you? In that case, you should mark it as a solution.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 07:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-value-to-macro/m-p/507668#M136283</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-10-26T07:49:34Z</dc:date>
    </item>
  </channel>
</rss>

