<?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 Setting up a date macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669413#M200813</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am setting up a date macro variable in my program as below:&lt;/P&gt;&lt;P&gt;1. if I put&amp;nbsp; %let date = 01may18 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; it gets resolve to 01may2018&lt;/P&gt;&lt;P&gt;2. If I put %let date = 01may19 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; it gets resolve to 01may2019&lt;/P&gt;&lt;P&gt;3. &lt;STRONG&gt;if I put %let date = 01may20;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; it gets resolve to 1920 which I am expecting to be 2020&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;May I know which option in the program will give me correct results?&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jul 2020 12:05:27 GMT</pubDate>
    <dc:creator>kajal_30</dc:creator>
    <dc:date>2020-07-15T12:05:27Z</dc:date>
    <item>
      <title>Setting up a date macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669413#M200813</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am setting up a date macro variable in my program as below:&lt;/P&gt;&lt;P&gt;1. if I put&amp;nbsp; %let date = 01may18 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; it gets resolve to 01may2018&lt;/P&gt;&lt;P&gt;2. If I put %let date = 01may19 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; it gets resolve to 01may2019&lt;/P&gt;&lt;P&gt;3. &lt;STRONG&gt;if I put %let date = 01may20;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; it gets resolve to 1920 which I am expecting to be 2020&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;May I know which option in the program will give me correct results?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 12:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669413#M200813</guid>
      <dc:creator>kajal_30</dc:creator>
      <dc:date>2020-07-15T12:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up a date macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669424#M200816</link>
      <description>&lt;P&gt;Please use the below option and then execute the macro variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS software treats the year 2000 like any other leap year. If you use two-digit year numbers for dates, you'll probably need to adjust the default setting for the YEARCUTOFF= option to work with date ranges for your data, or switch to four-digit years. The following program changes the YEARCUTOFF= value to 1950. This change means that all two digit dates are now assumed to fall in the 100-year span from 1950 to 2049.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options yearcutoff=1950;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 12:18:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669424#M200816</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-07-15T12:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up a date macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669470#M200832</link>
      <description>&lt;P&gt;There's an extremely simple solution:&lt;/P&gt;
&lt;P&gt;&lt;FONT size="6"&gt;&lt;STRONG&gt;USE FOUR-DIGIT YEARS!!!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;I am once again astonished that there are still people who, after the Y2k scare, are ***redacted*** to work with two-digit years, and expect anything other than problems.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Next, date values are best stored in raw form in macro variables:&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %let date=%sysfunc(inputn(2020-05-01,yymmdd10.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;As you now only need to use &amp;amp;date (no quotes) in your code.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 14:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669470#M200832</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-15T14:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up a date macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669484#M200838</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date= '01may2019'd;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 14:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669484#M200838</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2020-07-15T14:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Setting up a date macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669487#M200841</link>
      <description>&lt;P&gt;Thank you so much it worked&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 14:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-up-a-date-macro-variable/m-p/669487#M200841</guid>
      <dc:creator>kajal_30</dc:creator>
      <dc:date>2020-07-15T14:53:22Z</dc:date>
    </item>
  </channel>
</rss>

