<?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 How do I conevert numeric date variable into consecutive numbers starting at 1 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-conevert-numeric-date-variable-into-consecutive-numbers/m-p/898885#M355285</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with 1 line per ID with one relevant date per ID.&lt;/P&gt;
&lt;P&gt;I have transformed the dates into numeric format using 'date_as_num = putn(date,'yymmddn8.');'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The date range is 1 January 2018 (i.e. 20180101) to 31 December 2020 (20201231).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I now need to convert these dates into consecutive numbers starting at 1 with 1 January 2018 being 1, 2 January being 2 and so forth.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using SAS version 9.4.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know how to do this. Can anyone help?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Julia&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 08:03:52 GMT</pubDate>
    <dc:creator>jspoend</dc:creator>
    <dc:date>2023-10-17T08:03:52Z</dc:date>
    <item>
      <title>How do I conevert numeric date variable into consecutive numbers starting at 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-conevert-numeric-date-variable-into-consecutive-numbers/m-p/898885#M355285</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with 1 line per ID with one relevant date per ID.&lt;/P&gt;
&lt;P&gt;I have transformed the dates into numeric format using 'date_as_num = putn(date,'yymmddn8.');'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The date range is 1 January 2018 (i.e. 20180101) to 31 December 2020 (20201231).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I now need to convert these dates into consecutive numbers starting at 1 with 1 January 2018 being 1, 2 January being 2 and so forth.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using SAS version 9.4.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know how to do this. Can anyone help?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Julia&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 08:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-conevert-numeric-date-variable-into-consecutive-numbers/m-p/898885#M355285</guid>
      <dc:creator>jspoend</dc:creator>
      <dc:date>2023-10-17T08:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I conevert numeric date variable into consecutive numbers starting at 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-conevert-numeric-date-variable-into-consecutive-numbers/m-p/898887#M355286</link>
      <description>The variable DATE is already on a sliding scale, increasing by 1 every day. To change the scale so it starts at 1 on January 1, 2018, use:&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;sliding_scale = date - '31dec2017'd;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;I would recommend studying up on how SAS handles dates.  Time well spent.</description>
      <pubDate>Tue, 17 Oct 2023 08:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-conevert-numeric-date-variable-into-consecutive-numbers/m-p/898887#M355286</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-10-17T08:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I conevert numeric date variable into consecutive numbers starting at 1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-conevert-numeric-date-variable-into-consecutive-numbers/m-p/898888#M355287</link>
      <description>&lt;P&gt;Thank you so much, this worked well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I totally agree, that understanding dates in SAS is worthwhile. I&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 08:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-conevert-numeric-date-variable-into-consecutive-numbers/m-p/898888#M355287</guid>
      <dc:creator>jspoend</dc:creator>
      <dc:date>2023-10-17T08:25:04Z</dc:date>
    </item>
  </channel>
</rss>

