<?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: Formatting dates in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129514#M35311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Tom! Your code is much better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Mar 2013 01:26:11 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2013-03-07T01:26:11Z</dc:date>
    <item>
      <title>Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129508#M35305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;I have a variable date called mydate&lt;/P&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;format mydate mmddyy10.;&lt;/P&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;sample output 03/04/2013&lt;/P&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;11/03/2012&lt;/P&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;04/11/2012&lt;/P&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;I want to supress the month and day if there is a leading zero&lt;/P&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;(ie 3/4/2013&lt;/P&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;11/3/2012&lt;/P&gt;&lt;P style="margin: 5px 0px; font-size: 12px; font-family: 'Times New Roman';"&gt;4/11/2012 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 20:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129508#M35305</guid>
      <dc:creator>omega1983</dc:creator>
      <dc:date>2013-03-06T20:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129509#M35306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way of doing it,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sample;&lt;BR /&gt;input dt MMDDYY10. ;&lt;BR /&gt;datalines ;&lt;BR /&gt;11/03/2012&lt;BR /&gt;04/11/2012&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data sample1;&lt;BR /&gt;set sample;&lt;BR /&gt;dt1=compress(tranwrd(put(dt,MMDDYY10.),'0',''));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sylas.J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 21:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129509#M35306</guid>
      <dc:creator>Sylas</dc:creator>
      <dc:date>2013-03-06T21:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129510#M35307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have a look at the PICTURE statement of the FORMAT procedure.&lt;/P&gt;&lt;P&gt;That allows you to define the layout of your choice. The month and day can be defined to appear without a leading zero.&lt;/P&gt;&lt;P&gt;The link is to the PICTURE statement &lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/p0n990vq8gxca6n1vnsracr6jp2c.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/p0n990vq8gxca6n1vnsracr6jp2c.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;once there look down the webpage until you find the directives&lt;/P&gt;&lt;P&gt;I think you will want something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;picture mydate low-high = '%m/%d/%Y'( datatype= date) ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;used like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;%put %sysfunc( today(), mydate ) ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; stringdate = put( sas_date, mydate10. ) ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but first read the doc and see what examples it provides&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good luck&lt;/P&gt;&lt;P&gt;peterC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 21:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129510#M35307</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-03-06T21:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129511#M35308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what about the '0' in year '2012'?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 21:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129511#M35308</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-03-06T21:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129512#M35309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Linlin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code won't handle the year, your code is correct and best to use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 21:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129512#M35309</guid>
      <dc:creator>Sylas</dc:creator>
      <dc:date>2013-03-06T21:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129513#M35310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;newdate=catx('/',month(date),day(date),year(date));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 22:30:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129513#M35310</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-06T22:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129514#M35311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Tom! Your code is much better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 01:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129514#M35311</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-03-07T01:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129515#M35312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Hi Omega,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find below the code and its output for you problem:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:-&lt;/P&gt;&lt;P&gt;=================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;informat mydate mmddyy10.;&lt;/P&gt;&lt;P&gt;input mydate ;&lt;/P&gt;&lt;P&gt;format mydate mmddyy10.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;03/04/2013&lt;/P&gt;&lt;P&gt;11/03/2012&lt;/P&gt;&lt;P&gt;04/11/2012&lt;/P&gt;&lt;P&gt;01/01/2011&lt;/P&gt;&lt;P&gt;05/09/2009&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new1(drop= month day year);&lt;/P&gt;&lt;P&gt;set new;&lt;/P&gt;&lt;P&gt;month=month(mydate);&lt;/P&gt;&lt;P&gt;day=day(mydate);&lt;/P&gt;&lt;P&gt;year=year(mydate);&lt;/P&gt;&lt;P&gt;new_date=cats(month,"/",day,"/",year);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;===============================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;================================================&lt;/P&gt;&lt;P&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mydate&amp;nbsp;&amp;nbsp;&amp;nbsp; new_date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03/04/2013&amp;nbsp;&amp;nbsp;&amp;nbsp; 3/4/2013&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/03/2012&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/3/2012&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/11/2012&amp;nbsp;&amp;nbsp;&amp;nbsp; 4/11/2012&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2011&amp;nbsp;&amp;nbsp;&amp;nbsp; 1/1/2011&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/09/2009&amp;nbsp;&amp;nbsp;&amp;nbsp; 5/9/2009&lt;/P&gt;&lt;P&gt;==================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Daman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 04:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129515#M35312</guid>
      <dc:creator>damanaulakh88</dc:creator>
      <dc:date>2013-03-07T04:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129516#M35313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;here is the user format approach, to work in any context&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;37&amp;nbsp;&amp;nbsp; proc format ;&lt;BR /&gt;38&amp;nbsp;&amp;nbsp; picture mydate low-high = '%m/%d/%Y'( datatype= date) ;&lt;/P&gt;&lt;P&gt;NOTE: Format MYDATE has been output.&lt;BR /&gt;39&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE FORMAT used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;40&lt;BR /&gt;41&amp;nbsp;&amp;nbsp; data new;&lt;BR /&gt;42&amp;nbsp;&amp;nbsp; informat mydate mmddyy10.;&lt;BR /&gt;43&amp;nbsp;&amp;nbsp; input mydate ;&lt;BR /&gt;44&amp;nbsp;&amp;nbsp; format mydate mydate.;&lt;BR /&gt;45&amp;nbsp;&amp;nbsp; put mydate= date9. mydate= ;&lt;BR /&gt;46&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;mydate=04MAR2013 mydate=3/4/2013&lt;BR /&gt;mydate=03NOV2012 mydate=11/3/201&lt;BR /&gt;mydate=11APR2012 mydate=4/11/201&lt;BR /&gt;mydate=01JAN2011 mydate=1/1/2011&lt;BR /&gt;mydate=09MAY2009 mydate=5/9/2009&lt;BR /&gt;NOTE: The data set WORK.NEW has 5&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 23:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129516#M35313</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-03-07T23:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129517#M35314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;CATX is used for removing trailing and leading spaces as well as to insert DELIMITERS....&lt;/P&gt;&lt;P&gt;But in this case it is removing leading ZEROS....&lt;/P&gt;&lt;P&gt;So my question is :&lt;/P&gt;&lt;P&gt;IS ZERO considered LEADING OR TRAILING SPACE???????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 18:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129517#M35314</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-03-08T18:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129518#M35315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; catx is silently converting the numbers to strings. It is not adding any leading zeros. So numbers less than 10 will be only one digit.&lt;/P&gt;&lt;P&gt;The zeros are never generated, so CATX() is not removing any zeros.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 18:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129518#M35315</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-08T18:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129519#M35316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please elaborate it Tom....I still dint get it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 18:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129519#M35316</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-03-08T18:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129520#M35317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Consider this little program. &lt;/P&gt;&lt;P&gt;Note that even if tell SAS that Y should be displayed with leading zeros when CATX() still converts without using the Z format.&lt;/P&gt;&lt;P&gt;Note that C which is a character variable and hence does not undergo any conversion keeps all of its characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x=1 ; y=2; c='&amp;nbsp;&amp;nbsp; 09' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format y z3.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s=catx('/',x,y,c);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put (_all_) (=);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x=1 y=002 c=09 s=1/2/09&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 19:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129520#M35317</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-08T19:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129521#M35318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If I am not wrong........&lt;/P&gt;&lt;P&gt;if a numeric value of 000900 in SAS is converted to char value using CATX.....its value will be '900'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALSO&lt;/P&gt;&lt;P&gt;05/09/2009&amp;nbsp;&amp;nbsp;&amp;nbsp; is converted to 5/9/2009. if it was 09 instead of 2009 then is this correct???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;05/09/09 is converted to &lt;STRONG&gt;5/9/9&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 19:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129521#M35318</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-03-08T19:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129522#M35319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To understand what the CATX() function is doing do not think about it is dates.&amp;nbsp; Also there is no such thing as a numeric value of 000900, at least not one that is different than 900 or any other way of expressing the number nine hundred ( 9*100, 1000-100, '384'x etc.).&amp;nbsp; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;So&amp;nbsp; in this statement &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;newdate=catx('/',month(date),day(date),year(date));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATX is operating on three numbers.&amp;nbsp; They happen to be a month, a day and a year, but CATX() doesn't know that (or care).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if DATE='09MAY2009'd then CATX receives the numbers 5,9 and 2009.&lt;/P&gt;&lt;P&gt;It converts them to the strings '5','9', and '2009'. &lt;/P&gt;&lt;P&gt;Then it sticks slashes between them to generate the final string '5/9/2009'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 19:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/129522#M35319</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-08T19:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/410718#M67296</link>
      <description>&lt;P&gt;The Picture Format works very well, and it leaves the data as a SAS date for functions and calculations. Just don't forget to add the 10 when you use it or your dates will drop the last few digits. The digits get dropped from right so 11/11/2011 may become 11/11/20 on output if you do not set the length to 10.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2017 20:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/410718#M67296</guid>
      <dc:creator>Bill_</dc:creator>
      <dc:date>2017-11-05T20:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting dates in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/725475#M80285</link>
      <description>The reason this post (Tom on 3/1/2013 at 2:41pm) finally cleared it up for me is that I realized that the functions MONTH, DAY, and YEAR were returning numeric values, which would automatically lack any leading zeroes, regardless of the formatting applied to the date they were extracting from.</description>
      <pubDate>Thu, 11 Mar 2021 15:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-dates-in-SAS/m-p/725475#M80285</guid>
      <dc:creator>Paul_de_Barros</dc:creator>
      <dc:date>2021-03-11T15:51:52Z</dc:date>
    </item>
  </channel>
</rss>

