<?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: Keep formated DATETIME in a macrovariable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keep-formated-DATETIME-in-a-macrovariable/m-p/560058#M156506</link>
    <description>&lt;P&gt;One way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _null_;
now = datetime();
format now e8601dt19.;
call symputx('now', put(now, e8601dt19.));
put now=;
run;

%put &amp;amp;now.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 May 2019 09:47:39 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-05-20T09:47:39Z</dc:date>
    <item>
      <title>Keep formated DATETIME in a macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-formated-DATETIME-in-a-macrovariable/m-p/560057#M156505</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have formated a DATETIME:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _null_;
now = datetime();
format now e8601dt19.;
put now=;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I would like to store the formatted date time in a macrovariable as text such that when &amp;nbsp;I call the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put &amp;amp;DATETIME;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;2019-05-20T12:23:04;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Do you have any idea about how to do that ?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 09:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-formated-DATETIME-in-a-macrovariable/m-p/560057#M156505</guid>
      <dc:creator>Hugo_B</dc:creator>
      <dc:date>2019-05-20T09:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Keep formated DATETIME in a macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-formated-DATETIME-in-a-macrovariable/m-p/560058#M156506</link>
      <description>&lt;P&gt;One way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _null_;
now = datetime();
format now e8601dt19.;
call symputx('now', put(now, e8601dt19.));
put now=;
run;

%put &amp;amp;now.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 May 2019 09:47:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-formated-DATETIME-in-a-macrovariable/m-p/560058#M156506</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-20T09:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Keep formated DATETIME in a macrovariable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-formated-DATETIME-in-a-macrovariable/m-p/560066#M156513</link>
      <description>&lt;P&gt;If you want to keep track of the current time at certain points in your log, this is probably the most efficient way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysfunc(datetime(),e8601dt19.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 May 2019 10:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-formated-DATETIME-in-a-macrovariable/m-p/560066#M156513</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-20T10:03:49Z</dc:date>
    </item>
  </channel>
</rss>

