<?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: 2 Questions about the following code. firstobs and one macro varaible. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308947#M66382</link>
    <description>&lt;P&gt;I strongly suspect that &amp;amp;evtdate. contains CALDT; since you renamed CALDT to something else in &lt;U&gt;all&lt;/U&gt; input dataset options, SAS will automatically create a new variable CALDT inside the data step, which will always be missing. See the respective&lt;/P&gt;
&lt;PRE&gt;NOTE: Variable CALDT is uninitialized.&lt;/PRE&gt;
&lt;P&gt;Therefore the result of your nmiss function will never be less than 1.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Nov 2016 07:34:09 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-11-03T07:34:09Z</dc:date>
    <item>
      <title>2 Questions about the following code. firstobs and one macro varaible.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308917#M66368</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _CALDATES;
   merge CRSP.DSIX (keep=CALDT rename=(CALDT=ESTPER_BEG))								
   crsp.asix (keep=CALDT firstobs=%eval(&amp;amp;estper) rename=(CALDT=ESTPER_END))					
																					
  																							
   CRSP.DSIX (keep=CALDT firstobs=%eval(&amp;amp;estper+&amp;amp;gap+1) rename=(CALDT=EVTWIN_BEG))		
   CRSP.DSIX (keep=CALDT firstobs=%eval(&amp;amp;estper+&amp;amp;gap-&amp;amp;start+1) rename=(CALDT=&amp;amp;evtdate))
   CRSP.DSIX (keep=CALDT firstobs=%eval(&amp;amp;estper+&amp;amp;gap+&amp;amp;evtwin) rename=(CALDT=EVTWIN_END));
   format ESTPER_BEG ESTPER_BEG EVTWIN_BEG &amp;amp;evtdate EVTWIN_END date9.;
   if nmiss(ESTPER_BEG,ESTPER_BEG,EVTWIN_BE,EVTWIN_END,&amp;amp;evtdate)=0;							
   time+1;																					
  run;
 %put ### DONE!;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;All the macro variables(ex, %estper, &amp;amp;gap, etc) are either date or duration. Although this code worked, I could not quite understand the rol of firstobs. From what I can find, it was mostly used to limit the shown results but I think the role here is quite different from that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I was not quite sure about the role of &amp;amp;evtdate. According to the original script's description,&amp;nbsp;EVTDATE represents the name of the event date variable in INSET dataset. So, I put one of the event date variables caldt, but when I put this variable I see the log saying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Variable CALDT is uninitialized.&lt;BR /&gt;NOTE: There were 23787 observations read from the data set CRSP.DSIX.&lt;BR /&gt;NOTE: There were 23678 observations read from the data set CRSP.DSIX.&lt;BR /&gt;NOTE: There were 23647 observations read from the data set CRSP.DSIX.&lt;BR /&gt;NOTE: There were 23646 observations read from the data set CRSP.DSIX.&lt;BR /&gt;NOTE: There were 23645 observations read from the data set CRSP.DSIX.&lt;BR /&gt;NOTE: The data set WORK._CALDATES has 0 observations and 7 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 2.49 seconds&lt;BR /&gt;cpu time 0.40 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The included code is one part of the macro and I was testing each of small parts so that I can understand how the whole macro works. The macro variable&amp;nbsp;&lt;SPAN&gt;&amp;amp;evtdate is used several times after this part of code, but I could not see why when &amp;amp;evtdate is replaced with CALDT, which is one date variable from the dataset, is not working. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all the time for sharing your opinion SAS community!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 01:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308917#M66368</guid>
      <dc:creator>Leon_Seungmin</dc:creator>
      <dc:date>2016-11-03T01:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Questions about the following code. firstobs and one macro varaible.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308938#M66378</link>
      <description>&lt;P&gt;Firstobs linits the data. Test it on a sample dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set sashelp.class(firstobs=5);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding macro variable, what does it resolve to? A date or duration wouldn't make sense. I would expect it to be a variable name.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 05:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308938#M66378</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-03T05:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Questions about the following code. firstobs and one macro varaible.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308940#M66379</link>
      <description>&lt;P&gt;Output&amp;nbsp;&lt;SPAN&gt;has 0 observations probably because of:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;nmiss&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;ESTPER_BEG&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;ESTPER_BEG&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;EVTWIN_BE&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;EVTWIN_END&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;evtdate&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which means that, at least one of the variables is a missing value (then nmiss() is &amp;gt; 0)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the&lt;STRONG&gt; IF &amp;nbsp;&amp;lt;condition&amp;gt; ;&lt;/STRONG&gt; makes a selection to output.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 06:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308940#M66379</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-03T06:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Questions about the following code. firstobs and one macro varaible.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308947#M66382</link>
      <description>&lt;P&gt;I strongly suspect that &amp;amp;evtdate. contains CALDT; since you renamed CALDT to something else in &lt;U&gt;all&lt;/U&gt; input dataset options, SAS will automatically create a new variable CALDT inside the data step, which will always be missing. See the respective&lt;/P&gt;
