<?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: change format of &amp;sysdate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49694#M10356</link>
    <description>I just noticed the OP is using a DATA step, so it's not necessary to use the character-string for &amp;amp;SYSDATE or &amp;amp;SYSDATE9 -- you can get the current date using one of several techniques, such as TODAY() function or a RETAIN SAS variable assigned to a constant "&amp;amp;SYSDATE9"D, and the use your DATA step variable to assign a date character-string in whatever format you choose, using a SAS output FORMAT.  Given the code initially posted, no %SYSFUNC(...) is even needed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Thu, 15 Jul 2010 15:58:30 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-07-15T15:58:30Z</dc:date>
    <item>
      <title>change format of &amp;sysdate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49691#M10353</link>
      <description>Hi,&lt;BR /&gt;
How do I change the format of &amp;amp;sysdate from 14JUL10 to July 14, 2010 in the code below?&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
dcl odsout obj();&lt;BR /&gt;
obj.table_start(name: "Date",&lt;BR /&gt;
obj.row_start();&lt;BR /&gt;
obj.format_cell(data: "Data updated &amp;amp;sysdate.",&lt;BR /&gt;
obj.row_end();&lt;BR /&gt;
&lt;BR /&gt;
Thank you.</description>
      <pubDate>Wed, 14 Jul 2010 18:15:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49691#M10353</guid>
      <dc:creator>gzr2mz39</dc:creator>
      <dc:date>2010-07-14T18:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: change format of &amp;sysdate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49692#M10354</link>
      <description>Create your own &amp;amp;MY_SYSDATE by using the &amp;amp;SYSDATE9 variable, converted to a SAS NUMERIC DATE, using INPUT, and follow that with a suitable PUT to re-format to your own date-variable value.  Explore using %SYSFUNC(...) along with suitable SAS functions to do the data conversions, mentioned above.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 14 Jul 2010 18:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49692#M10354</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-14T18:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: change format of &amp;sysdate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49693#M10355</link>
      <description>&amp;gt; Create your own &amp;amp;MY_SYSDATE by using the &amp;amp;SYSDATE9&lt;BR /&gt;
&amp;gt; variable, converted to a SAS NUMERIC DATE, using&lt;BR /&gt;
&amp;gt; INPUT, and follow that with a suitable PUT to&lt;BR /&gt;
&amp;gt; re-format to your own date-variable value.  Explore&lt;BR /&gt;
&amp;gt; using %SYSFUNC(...) along with suitable SAS functions&lt;BR /&gt;
&amp;gt; to do the data conversions, mentioned above.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Scott Barry&lt;BR /&gt;
&amp;gt; SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
gzr2mz39 &lt;BR /&gt;
&lt;BR /&gt;
As Scott suggests - use %sysfunc()&lt;BR /&gt;
&lt;BR /&gt;
The common route to reformat dates, uses the second parameter of %sysfunc() - a format for the results when the first parameter is a numeric function {like inputN() }&lt;BR /&gt;
&lt;BR /&gt;
"Today" is much easier, than yesterday, which I would format like&lt;BR /&gt;
%put yesterday was %sysfunc( intnx(day, "&amp;amp;sysdate9"d, -1), weekdate )  ;&lt;BR /&gt;
 &lt;BR /&gt;
The simpler equivalent for today (needing no intnx() function )&lt;BR /&gt;
%put today is %sysfunc( putN("&amp;amp;sysdate9"d, weekdate ) ) ;&lt;BR /&gt;
Alternatively, when using a SAS server which may have started before today (SAS session start time provides the underlying value in &amp;amp;sysdate and &amp;amp;sysdate9), use the today() function like&lt;BR /&gt;
%put today is %sysfunc( today(), weekdate )  ;&lt;BR /&gt;
 &lt;BR /&gt;
When presenting timestamps, I like the SAS Title style :&lt;BR /&gt;
%put now it is %sysfunc( datetime(), twmdy )  ;</description>
      <pubDate>Thu, 15 Jul 2010 15:48:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49693#M10355</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-07-15T15:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: change format of &amp;sysdate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49694#M10356</link>
      <description>I just noticed the OP is using a DATA step, so it's not necessary to use the character-string for &amp;amp;SYSDATE or &amp;amp;SYSDATE9 -- you can get the current date using one of several techniques, such as TODAY() function or a RETAIN SAS variable assigned to a constant "&amp;amp;SYSDATE9"D, and the use your DATA step variable to assign a date character-string in whatever format you choose, using a SAS output FORMAT.  Given the code initially posted, no %SYSFUNC(...) is even needed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 15 Jul 2010 15:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-format-of-sysdate/m-p/49694#M10356</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-15T15:58:30Z</dc:date>
    </item>
  </channel>
</rss>

