<?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: How covert character date: 2015-11 to SAS number in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927380#M364979</link>
    <description>&lt;P&gt;Note that SAS has new functions for concatenating strings. even newer than the relatively new STRIP() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Date_Num = input(cats(Date_Char,'-01'), yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 May 2024 02:14:43 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-05-08T02:14:43Z</dc:date>
    <item>
      <title>How covert character date: 2015-11 to SAS number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927365#M364972</link>
      <description>&lt;P&gt;I have a data set, the month variable:month is CHAR7. So there is only year and month, ,shown as this format&lt;/P&gt;&lt;P&gt;2015-11&lt;/P&gt;&lt;P&gt;2015-12&lt;/P&gt;&lt;P&gt;I need to change them into NOV2015, DEC2015. So firstly i need change it into SAS .&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;date=input(month, date7.) or other time formate, but it doesnt work.&lt;/P&gt;&lt;P&gt;As i need use conditional statement, so i dont want to separate them into year and month into to column, i hope they still stay in the same column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 23:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927365#M364972</guid>
      <dc:creator>lindamtl</dc:creator>
      <dc:date>2024-05-07T23:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: How covert character date: 2015-11 to SAS number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927368#M364973</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;28         data want;
29           Date_Char = '2015-11';
30           Date_Num = input(strip(Date_Char) !! '-01', yymmdd10.);
31           format Date_Num date9.;
32           put _all_;
33         run;

Date_Char=2015-11 Date_Num=01NOV2015 _ERROR_=0 _N_=1
NOTE: The data set WORK.WANT has 1 observations and 2 variables.
NOTE: Compressing data set WORK.WANT increased size by 100.00 percent. 
      Compressed is 2 pages; un-compressed would require 1 pages.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 May 2024 23:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927368#M364973</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-05-07T23:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: How covert character date: 2015-11 to SAS number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927369#M364974</link>
      <description>&lt;P&gt;it works. i added a format, so it output as NOV2015. thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test1;&lt;BR /&gt;set aa (keep=month);&lt;BR /&gt;date=input(strip(month)!!'-1', yymmdd10.);&lt;BR /&gt;format date monyy7.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 23:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927369#M364974</guid>
      <dc:creator>lindamtl</dc:creator>
      <dc:date>2024-05-07T23:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: How covert character date: 2015-11 to SAS number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927380#M364979</link>
      <description>&lt;P&gt;Note that SAS has new functions for concatenating strings. even newer than the relatively new STRIP() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Date_Num = input(cats(Date_Char,'-01'), yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 May 2024 02:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927380#M364979</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-08T02:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: How covert character date: 2015-11 to SAS number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927382#M364980</link>
      <description>&lt;P&gt;yes, it works, i also tried. thank you~&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 02:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-covert-character-date-2015-11-to-SAS-number/m-p/927382#M364980</guid>
      <dc:creator>lindamtl</dc:creator>
      <dc:date>2024-05-08T02:23:23Z</dc:date>
    </item>
  </channel>
</rss>

