<?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 in yyyy-mm-dd format by using macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796117#M255430</link>
    <description>&lt;P&gt;No need to add the %SYSEVALF() if you are going to use the value with %SYSFUNC().&amp;nbsp; Unlike the %EVAL() macro function used for most macro code evaluations the SAS data step functions know how to interpret literals directly.&lt;/P&gt;
&lt;PRE&gt;238   %let start_date = '01Feb2022'd;
239   %let start = %sysfunc(putn(&amp;amp;start_date., yymmdd10.));
240   %put &amp;amp;=start_date &amp;amp;=start;
START_DATE='01Feb2022'd START=2022-02-01

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Feb 2022 19:31:13 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-02-14T19:31:13Z</dc:date>
    <item>
      <title>Date in yyyy-mm-dd format by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796110#M255427</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do need to change date in YYYY-MM-DD format by using the macro value.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%LET start_date = '01Feb2022'd;
%let start = (&amp;amp;start_date., yymmdd10.);
%put &amp;amp;start.;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;start should be 2022-02-01.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 18:58:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796110#M255427</guid>
      <dc:creator>dht115</dc:creator>
      <dc:date>2022-02-14T18:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Date in yyyy-mm-dd format by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796113#M255429</link>
      <description>&lt;P&gt;The macro processor needs additional instruction in order to work with dates. This is the %SYSEVALF function and the %SYSFUNC function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note for clarity, now and in the future: your title implies you are working with macros. You are not working with macros. You are working with macro variables, which is something different than a macro. Do not use "macro" to refer to "macro variables".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start_date = %sysevalf('01feb2022'd);
%let start = %sysfunc(putn(&amp;amp;start_date, yymmdd10.));
%put &amp;amp;=start;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 19:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796113#M255429</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-14T19:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Date in yyyy-mm-dd format by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796117#M255430</link>
      <description>&lt;P&gt;No need to add the %SYSEVALF() if you are going to use the value with %SYSFUNC().&amp;nbsp; Unlike the %EVAL() macro function used for most macro code evaluations the SAS data step functions know how to interpret literals directly.&lt;/P&gt;
&lt;PRE&gt;238   %let start_date = '01Feb2022'd;
239   %let start = %sysfunc(putn(&amp;amp;start_date., yymmdd10.));
240   %put &amp;amp;=start_date &amp;amp;=start;
START_DATE='01Feb2022'd START=2022-02-01

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 19:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796117#M255430</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-02-14T19:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Date in yyyy-mm-dd format by using macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796118#M255431</link>
      <description>&lt;P&gt;Starting day of month for current month in desired format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 SYMBOLGEN:  Macro variable _SASWSTEMP_ resolves to /home/fkhurshed/.sasstudio/.images/9a0e017f-022a-4352-9956-2f959c2997c7
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 SYMBOLGEN:  Macro variable GRAPHINIT resolves to GOPTIONS RESET=ALL GSFNAME=_GSFNAME;
 68         
&lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt; 69         %let start = %sysfunc(intnx(month, %sysfunc(today()), 0, b), yymmdd10.);&lt;/STRONG&gt;&lt;/FONT&gt;
 70         %put &amp;amp;start.;
 SYMBOLGEN:  Macro variable START resolves to 2022-02-01
&lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt; 2022-02-01&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 19:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-in-yyyy-mm-dd-format-by-using-macro/m-p/796118#M255431</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-14T19:29:23Z</dc:date>
    </item>
  </channel>
</rss>

