<?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: Marco to generate last day of prior month in static format in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Marco-to-generate-last-day-of-prior-month-in-static-format/m-p/563915#M10958</link>
    <description>Yep, that worked. Thank you so much!</description>
    <pubDate>Wed, 05 Jun 2019 22:45:41 GMT</pubDate>
    <dc:creator>Yozshura</dc:creator>
    <dc:date>2019-06-05T22:45:41Z</dc:date>
    <item>
      <title>Marco to generate last day of prior month in static format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Marco-to-generate-last-day-of-prior-month-in-static-format/m-p/563911#M10955</link>
      <description>&lt;P&gt;I've created the following variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let mnth_strt_date_d = %sysfunc(putn(%sysfunc(intnx(month, %sysfunc(today()), -1, B )), date9.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use mnth_strt_date_d as a date filter for a SAS table, but in order to so I need the value to be '01MAY19'd.&amp;nbsp; Right now it is coming back as 01MAY19.&amp;nbsp; How can I add the single quotes and d to mnth_strt_date_d?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 22:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Marco-to-generate-last-day-of-prior-month-in-static-format/m-p/563911#M10955</guid>
      <dc:creator>Yozshura</dc:creator>
      <dc:date>2019-06-05T22:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Marco to generate last day of prior month in static format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Marco-to-generate-last-day-of-prior-month-in-static-format/m-p/563912#M10956</link>
      <description>&lt;P&gt;You likely don't.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you remove the date9 format, it will likely work with your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mnth_strt_date_d = %sysfunc(intnx(month, %sysfunc(today()), -1, B ));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You also don't need PUT here, the second parameter for the SYSFUNC() is the format you'd like applied to the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really do think you need it, I'd actually put in the code to resolve correctly, this way the macro variable is more versatile.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So change wherever you're using the macro variable to the following, note the usage of double quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"&amp;amp;mnth_strt_date_d."d&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276851"&gt;@Yozshura&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I've created the following variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let mnth_strt_date_d = %sysfunc(putn(%sysfunc(intnx(month, %sysfunc(today()), -1, B )), date9.));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to use mnth_strt_date_d as a date filter for a SAS table, but in order to so I need the value to be '01MAY19'd.&amp;nbsp; Right now it is coming back as 01MAY19.&amp;nbsp; How can I add the single quotes and d to mnth_strt_date_d?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 22:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Marco-to-generate-last-day-of-prior-month-in-static-format/m-p/563912#M10956</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-05T22:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Marco to generate last day of prior month in static format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Marco-to-generate-last-day-of-prior-month-in-static-format/m-p/563915#M10958</link>
      <description>Yep, that worked. Thank you so much!</description>
      <pubDate>Wed, 05 Jun 2019 22:45:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Marco-to-generate-last-day-of-prior-month-in-static-format/m-p/563915#M10958</guid>
      <dc:creator>Yozshura</dc:creator>
      <dc:date>2019-06-05T22:45:41Z</dc:date>
    </item>
  </channel>
</rss>

