<?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: Time Stamp conversion from character to numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761703#M241057</link>
    <description>&lt;P&gt;thank you for reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So will I have to inclued all timestamps in datalines? I have 53000 timestamps. Will I include all of them in the datalines?&lt;/P&gt;</description>
    <pubDate>Sun, 15 Aug 2021 20:57:14 GMT</pubDate>
    <dc:creator>OzanKirtac</dc:creator>
    <dc:date>2021-08-15T20:57:14Z</dc:date>
    <item>
      <title>Time Stamp conversion from character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761701#M241055</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to transform character imported timestamp variable to numeric timestamp variable so that I can change and play around with the variable. When I try to use input function, I keep getting errors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The original timestap looks like the one below and I want to convert it to a format .&lt;/P&gt;&lt;P&gt;I run this code&lt;/P&gt;&lt;P&gt;data Z11; set Z10;&lt;BR /&gt;datadate = input(TIMESTAMP_UTC,8.);&lt;BR /&gt;format datadate YYMMDDN8.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;then I keep getting errors:NOTE: Invalid argument to function INPUT at line 1015 column 12&lt;/P&gt;&lt;P&gt;All help is appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_2.png" style="width: 308px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62612i2D5E74F8D1929B8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_2.png" alt="Screenshot_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 20:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761701#M241055</guid>
      <dc:creator>OzanKirtac</dc:creator>
      <dc:date>2021-08-15T20:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Time Stamp conversion from character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761702#M241056</link>
      <description>&lt;P&gt;Try this. I specified an INFORMAT to read in the date as numeric, and then I converted it to your desired FORMAT (yymmddn8).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input timestamp_utc $23.;
datalines;
2010-01-01 03:30:53.85
;
run;

data want;
	set have;
		datadate_nofmt = input(timestamp_utc, yymmdd10.);
		datadate = put(input(timestamp_utc, yymmdd10.), yymmddn8.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;timestamp_utc 	                datadate_nofmt 	datadate
2010-01-01 03:30:53.85 	        18263 	        20100101&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 20:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761702#M241056</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-08-15T20:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Time Stamp conversion from character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761703#M241057</link>
      <description>&lt;P&gt;thank you for reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So will I have to inclued all timestamps in datalines? I have 53000 timestamps. Will I include all of them in the datalines?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 20:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761703#M241057</guid>
      <dc:creator>OzanKirtac</dc:creator>
      <dc:date>2021-08-15T20:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Time Stamp conversion from character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761705#M241058</link>
      <description>&lt;P&gt;No, you don't have to do the DATALINES statement. That was done for me to reproduce your issue and test whether my solution works. Just run the second chunk of code I provided:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
		datadate_nofmt = input(timestamp_utc, yymmdd10.);
		datadate = put(input(timestamp_utc, yymmdd10.), yymmddn8.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;You don't even have to do the 'datadate_nofmt' part. That was done just to show you what's going on.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 21:04:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761705#M241058</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-08-15T21:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Time Stamp conversion from character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761706#M241059</link>
      <description>&lt;P&gt;thank you! cheers!&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 21:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Time-Stamp-conversion-from-character-to-numeric/m-p/761706#M241059</guid>
      <dc:creator>OzanKirtac</dc:creator>
      <dc:date>2021-08-15T21:07:01Z</dc:date>
    </item>
  </channel>
</rss>

