<?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: CAST function for Oracle in SAS DI 9.4 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CAST-function-for-Oracle-in-SAS-DI-9-4/m-p/411077#M100476</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the tip. That&amp;nbsp;does the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mario.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Nov 2017 07:29:55 GMT</pubDate>
    <dc:creator>strsljen</dc:creator>
    <dc:date>2017-11-07T07:29:55Z</dc:date>
    <item>
      <title>CAST function for Oracle in SAS DI 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAST-function-for-Oracle-in-SAS-DI-9-4/m-p/410822#M100397</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS DI and trying to use Oracle CAST function to have integer result of division of one NUMBER attribute by 100.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whatever I do, I get syntax error.&lt;/P&gt;&lt;P&gt;Tried:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;(CAST ( {PERIOD_ID/100} AS INTEGER))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;CAST(period_id/100 AS INTEGER)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;etc ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;a missing value, (, ), *, +, ',', -, ALL, BTRIM, CALCULATED, CASE, DISTINCT, EXISTS, INPUT, NOT, PUT, SUBSTRING,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TRANSLATE, UNIQUE, USER, ^, ~.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS code:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;proc sql;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;create table arpu01.WDPLPU as&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;select&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;PERIOD_ID,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LOAD_TYPE,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;OWNER_CUSTOMER_KEY,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;((CAST ( {PERIOD_ID/100} AS INTEGER))) as test1 length = 8&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;label = 'test1'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;from &amp;amp;SYSLAST&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same goes for other options I tried.&lt;/P&gt;&lt;P&gt;I am doing something and I can't see it.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help is more than welcomed!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mario.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 13:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAST-function-for-Oracle-in-SAS-DI-9-4/m-p/410822#M100397</guid>
      <dc:creator>strsljen</dc:creator>
      <dc:date>2017-11-06T13:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: CAST function for Oracle in SAS DI 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAST-function-for-Oracle-in-SAS-DI-9-4/m-p/410845#M100403</link>
      <description>&lt;P&gt;This is not the DI forum subgroup, and as such I do not use it.&amp;nbsp; However at a guess, I suspect your not actually connecting to an Oracle database, nor passing the SQL code through to one, correct?&amp;nbsp; If so then you cannot use Oracle functions in the SQL, only ANSI SQL statements are valid and Base SAS functions.&amp;nbsp; Therefore you would switch out cast() which is oracle only and use the SAS function&amp;nbsp;int() (or round()):&lt;BR /&gt;&lt;SPAN&gt;((CAST ( {PERIOD_ID/100} AS INTEGER))) as test1 length = 8&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;int(PERIOD_ID/100) as test1 length = 8&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 14:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAST-function-for-Oracle-in-SAS-DI-9-4/m-p/410845#M100403</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-06T14:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: CAST function for Oracle in SAS DI 9.4</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAST-function-for-Oracle-in-SAS-DI-9-4/m-p/411077#M100476</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the tip. That&amp;nbsp;does the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mario.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 07:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAST-function-for-Oracle-in-SAS-DI-9-4/m-p/411077#M100476</guid>
      <dc:creator>strsljen</dc:creator>
      <dc:date>2017-11-07T07:29:55Z</dc:date>
    </item>
  </channel>
</rss>