&lt;PRE&gt;NOTE: Variable CALDT is uninitialized.&lt;/PRE&gt;
&lt;P&gt;Therefore the result of your nmiss function will never be less than 1.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 07:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/308947#M66382</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-03T07:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Questions about the following code. firstobs and one macro varaible.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/309086#M66450</link>
      <description>&lt;P&gt;within your code you are reading the same input dataset 5 times.&lt;/P&gt;
&lt;P&gt;each time you create a new variable equal to CALDT, from different group of observations,&lt;/P&gt;
&lt;P&gt;starting with the calculated FIRSTOBS to the &lt;STRONG&gt;end&lt;/STRONG&gt; of the dataset..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;while executing&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if nmiss(ESTPER_BEG,ESTPER_BEG,EVTWIN_BE,EVTWIN_END,&amp;amp;evtdate)=0;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;you are looking for the common group (cutting group / inner join group) among all groups;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it can be done more efficiently by calculating the resulting group size and&lt;/P&gt;
&lt;P&gt;reading this amount of observations only, instead reading up to end of the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you may try next code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;/* calculate size of desired group */&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;data _NULL_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;id = open('CRSP.DSIX ');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; num1 = attrn(id, 'NOBS'); &amp;nbsp; &amp;nbsp; &amp;nbsp; /* dataset number of observations */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;id = close(id);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;num2 =&amp;nbsp;&amp;amp;estper; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* firstobs to get&amp;nbsp;ESTPER_END */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;num3 =&amp;nbsp;&amp;amp;estper+&amp;amp;gap+1; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt; /* firstobs to get&amp;nbsp;EVTWIN_BEG */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;num4 =&amp;nbsp;&amp;amp;estper+&amp;amp;gap-&amp;amp;start+1; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt; /* firstobs to get&amp;nbsp;&amp;amp;evtdate &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;num5 =&amp;nbsp;&amp;amp;estper+&amp;amp;gap+&amp;amp;evtwin; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt; /* firstobs to get&amp;nbsp;EVTWIN_END */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;group_start = max(1 , num2, num3, num4, num5);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;group_last &amp;nbsp;= min( num1, num2, num3, num4, num5);&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;group_size = group_last - group_start +1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;put "&amp;gt;&amp;gt;&amp;gt; Resulting group size&amp;nbsp;is " obs " observations";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if group_size &amp;gt; o then&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;call symput('OBS',left(group_size ));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;else do;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;call symput('OBS', '0');&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;put '&amp;gt;&amp;gt;&amp;gt; Zero observations expected. program not run '; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ABORT; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;/* using size group in your code */&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data _CALDATES;&lt;BR /&gt; merge CRSP.DSIX (keep=CALDT rename=(CALDT=ESTPER_BEG)&lt;STRONG&gt; &amp;nbsp;obs = &amp;amp;obs&amp;nbsp;&lt;/STRONG&gt;) &lt;BR /&gt; crsp.asix (keep=CALDT firstobs=%eval(&amp;amp;estper) rename=(CALDT=ESTPER_END) &amp;nbsp;&lt;STRONG&gt;obs = &amp;amp;obs&lt;/STRONG&gt; ) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt; &amp;nbsp; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;nbsp;/* ??? why have left those gap rows - are there other input lines ??? &amp;nbsp;*/&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt; &lt;BR /&gt; CRSP.DSIX (keep=CALDT firstobs=%eval(&amp;amp;estper+&amp;amp;gap+1) rename=(CALDT=EVTWIN_BEG) &amp;nbsp;&lt;STRONG&gt;obs = &amp;amp;obs&lt;/STRONG&gt;) &lt;BR /&gt; CRSP.DSIX (keep=CALDT firstobs=%eval(&amp;amp;estper+&amp;amp;gap-&amp;amp;start+1) rename=(CALDT=&amp;amp;evtdate) &amp;nbsp;&lt;STRONG&gt;obs = &amp;amp;obs&lt;/STRONG&gt;)&lt;BR /&gt; CRSP.DSIX (keep=CALDT firstobs=%eval(&amp;amp;estper+&amp;amp;gap+&amp;amp;evtwin) rename=(CALDT=EVTWIN_END &lt;STRONG&gt;&amp;nbsp;obs = &amp;amp;obs&lt;/STRONG&gt;));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt; format ESTPER_BEG ESTPER_BEG EVTWIN_BEG &amp;amp;evtdate EVTWIN_END date9.;&lt;BR /&gt;if nmiss(ESTPER_BEG,ESTPER_BEG,EVTWIN_BE,EVTWIN_END,&amp;amp;evtdate)=0;&amp;nbsp; &lt;FONT color="#008000"&gt;&lt;STRONG&gt;/*** this line may be unnecessary */&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt; time+1; &lt;BR /&gt; run;&lt;BR /&gt; %put ### DONE!;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 16:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/309086#M66450</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-03T16:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Questions about the following code. firstobs and one macro varaible.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/309426#M66547</link>
      <description>&lt;P&gt;Thank you so much for your input! I was away for 2 days and I will check all the comments here and put feedback! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 21:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/309426#M66547</guid>
      <dc:creator>Leon_Seungmin</dc:creator>
      <dc:date>2016-11-04T21:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Questions about the following code. firstobs and one macro varaible.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/309443#M66559</link>
      <description>&lt;P&gt;I did a few test runs and found out the the meaing of firstobs and why CALDT was not working when it was put in the macro variable, &amp;amp;evtdate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that when I put firstobs=%eval(1), the data variable started from the first date it is available and when I put %eval(2) it started from the second date. I do not know why it works like that even after reading firstobs and %eval syntax(I would appreciate if someone can tell me where to look to understand it thoroughly), at least I know what this code means &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, CALDT did not work because I did not created CALDT variable in the merged data. So I just added one more line&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;CRSP.DSIX (keep=CALDT firstobs=%eval(1));&amp;nbsp;&lt;/P&gt;&lt;P&gt;it worked fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While I was testing this code, I found that when there are less than 4 argument after format, somehow it did not work. Once again, I tried to find the syntax of format, but I could not find it. This happens when the name of statement is not unique and I am not sure what to do when this happens.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For now, the best thing I can do when I cannot find proper explanation appears to be asking help in this SAS community or doing a small test so that I can figure out how the code works. Apart from these two approches, if there are other things I can do, please let me know!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for all of your help. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 22:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/309443#M66559</guid>
      <dc:creator>Leon_Seungmin</dc:creator>
      <dc:date>2016-11-04T22:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: 2 Questions about the following code. firstobs and one macro varaible.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/309459#M66570</link>
      <description>&lt;P&gt;I would like yo clarify usage of FIRSTOBS and %EVAL().&lt;/P&gt;
&lt;P&gt;Run the next two exersizes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;(1).&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;data test;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;do var= 1 to 5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x='Row No.';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test1(firstobs=2); &lt;STRONG&gt;&amp;nbsp;/* no need to use %eval as firstobs is given by literal */&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;set test;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;(2).&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;%mcaro check;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; %let x = 5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; %let y=7;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt; %let A = &amp;amp;x &amp;nbsp;+ &amp;amp;y; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;%put A=&amp;amp;a;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; %let B= %eval(&amp;amp;x + &amp;amp;y); &amp;nbsp; &amp;nbsp; &amp;nbsp;%put B=&amp;amp;b;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;%check;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Nov 2016 04:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-Questions-about-the-following-code-firstobs-and-one-macro/m-p/309459#M66570</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-05T04:28:07Z</dc:date>
    </item>
  </channel>
</rss>

