<?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 format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431370#M106698</link>
    <description>&lt;P&gt;Hello all.I want to use qtr function but the date d that is shown in result is 01/01/1960 which is different from the date that i want as i put in my sas code.Any help is appreciated to correct my mistake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data nn;&lt;BR /&gt;d = '05/19/2016' ;&lt;BR /&gt;p&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = qtr&amp;nbsp;&amp;nbsp; (d);&lt;BR /&gt;format&amp;nbsp; d&amp;nbsp; ddmmyy10. ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jan 2018 17:59:29 GMT</pubDate>
    <dc:creator>fatemeh</dc:creator>
    <dc:date>2018-01-26T17:59:29Z</dc:date>
    <item>
      <title>date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431370#M106698</link>
      <description>&lt;P&gt;Hello all.I want to use qtr function but the date d that is shown in result is 01/01/1960 which is different from the date that i want as i put in my sas code.Any help is appreciated to correct my mistake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data nn;&lt;BR /&gt;d = '05/19/2016' ;&lt;BR /&gt;p&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = qtr&amp;nbsp;&amp;nbsp; (d);&lt;BR /&gt;format&amp;nbsp; d&amp;nbsp; ddmmyy10. ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 17:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431370#M106698</guid>
      <dc:creator>fatemeh</dc:creator>
      <dc:date>2018-01-26T17:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431373#M106699</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nn;
   d='19may2016'd;
   p=qtr(d);
   format d ddmmyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;QTR function requires a numeric variable, and in your code d is a character variable. Specify it as a date constant using the date9 format as "19may2016"d with the trailing d specifying that it is a date constant.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 18:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431373#M106699</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-01-26T18:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431375#M106700</link>
      <description>&lt;P&gt;You tried a wrong method for spelling out a SAS date literal. The correct method is this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;d = '19may2016'd;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jan 2018 18:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431375#M106700</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-26T18:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431376#M106701</link>
      <description>&lt;P&gt;SAS date values need to be specified in DATE9 format which is ddMONYY such as 16May2016&lt;/P&gt;
&lt;P&gt;And when specifying a date, you need to include a d after the quotation marks to indicate the difference between a date and just a plain string.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that you can also just format your date as a quarter variable, I created a variable Z, which is identical to d but formatted as a quarter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nn;
d = "19May2016"d;
p     = qtr   (d);

z = d;
format  d  ddmmyy10.  z qtr.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jan 2018 18:04:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-format/m-p/431376#M106701</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-26T18:04:33Z</dc:date>
    </item>
  </channel>
</rss>

