<?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 Date informat assistance in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747140#M234451</link>
    <description>&lt;PRE&gt;%let mydate = %sysfunc(putn(%sysfunc(intnx(day, %sysfunc(today()), -1, end)), 
yymmddd8.));
%put &amp;amp;mydate;/*SYMBOLGEN:  Macro variable MYDATE resolves to 21-06-09*/

&lt;/PRE&gt;
&lt;P&gt;However I want this output 2020-06-09 or what ever the date is&lt;BR /&gt;I tried yyymmdd10 with no result&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jun 2021 16:55:41 GMT</pubDate>
    <dc:creator>Q1983</dc:creator>
    <dc:date>2021-06-10T16:55:41Z</dc:date>
    <item>
      <title>Date informat assistance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747140#M234451</link>
      <description>&lt;PRE&gt;%let mydate = %sysfunc(putn(%sysfunc(intnx(day, %sysfunc(today()), -1, end)), 
yymmddd8.));
%put &amp;amp;mydate;/*SYMBOLGEN:  Macro variable MYDATE resolves to 21-06-09*/

&lt;/PRE&gt;
&lt;P&gt;However I want this output 2020-06-09 or what ever the date is&lt;BR /&gt;I tried yyymmdd10 with no result&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 16:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747140#M234451</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2021-06-10T16:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Date informat assistance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747152#M234453</link>
      <description>&lt;PRE&gt;69 %let mydate = %sysfunc(putn(%sysfunc(intnx(day, %sysfunc(today()), -1, end)), yymmddd10.));
70 %put &amp;amp;mydate;/*SYMBOLGEN: Macro variable MYDATE resolves to 21-06-09*/
2021-06-09&lt;/PRE&gt;
&lt;P&gt;Works fine for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;%let mydate = %sysfunc(putn(%sysfunc(intnx(day, %sysfunc(today()), -1, end)), 
yymmddd8.));
%put &amp;amp;mydate;/*SYMBOLGEN:  Macro variable MYDATE resolves to 21-06-09*/

&lt;/PRE&gt;
&lt;P&gt;However I want this output 2020-06-09 or what ever the date is&lt;BR /&gt;I tried yyymmdd10 with no result&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 17:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747152#M234453</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-10T17:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date informat assistance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747153#M234454</link>
      <description>&lt;P&gt;Format should be yymmddd10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The old triple-Sysfunc! Much easier to do this in a data step, and then you don't have to type as much, and you have fewer chances to misplace a parenthesis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    call symputx('mydate',put(today()-1,yymmddd10.));
run;
%put &amp;amp;=mydate;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Another advice: most of the time, macro variables SHOULD NOT be formatted. If you do format your macro variable, as you have done, this just makes future coding with the macro variable more complex. So you should usually leave macro variables unformatted. See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_self"&gt;Maxim 28&lt;/A&gt;. (There are exceptions, like if you want to use the macro variable in a title or label or sometimes when an external database requires dates as character strings)&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 17:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747153#M234454</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-06-10T17:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Date informat assistance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747156#M234456</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;%let mydate = %sysfunc(putn(%sysfunc(intnx(day, %sysfunc(today()), -1, end)), 
yymmddd8.));
%put &amp;amp;mydate;/*SYMBOLGEN:  Macro variable MYDATE resolves to 21-06-09*/

&lt;/PRE&gt;
&lt;P&gt;However I want this output 2020-06-09 or what ever the date is&lt;BR /&gt;I tried yyymmdd10 with no result&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Devils advocate: if you want 10 characters (count them in 2020-06-09) why did you use a format that only displays 8: yymmddd8. ? When you add the dashes that leaves 6 characters for the actual date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know what your Symbolgen says but that displays as 21-06-09 when I run the code on 09JUN2021.&lt;/P&gt;
&lt;P&gt;Are you sure you have the right system clock setting for date?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 17:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747156#M234456</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-10T17:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Date informat assistance</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747204#M234483</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;%let mydate = %sysfunc(putn(%sysfunc(intnx(day, %sysfunc(today()), -1, end)), 
yymmddd8.));
%put &amp;amp;mydate;/*SYMBOLGEN:  Macro variable MYDATE resolves to 21-06-09*/

&lt;/PRE&gt;
&lt;P&gt;However I want this output 2020-06-09 or what ever the date is&lt;BR /&gt;I tried yyymmdd10 with no result&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You should use the SYSFUNC format parameter.&amp;nbsp; No need for %SYSFUNC(PUTN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;55         %let mydate = %sysfunc(intnx(day,%sysfunc(today()),-1,end),yymmddd10);
56         %put &amp;amp;mydate Using SYSFUNC format parameter;
2021-06-09 Using SYSFUNC format parameter&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Jun 2021 20:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-informat-assistance/m-p/747204#M234483</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2021-06-10T20:07:39Z</dc:date>
    </item>
  </channel>
</rss>

