<?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: macro logic  call missing() in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228075#M41158</link>
    <description>&lt;P&gt;I didn't think to test the call missing() seperately.&amp;nbsp; log 2-11 isn't available to remove on the first iteration and so on.&amp;nbsp; I seperated this step and it tests right now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2015 16:21:35 GMT</pubDate>
    <dc:creator>Steelers_In_DC</dc:creator>
    <dc:date>2015-10-01T16:21:35Z</dc:date>
    <item>
      <title>macro logic  call missing()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228054#M41149</link>
      <description>&lt;P&gt;I have two pieces of code below.&amp;nbsp; The uncommented does not work, the commented does.&amp;nbsp; There is no error, the code runs but the fields in question are not missing.&amp;nbsp; If I use %syscall I get an error.&amp;nbsp; I've searched around the google and found that %syscall won't work with missing() but cannot find any alternative.&amp;nbsp; Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %macro lag;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;%do i = 1 %to 11;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;_ldate&amp;amp;i = lag&amp;amp;i(record_date);&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if intck('month',_ldate&amp;amp;i,record_date) &amp;gt; 11 then _ldate&amp;amp;i = .;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if _count = &amp;amp;i then call missing(of _ldate&amp;amp;i-_ldate11); /* question refers to this line of the macro code */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;%end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;%mend;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;%lag;&lt;BR /&gt;/*if _count = 1 then call missing(of _ldate1-_ldate11);*/&lt;BR /&gt;/*if _count = 2 then call missing(of _ldate2-_ldate11);*/&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 14:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228054#M41149</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-10-01T14:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: macro logic  call missing()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228061#M41152</link>
      <description>&lt;P&gt;Your code looks fine and tests fine to me. This has to be something else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro test;
%do i=1 %to 3;
if _n_=&amp;amp;i then call missing(of v&amp;amp;i-v3);
%end;
%mend test;
data test;
input v1-v3;
%test
cards;
1 2 3
4 5 6
5 6 7
;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Oct 2015 15:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228061#M41152</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-10-01T15:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: macro logic  call missing()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228064#M41154</link>
      <description>&lt;P&gt;Define "does not work".&lt;/P&gt;
&lt;P&gt;Do you get an error? Post the whole code and the error from the log. With macros you may need to use option MPRINT to see the generated code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No output?&lt;/P&gt;
&lt;P&gt;Unexpected output? Them provide the whole code and example data that demonstrates the unexpected output and the expected.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 15:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228064#M41154</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-01T15:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: macro logic  call missing()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228070#M41157</link>
      <description>&lt;P&gt;Perhaps the order of execution of the CALL MISSING and the assignment statements might be wrong? &amp;nbsp;Hard to tell without the whole program and some data.&lt;/P&gt;
&lt;P&gt;You are generating the commands in this order:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;_ldate1 = lag1(record_date);
if _count = 1 then call missing(of _ldate1-_ldate11);
_ldate2 = lag2(record_date);
if _count = 2 then call missing(of _ldate2-_ldate11);
_ldate3 = lag3(record_date);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use two %DO loops then you could generate in this order:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;_ldate1 = lag1(record_date);
_ldate2 = lag2(record_date);
_ldate3 = lag3(record_date);
...
if _count = 1 then call missing(of _ldate1-_ldate11);
if _count = 2 then call missing(of _ldate2-_ldate11);
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 15:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228070#M41157</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-10-01T15:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: macro logic  call missing()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228075#M41158</link>
      <description>&lt;P&gt;I didn't think to test the call missing() seperately.&amp;nbsp; log 2-11 isn't available to remove on the first iteration and so on.&amp;nbsp; I seperated this step and it tests right now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 16:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-logic-call-missing/m-p/228075#M41158</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-10-01T16:21:35Z</dc:date>
    </item>
  </channel>
</rss>

