<?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 Change a character to time variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-a-character-to-time-variable/m-p/271977#M54103</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a character variabel "date" in a data set "test" where they are given as&lt;/P&gt;
&lt;P&gt;201212&lt;/P&gt;
&lt;P&gt;201312&lt;/P&gt;
&lt;P&gt;osv.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like a time variabel so 201212 becomes 12/31/12. How can this be done?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&amp;nbsp;Søren&lt;/P&gt;</description>
    <pubDate>Fri, 20 May 2016 13:46:58 GMT</pubDate>
    <dc:creator>schwartz</dc:creator>
    <dc:date>2016-05-20T13:46:58Z</dc:date>
    <item>
      <title>Change a character to time variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-a-character-to-time-variable/m-p/271977#M54103</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a character variabel "date" in a data set "test" where they are given as&lt;/P&gt;
&lt;P&gt;201212&lt;/P&gt;
&lt;P&gt;201312&lt;/P&gt;
&lt;P&gt;osv.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like a time variabel so 201212 becomes 12/31/12. How can this be done?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&amp;nbsp;Søren&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 13:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-a-character-to-time-variable/m-p/271977#M54103</guid>
      <dc:creator>schwartz</dc:creator>
      <dc:date>2016-05-20T13:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change a character to time variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-a-character-to-time-variable/m-p/271983#M54106</link>
      <description>&lt;P&gt;You have a charater field which represents part of a date. &amp;nbsp;You want a numeric value which is the SAS interpretation of the date. &amp;nbsp;You don't say what the default is on Day however, given that you put 31 in the example, I assume you want the last day of the month, so you would combine with a intnx:&lt;/P&gt;
&lt;PRE&gt;data want;
  str_date="201212";
  num_date=intnx("month",input(cats(str_date,"01"),yymmdd10.),1)-1;
  format num_date date9.;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2016 13:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-a-character-to-time-variable/m-p/271983#M54106</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-05-20T13:58:11Z</dc:date>
    </item>
  </channel>
</rss>

