<?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: Date from prompt's macro variable needs coverted to mmddyy10 format for report header in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Date-from-prompt-s-macro-variable-needs-coverted-to-mmddyy10/m-p/334432#M22236</link>
    <description>Thank You!</description>
    <pubDate>Mon, 20 Feb 2017 19:06:41 GMT</pubDate>
    <dc:creator>eg_michael</dc:creator>
    <dc:date>2017-02-20T19:06:41Z</dc:date>
    <item>
      <title>Date from prompt's macro variable needs coverted to mmddyy10 format for report header</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Date-from-prompt-s-macro-variable-needs-coverted-to-mmddyy10/m-p/334421#M22234</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Platform&lt;/STRONG&gt;: SAS EG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt; I have a macro variable (&lt;FONT face="Courier New" size="2"&gt;&amp;amp;PV_EndDate&lt;/FONT&gt;)&amp;nbsp;from a&amp;nbsp;date prompt that I display in a reaport header. The date is displayed as 31Dec2016, but I want it displayed as 12/31/2016. After much trial an error I cannot get it to work. Any Suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;_null_&lt;/FONT&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; &amp;amp;PV_EndDate; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New"&gt;/*&amp;nbsp;prints '31Dec2016' to log&amp;nbsp;*/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End_Date=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;"&amp;amp;PV_EndDate"d&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newDate = put(&amp;amp;&amp;amp;End_Date,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; newDate; &lt;FONT color="#008000"&gt;/* prints '12/31/2016' to log */&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT size="2"&gt;%Global&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; MV_EndDate;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; MV_EndDate = newDate;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; &amp;amp;MV_EndDate; &lt;FONT color="#008000"&gt;/*&amp;nbsp;prints 'newDate' to log&amp;nbsp;*/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="1"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;Header Code:&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="1"&gt;&amp;nbsp; TITLE3 "End Date: &amp;amp;MV_EndDate";&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 18:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Date-from-prompt-s-macro-variable-needs-coverted-to-mmddyy10/m-p/334421#M22234</guid>
      <dc:creator>eg_michael</dc:creator>
      <dc:date>2017-02-20T18:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Date from prompt's macro variable needs coverted to mmddyy10 format for report header</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Date-from-prompt-s-macro-variable-needs-coverted-to-mmddyy10/m-p/334426#M22235</link>
      <description>&lt;P&gt;You need to transfer the value of the data step variable into the macro variable.&lt;/P&gt;
&lt;P&gt;Do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symput('mv_enddate',mv_enddate);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the data step.&lt;/P&gt;
&lt;P&gt;%let is a macro statement and therefore executed when the code is gathered to be compiled for the data step. It can never access data step variables.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 18:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Date-from-prompt-s-macro-variable-needs-coverted-to-mmddyy10/m-p/334426#M22235</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-20T18:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Date from prompt's macro variable needs coverted to mmddyy10 format for report header</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Date-from-prompt-s-macro-variable-needs-coverted-to-mmddyy10/m-p/334432#M22236</link>
      <description>Thank You!</description>
      <pubDate>Mon, 20 Feb 2017 19:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Date-from-prompt-s-macro-variable-needs-coverted-to-mmddyy10/m-p/334432#M22236</guid>
      <dc:creator>eg_michael</dc:creator>
      <dc:date>2017-02-20T19:06:41Z</dc:date>
    </item>
  </channel>
</rss>

