<?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 Concatenate timestamp in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557722#M10025</link>
    <description>&lt;P&gt;In one of my date variable the value stores as&amp;nbsp;'09MAY2019:14:51:51.000000'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to concatenate additional time format characters in this timestamp because I need to change it to another timestamp format in my sql pass through query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So how can I resolve the the above mentioned timestamp into another variable to&lt;/P&gt;&lt;P&gt;to_timestamp('09MAY2019:14:51:51', 'DDMONYYYY:HH24:MI:SS')&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above mentioned statement should be stored in another variable.&lt;/P&gt;&lt;P&gt;For example...09MAY2019:14:51:51 is one timestamp value. There are different timestamp values&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2019 10:36:35 GMT</pubDate>
    <dc:creator>ssaha</dc:creator>
    <dc:date>2019-05-10T10:36:35Z</dc:date>
    <item>
      <title>Concatenate timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557722#M10025</link>
      <description>&lt;P&gt;In one of my date variable the value stores as&amp;nbsp;'09MAY2019:14:51:51.000000'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to concatenate additional time format characters in this timestamp because I need to change it to another timestamp format in my sql pass through query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So how can I resolve the the above mentioned timestamp into another variable to&lt;/P&gt;&lt;P&gt;to_timestamp('09MAY2019:14:51:51', 'DDMONYYYY:HH24:MI:SS')&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above mentioned statement should be stored in another variable.&lt;/P&gt;&lt;P&gt;For example...09MAY2019:14:51:51 is one timestamp value. There are different timestamp values&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 10:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557722#M10025</guid>
      <dc:creator>ssaha</dc:creator>
      <dc:date>2019-05-10T10:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557723#M10026</link>
      <description>&lt;P&gt;If you table is in a external database, and you wish to perform an explict pass-through step for this, I can't see that SAS has anything to do with it.&lt;/P&gt;
&lt;P&gt;You should redirect your query to a forum specific for your DBMS.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 10:46:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557723#M10026</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2019-05-10T10:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557732#M10029</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I can do it from sas side. I just need to resolve this value&amp;nbsp;&lt;SPAN&gt;'09MAY2019:14:51:51.000000'&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to&amp;nbsp; &amp;nbsp; &amp;nbsp;to_timestamp('09MAY2019:14:51:51', 'DDMONYYYY:HH24:MI&lt;IMG src="https://communities.sas.com/i/smilies/16x16_smiley-frustrated.png" border="0" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;S')&amp;nbsp; and store it in another variable. With the help of concatenation I will able to do it but not getting a proper way on how to implement it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 11:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557732#M10029</guid>
      <dc:creator>ssaha</dc:creator>
      <dc:date>2019-05-10T11:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557785#M10032</link>
      <description>&lt;P&gt;PLEASE show an exact representation of the single string that you need. I can not tell whether you need concatenation or format or what.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also be aware that apparently some of you code has been transformed into an emogi, so that doesn't help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your current value is in a SAS datetime value then likely you need something like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newvar = put(timestamp, datetime18.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but without seeing the exact string that you need...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try pasting/ typing into a code box opened using the forums {I} or "running man" icons to reduce the chance of an emogi.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 14:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557785#M10032</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-10T14:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557801#M10036</link>
      <description>&lt;P&gt;It is probably easier to upload the data as a dataset (or what SQL terminology would call a table) rather than trying to put literal values into code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you have one value then perhaps you can place it into a macro variable?&amp;nbsp; Something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set mydata ;
  where id=12345;
  call symputx('mytimestamp',quote(strip(put(mydatetimeVar,datetime20.)),"'"));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And then you can use that in your passthru SQL code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;to_timestamp(&amp;amp;mytimestamp, 'DDMONYYYY:HH24:MI:SS')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 14:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557801#M10036</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-10T14:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate timestamp</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557890#M10050</link>
      <description>&lt;P&gt;Can you show actual examples of the data you have in SAS.&amp;nbsp; In the form of a data step to create a dataset (or if you really don't know SAS then perhaps in the form of SQL create and insert statements that work in SAS).&amp;nbsp; That way we know how your variable is really defined and have concrete examples of values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then show what code you need to create from this data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember to use the Insert Code or Insert SAS Code buttons in the editor tool bar to get a pop-up window to paste/type/edit your code so that the forum editor doesn't try to turn it into paragraphs and emojis.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 17:09:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concatenate-timestamp/m-p/557890#M10050</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-10T17:09:48Z</dc:date>
    </item>
  </channel>
</rss>

