<?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: Date to Int in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203676#M37947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need yymmdd8. format instead of z6 format in your put statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're doing this via SQL you can do the transformation in the SQL join step.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Apr 2015 03:32:37 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-04-25T03:32:37Z</dc:date>
    <item>
      <title>Date to Int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203674#M37945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to join a data set by the primary id and the month.&lt;BR /&gt;The month field in one table(A) is a char and the month field in the other table(B) calandar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table A month field is formatted like 20150301 INT&lt;BR /&gt;TABLE B month field is formatted like 01SEP14 DATE&lt;/P&gt;&lt;P&gt;HOW CAN I FORMAT THE MONTH FIELD IN TABLE A(01SEP14) TO return (20140901) INT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;iVE TRIED THE BELOW&lt;BR /&gt;(DIDNT WORK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA work.ACCTS; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET work.ACCTS ;&lt;BR /&gt;&amp;nbsp; MONYEARCHAR=put(firstday,z6.);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; RUN; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUIT; &lt;BR /&gt;PLEASE HELP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Apr 2015 01:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203674#M37945</guid>
      <dc:creator>thomask23</dc:creator>
      <dc:date>2015-04-25T01:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203675#M37946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this to see if it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format month yymmddn8.;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Apr 2015 01:50:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203675#M37946</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-04-25T01:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203676#M37947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need yymmdd8. format instead of z6 format in your put statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're doing this via SQL you can do the transformation in the SQL join step.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Apr 2015 03:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203676#M37947</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-25T03:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date to Int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203677#M37948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;INT looks more like a numeric than a character variable. To get a number that looks like a date, you will need an input(put()) combination:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data test;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;firstday = '01SEP14'd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;format firstday date7.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;int = input(put(firstday, yymmddn8.), 8.0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Apr 2015 03:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-to-Int/m-p/203677#M37948</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-04-25T03:41:02Z</dc:date>
    </item>
  </channel>
</rss>

