<?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: help on datetime macro please in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174172#M13372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you execute the Proc Format code first?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jul 2014 08:45:04 GMT</pubDate>
    <dc:creator>Scott_Mitchell</dc:creator>
    <dc:date>2014-07-10T08:45:04Z</dc:date>
    <item>
      <title>help on datetime macro please</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174168#M13368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to set up filename ending with datetime as below on daily report...please help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename xyz_abc_20140710112330.txt&lt;/P&gt;&lt;P&gt;/*filename xyz_abc_yyyymmddhhmmss.txt*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 07:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174168#M13368</guid>
      <dc:creator>jimksas</dc:creator>
      <dc:date>2014-07-10T07:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: help on datetime macro please</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174169#M13369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a custom format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC FORMAT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PICTURE YMDDT OTHER='%0Y%0M%0D%0H%0M%0S' (DATATYPE=DATETIME);&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create macro variable containing the date and time of right now and use custom format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;CALL SYMPUTX ("FNAME","XYZ_ABC_"||TRIM(LEFT(PUT(DATETIME(),YMDDT.))));&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%PUT &amp;amp;FNAME.;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 07:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174169#M13369</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-07-10T07:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: help on datetime macro please</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174170#M13370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;YMDDT.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;is giving error...format cannot ound and could not be loaded...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;i am trying create macro for only datetime function not with filename, so i can write down like this....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;filename xyz_abc_&amp;amp;fname.txt&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 08:09:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174170#M13370</guid>
      <dc:creator>jimksas</dc:creator>
      <dc:date>2014-07-10T08:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: help on datetime macro please</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174171#M13371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What does it say in the log with options mlogic sybolgen mprint.&amp;nbsp; I would imagine that you would at least need in the filename statement %trim(&amp;amp;fname) to avoid extra spaces.&amp;nbsp; Personally I wouldn't go with formats, but it depends on where you are getting the date and time from, is it today() function, a dataset etc.&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('FNAME',compress(put(today(),yymmdd10.),"- ")||compress(put(time(),time8.),": "));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%put xyz_abc_&amp;amp;fname.;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 08:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174171#M13371</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-10T08:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: help on datetime macro please</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174172#M13372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you execute the Proc Format code first?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 08:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174172#M13372</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-07-10T08:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: help on datetime macro please</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174173#M13373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;now=datetime();&lt;/P&gt;&lt;P&gt;dat1=datepart(now);tim1=put(timepart(now),time8.);&lt;/P&gt;&lt;P&gt;filname='xyz_abc'!!put(dat1,yymmddn8.)!!substr(tim1,1,2)!!substr(tim1,4,2)!!substr(tim1,7,2)!!'.txt';&lt;/P&gt;&lt;P&gt;call symput('filnam',filname);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename outfile "/&lt;EM&gt;path_to_the_directory&lt;/EM&gt;/&amp;amp;filnam";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 08:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174173#M13373</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-07-10T08:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: help on datetime macro please</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174174#M13374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would just use B8601DT. format.&amp;nbsp; If you really do not want the T between the date and time parts you could use COMPRESS() function to remove it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let dt=%sysfunc(datetime(),B8601DT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%put dt=&amp;amp;dt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;dt=20140710T083935&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let filename=xyz_abc_%sysfunc(compress(&amp;amp;dt,T)).txt ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%put filename=&amp;amp;filename ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;filename=xyz_abc_20140710083935.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can now use anywhere a physical filename is required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'courier new', courier;"&gt;filename outfile "&amp;amp;filename" ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'courier new', courier;"&gt;file "&amp;amp;filename" ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 12:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174174#M13374</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-10T12:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: help on datetime macro please</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174175#M13375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Scott, i didn't run it &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&amp;nbsp; ...may be that's why...- Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all for your detail...many ways to do it... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using RW9 solution...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 15:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/help-on-datetime-macro-please/m-p/174175#M13375</guid>
      <dc:creator>jimksas</dc:creator>
      <dc:date>2014-07-10T15:26:53Z</dc:date>
    </item>
  </channel>
</rss>

