<?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: Find business day of the last month in datetime format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516651#M139565</link>
    <description>&lt;P&gt;Enclose the macro variable in double quote :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('datdt_m', put(dhms("&amp;amp;datdt"d,0,0,0),datetime.));
run;

%put &amp;amp;=datdt_m;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 28 Nov 2018 13:19:35 GMT</pubDate>
    <dc:creator>r_behata</dc:creator>
    <dc:date>2018-11-28T13:19:35Z</dc:date>
    <item>
      <title>Find business day of the last month in datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516645#M139562</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to build a new variable based on a new existing macro variable &amp;amp;simuldate how has a format date9.&lt;/P&gt;&lt;P&gt;The new variable should be the business day of the last month and has a datetime format .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried the code below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('datdt',put(intnx('WEEKDAY', intnx('MONTH', &amp;amp;simuldate, -1, 'END'), 0),DATE9.));
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;this works&lt;BR /&gt;&lt;BR /&gt;But when tried to convert the date in datetime format:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('datdt_m', put(dhms('&amp;amp;datdt'D,0,0,0),datetime.));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I got&lt;BR /&gt;ERROR: Invalid date/time/datetime constant '&amp;amp;datdt'D.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;can anyone help.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;Nihal&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 13:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516645#M139562</guid>
      <dc:creator>Nihal</dc:creator>
      <dc:date>2018-11-28T13:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Find business day of the last month in datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516651#M139565</link>
      <description>&lt;P&gt;Enclose the macro variable in double quote :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('datdt_m', put(dhms("&amp;amp;datdt"d,0,0,0),datetime.));
run;

%put &amp;amp;=datdt_m;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2018 13:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516651#M139565</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-11-28T13:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find business day of the last month in datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516673#M139578</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro variables enclosed in single quotes will not be resolved. You have to always use double quotes only.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516673#M139578</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-11-28T14:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find business day of the last month in datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516770#M139609</link>
      <description>&lt;P&gt;Thank you r_behata its works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can the 2 "data _null_ " merged on one step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 16:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516770#M139609</guid>
      <dc:creator>Nihal</dc:creator>
      <dc:date>2018-11-28T16:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find business day of the last month in datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516786#M139613</link>
      <description>&lt;P&gt;Hope this helps :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
	datdt=intnx('WEEKDAY', intnx('MONTH', &amp;amp;simuldate, -1, 'END'), 0);
	call symputx('datdt_m', put(dhms(datdt,0,0,0),datetime.));
run;

%put &amp;amp;=datdt_m;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2018 16:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-business-day-of-the-last-month-in-datetime-format/m-p/516786#M139613</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-11-28T16:37:11Z</dc:date>
    </item>
  </channel>
</rss>

