<?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: converting dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66778#M14487</link>
    <description>I would add the 4 months then convert. Adding 4 months would be&lt;BR /&gt;
intnx('month',nomination_ship_dt,4) as new_ship_dt.  My sas is down, but if you just need to format the new value, a custom format might be better.</description>
    <pubDate>Wed, 18 May 2011 04:36:46 GMT</pubDate>
    <dc:creator>DBailey</dc:creator>
    <dc:date>2011-05-18T04:36:46Z</dc:date>
    <item>
      <title>converting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66777#M14486</link>
      <description>I have a file with a column in it and the date is in the format 01JAN2010. I need to convert the date to the format YYYYMM and then add 4 months to it. I found this code PUT(YEAR(nomination_ship_dt),4.)||PUT(MONTH(nomination_ship_dt),Z2.0) AS YEAR_MONTH LENGTH=6 FORMAT=$6. but in working with it I couldn't get it to work. I changed the format=$6 to format=6.0. I also tried removing the Length but I couldn't get it work. Any help is appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
DanD</description>
      <pubDate>Wed, 18 May 2011 04:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66777#M14486</guid>
      <dc:creator>DanD</dc:creator>
      <dc:date>2011-05-18T04:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: converting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66778#M14487</link>
      <description>I would add the 4 months then convert. Adding 4 months would be&lt;BR /&gt;
intnx('month',nomination_ship_dt,4) as new_ship_dt.  My sas is down, but if you just need to format the new value, a custom format might be better.</description>
      <pubDate>Wed, 18 May 2011 04:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66778#M14487</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-05-18T04:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: converting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66779#M14488</link>
      <description>data _null_;&lt;BR /&gt;
&lt;BR /&gt;
attrib nomination_ship_dt informat=date9. format=date9.;&lt;BR /&gt;
nomination_ship_dt='01jan2010'd;&lt;BR /&gt;
put nomination_ship_dt=;&lt;BR /&gt;
&lt;BR /&gt;
attrib next_ship_dt informat=date9. format=yymmn7.;&lt;BR /&gt;
next_ship_dt=intnx('month', nomination_ship_dt, 4);&lt;BR /&gt;
put next_ship_dt=;&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Log output:&lt;BR /&gt;
nomination_ship_dt=01JAN2010&lt;BR /&gt;
next_ship_dt=201005&lt;BR /&gt;
&lt;BR /&gt;
Note: The above data step uses the YYMMxw. Format for next_ship_dt, where x is the separator. I have used N to indicates no separator.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;U&gt;&lt;/U&gt;&lt;U&gt;&lt;/U&gt;</description>
      <pubDate>Wed, 18 May 2011 08:51:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66779#M14488</guid>
      <dc:creator>ChendhilKumar</dc:creator>
      <dc:date>2011-05-18T08:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: converting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66780#M14489</link>
      <description>Thanks for the reply. It did work.</description>
      <pubDate>Thu, 19 May 2011 04:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66780#M14489</guid>
      <dc:creator>DanD</dc:creator>
      <dc:date>2011-05-19T04:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: converting dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66781#M14490</link>
      <description>Thanks for the help. I did use this and it worked.</description>
      <pubDate>Thu, 19 May 2011 04:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/converting-dates/m-p/66781#M14490</guid>
      <dc:creator>DanD</dc:creator>
      <dc:date>2011-05-19T04:24:55Z</dc:date>
    </item>
  </channel>
</rss>

