<?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: Transforming date format inside a macro statement? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90707#M917</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might be better to use TODAY() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; foldername=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(today(),yymon.);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; &amp;amp;foldername;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Oct 2012 10:37:56 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2012-10-10T10:37:56Z</dc:date>
    <item>
      <title>Transforming date format inside a macro statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90705#M915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the macro below, &amp;amp;sysdate appears in the format DATEw. (10OCT12).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;%let foldername= &amp;amp;sysdate.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I make it appear in the format YYMON. (2012-OCT) instead, inside the macro statement (which is used in the precode of a DI Studio job)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your time. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 07:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90705#M915</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2012-10-10T07:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date format inside a macro statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90706#M916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YYMON. returns in my environemt 2012OCT without a dash. But that's for a foldername may be even better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let foldername=%sysfunc(inputn(&amp;amp;sysdate,date9.),yymon.);&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 08:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90706#M916</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-10-10T08:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date format inside a macro statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90707#M917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might be better to use TODAY() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; foldername=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(today(),yymon.);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; &amp;amp;foldername;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2012 10:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90707#M917</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-10-10T10:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date format inside a macro statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90708#M918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why? Are you having these week-long EG sessions in mind or do you have another reason for this statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 12:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90708#M918</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-10-11T12:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Transforming date format inside a macro statement?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90709#M919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Einar&lt;/P&gt;&lt;P&gt;Based on what I assume data_null had in mind the following for you to consider:&lt;/P&gt;&lt;P&gt;You are developing DI jobs which normally are run overnight in batch. What happens if your job runs over midnight at a month end. Which foldername should the job generate?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using &amp;amp;sysdate then the date will be used when the job started, today() will give you the date when you call it in the job. Still: both might be wrong. There could be some downtime and your job starts after midnight - or even a day later because the server was really down and you need to run catch-up runs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to avoid all these problems is to base all such date based name generation not on the calendar date but on the date of your data and you normally know from which date your data is.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 12:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Transforming-date-format-inside-a-macro-statement/m-p/90709#M919</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-10-11T12:12:11Z</dc:date>
    </item>
  </channel>
</rss>

