<?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: intnx in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343711#M63421</link>
    <description>&lt;P&gt;You need to assign the format you want to variable date when you create it in the data set. This has nothing to do with INTNX&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2017 13:57:52 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2017-03-23T13:57:52Z</dc:date>
    <item>
      <title>intnx</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343708#M63420</link>
      <description>&lt;P&gt;I use intnx function but it give date format diffirent from I want&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data firstandlastdates;
     set crsp.msf(keep=permno date);
     by permno; /*MSF is always sorted by permno date*/
     retain firstdate;
     date=intnx('month', date, 1)-1;
     if first.permno then firstdate=date;
     if last.permno then do;
         lastdate=date;
	 output;
     end;
  run;
  
  data permnosrankdates(rename=(date=rankdate));
      set firstandlastdates;
      date=firstdate;
      do while(date&amp;lt;=lastdate);
         output;
	 date=intnx('month', date+1, 1)-1;
      end;
  run;&lt;/PRE&gt;
&lt;PRE&gt; data permnosrankdates;
     set permnosrankdates;
     date=rankdate;
     i=1;
     do while(i&amp;lt;=24);
         output;
         date=intnx('month', date, 0)-1;
	 i=i+1;
     end;
  run;&lt;/PRE&gt;
&lt;P&gt;the result that I want&lt;/P&gt;
&lt;PRE&gt;Obs      PERMNO    rankdate         date     i

                  1       10000    19851231    19851231     1
                  2       10000    19851231    19851130     2
                  3       10000    19851231    19851030     3
                  4       10000    19851231    19850930    4
                  5       10000    19851231    19850831     5
                 ......&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;the result i GOT&lt;/P&gt;
&lt;PRE&gt;                 Obs      PERMNO    rankdate         date     i

                  1       10000    19851231    1986           1
                  2       10000    19851231    8476           2
                  3       10000    19851231    2356           3
                  4       10000    19851231                   4
                  5       10000    19851231                   5
                 &lt;/PRE&gt;
&lt;P&gt;So I want to good date format YYMMDDN8.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 13:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343708#M63420</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2017-03-23T13:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: intnx</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343711#M63421</link>
      <description>&lt;P&gt;You need to assign the format you want to variable date when you create it in the data set. This has nothing to do with INTNX&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 13:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343711#M63421</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-03-23T13:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: intnx</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343716#M63422</link>
      <description>&lt;P&gt;How to do it please&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343716#M63422</guid>
      <dc:creator>sasphd</dc:creator>
      <dc:date>2017-03-23T14:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: intnx</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343720#M63423</link>
      <description>&lt;P&gt;Use the &lt;A href="https://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n0d5oq7e0oia0wn13nsins0x8nmh.htm" target="_blank"&gt;format&lt;/A&gt; statement.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:20:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343720#M63423</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-23T14:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: intnx</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343722#M63424</link>
      <description>&lt;PRE&gt;format date yymmddn8.;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:23:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/intnx/m-p/343722#M63424</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-03-23T14:23:59Z</dc:date>
    </item>
  </channel>
</rss>

