<?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: do not calculate for the first id in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835598#M82094</link>
    <description>&lt;P&gt;Then you need the BY statement.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2022 13:43:29 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-09-28T13:43:29Z</dc:date>
    <item>
      <title>do not calculate for the first id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835592#M82091</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want the program not calculate flux and age if it is the first secid. I write this but it does not work. it still calculate for the first secid. What is wrong with this&amp;nbsp;&lt;CODE class=" language-sas"&gt;if first.secid then call missing(flux, age);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data ageyear;
 set inception;
Age = yrdif(Inception_date, sas_date,'Actual');
flux=(TNA-lag1(TNA)*(1+mret))/(lag1(TNA));
if first.secid then call missing(flux, age);

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835592#M82091</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2022-09-28T13:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: do not calculate for the first id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835593#M82092</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;FIRST.&lt;/FONT&gt; construct in a SAS data step requires a BY statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, it's not 100% clear to me what your requirement is ... do you mean first record in the data set, or first record of a block of SECID? If it is first record in the data set use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if _n_=1 then ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835593#M82092</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-28T13:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: do not calculate for the first id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835594#M82093</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I need to put the&amp;nbsp; first record of a block of SECID to missing value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835594#M82093</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2022-09-28T13:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: do not calculate for the first id</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835598#M82094</link>
      <description>&lt;P&gt;Then you need the BY statement.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/do-not-calculate-for-the-first-id/m-p/835598#M82094</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-28T13:43:29Z</dc:date>
    </item>
  </channel>
</rss>

