<?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 to transform string value into timestamp data format? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-transform-string-value-into-timestamp-data-format/m-p/797615#M313577</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;how to transform this string value into a timestamp format like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;dd.mm.yyyy hh:mm&lt;/EM&gt;?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;17.02.22  08:06&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is not working:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;format BEGINN_TMP DATETIME19.;
BEGINN_TMP = input(BEGINN, DATETIME19.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Feb 2022 16:38:17 GMT</pubDate>
    <dc:creator>Hansmuffs</dc:creator>
    <dc:date>2022-02-21T16:38:17Z</dc:date>
    <item>
      <title>How to transform string value into timestamp data format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transform-string-value-into-timestamp-data-format/m-p/797615#M313577</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;how to transform this string value into a timestamp format like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;dd.mm.yyyy hh:mm&lt;/EM&gt;?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;17.02.22  08:06&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is not working:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;format BEGINN_TMP DATETIME19.;
BEGINN_TMP = input(BEGINN, DATETIME19.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Feb 2022 16:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transform-string-value-into-timestamp-data-format/m-p/797615#M313577</guid>
      <dc:creator>Hansmuffs</dc:creator>
      <dc:date>2022-02-21T16:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform string value into timestamp data format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transform-string-value-into-timestamp-data-format/m-p/797644#M313599</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/305587"&gt;@Hansmuffs&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the usual German locale&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options locale=DE_DE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;this works:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
string='17.02.22  08:06';
run;

data want;
set have;
dt=input(string, nldatm.);
format dt nldatms14.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;except&lt;/STRONG&gt; for the year 2000 (!).&lt;/U&gt; So, better use 4-digit years, as we've learned end of last century.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Documentation of the surprising Y2K issue of the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/nlsref/n1q5hrj5lwe5e1n1xymum8nvqznl.htm" target="_blank" rel="noopener"&gt;NLDATM&lt;EM&gt;w&lt;/EM&gt;. informat&lt;/A&gt;&amp;nbsp;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
input dt nldatm.;
put dt nldatms14.;
cards;
17.02.98 08:06
17.02.99 08:06
17.02.00 08:06
17.02.01 08:06
17.02.02 08:06
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log (Windows SAS 9.4M5 with locale DE_DE and YEARCUTOFF=1926)&lt;FONT face="helvetica"&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;753   data _null_;
754   input dt nldatm.;
755   put dt nldatms14.;
756   cards;

17.02.98 08:06
17.02.99 08:06
NOTE: Invalid data for dt in line 759 1-19.
             .
RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
759         17.02.00 08:06
dt=. _ERROR_=1 _N_=3
17.02.01 08:06
17.02.02 08:06
NOTE: DATA statement used (Total process time):&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Feb 2022 19:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transform-string-value-into-timestamp-data-format/m-p/797644#M313599</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-02-21T19:25:33Z</dc:date>
    </item>
  </channel>
</rss>

