<?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: Unable to convert a number to a SAS Date. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217619#M53553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your date field actually contains just numbers like (20151003) then your code should have worked. Does your log provide any clue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Conversely, is there a chance they are really numbers represented as a string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, you could use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select Input(date,yymmdd8.) as Descn_date format=date9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2015 14:00:36 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2015-04-08T14:00:36Z</dc:date>
    <item>
      <title>Unable to convert a number to a SAS Date.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217617#M53551</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;I am trying to convert a number to a SAS Date YYMMDD8. I m using proc Sql; from Oracle table&amp;nbsp; to BASE SAS table.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Input(put(date,8.),yymmdd8.) as Descn_date,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I have around 80 columns and around 30 columns have date as number for e.g 20150306 and so&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I m not able to convert it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;Pls help me on this.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:35:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217617#M53551</guid>
      <dc:creator>santosh_pat69</dc:creator>
      <dc:date>2015-04-08T13:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to convert a number to a SAS Date.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217618#M53552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;could you please try this&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;put(Input(date,yymmdd8.),yymmdd8.)&lt;/STRONG&gt; as Descn_date&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 13:48:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217618#M53552</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-04-08T13:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to convert a number to a SAS Date.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217619#M53553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your date field actually contains just numbers like (20151003) then your code should have worked. Does your log provide any clue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Conversely, is there a chance they are really numbers represented as a string?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, you could use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select Input(date,yymmdd8.) as Descn_date format=date9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 14:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217619#M53553</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-04-08T14:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to convert a number to a SAS Date.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217620#M53554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, there are a few things here.&amp;nbsp; Firstly, by proc sql from oracle table, does this mean you are using pass through and executing statements on the Oracle server?&amp;nbsp; If so you probably wont be able to use SAS functions.&amp;nbsp; Also, the "date" from Oracle is different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest that you start by extracting the data as it is to a SAS dataset:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to oracle ...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table TMP as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from connection to oracle (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from SCHEMA.YOU_TABLE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; disconnect from oracle;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;Now examine the data you have got back.&amp;nbsp; The dates can processed using normal SAS techniques:&lt;/P&gt;&lt;P&gt;data tmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set tmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_date=input(substr(date,...),yymmdd8.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;I don't have an Oracle server here so can't check any of the above, but that is what I think you are getting stuck on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 14:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unable-to-convert-a-number-to-a-SAS-Date/m-p/217620#M53554</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-08T14:03:50Z</dc:date>
    </item>
  </channel>
</rss>

