<?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: Getting error while trying to reduce the length also pushing the data in oracle database in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892463#M352469</link>
    <description>&lt;P&gt;+1 for using explicit pass-through.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option using implicit pass-through is to create the table in Oracle so you get all the types like you want, then use PROC APPEND in SAS to insert records into the existing oracle table.&lt;/P&gt;</description>
    <pubDate>Sat, 02 Sep 2023 23:13:44 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2023-09-02T23:13:44Z</dc:date>
    <item>
      <title>Getting error while trying to reduce the length also pushing the data in oracle database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892401#M352445</link>
      <description>&lt;P&gt;While trying to run this code I am geeting the below error&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data oralib.benefeciary ;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;set SSP.SSPSASSchemeBeneficiary(obs=10);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ERROR: Error attempting to CREATE a DBMS table. ERROR: ORACLE execute error: ORA-00902: invalid datatype..&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ERROR: ROLLBACK issued due to errors for data set ORALIB.SCHEMEBENEFICIA.DATA.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But running the below code is working&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data oralib.benefeciary ;&lt;/STRONG&gt;(KEEP=AppId Disability DistrictName&lt;BR /&gt;DOB Gender GramPanchayatName MaritalStatus&lt;BR /&gt;SocialSchemeName);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;set SSP.SSPSASSchemeBeneficiary(obs=10)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;But the length of the variable is jumping to anywhere around 800 for every variable&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;I had also tried to reduce&amp;nbsp; length&amp;nbsp; &amp;nbsp;but the sameis not getting reduced&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data oralib.Schemebeneview;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LENGTH Disability $15 DistrictName $15 GramPanchayatName $15 MaritalStatus $15&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;SocialSchemeName $15;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;set oralib.SCHEMEBENEDETAIL;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;RUN;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could anyone please give an idea How to fix this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 10:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892401#M352445</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2023-09-02T10:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error while trying to reduce the length also pushing the data in oracle database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892402#M352446</link>
      <description>&lt;P&gt;Run your first code with below options which should show you in the log the create table statement that SAS actually generates.&lt;/P&gt;
&lt;PRE&gt;options sastrace=',,,d' sastracelog=saslog nostsuffix; 
data oralib.benefeciary ;
  set SSP.SSPSASSchemeBeneficiary(obs=10);
run;&lt;/PRE&gt;
&lt;P&gt;Is libref SSP pointing to a SAS table or is this also an Oracle table?&lt;/P&gt;
&lt;P&gt;Please share with us the SAS generated Create Table statement from the log as well as the result from a Proc Contents for&amp;nbsp;SSP.SSPSASSchemeBeneficiary.&lt;/P&gt;
&lt;P&gt;And also: Which SAS version are you using. Is this SAS9.4, Viya SPRE or CAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I normally prefer to spend the extra effort to code an explicit pass-through create table statement instead of having SAS generate the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 10:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892402#M352446</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-09-02T10:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error while trying to reduce the length also pushing the data in oracle database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892463#M352469</link>
      <description>&lt;P&gt;+1 for using explicit pass-through.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option using implicit pass-through is to create the table in Oracle so you get all the types like you want, then use PROC APPEND in SAS to insert records into the existing oracle table.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 23:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892463#M352469</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-09-02T23:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error while trying to reduce the length also pushing the data in oracle database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892494#M352489</link>
      <description>&lt;P&gt;If you want to have control over how SAS generates the SQL to create the variables you can use the DBTYPE= dataset option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data oralib.Schemebeneview
(dbtype=(
  Disability=varchar2(15)
  DistrictName=varchar2(15)
  GramPanchayatName=varchar2(15)
  MaritalStatus=varchar2(15)
  SocialSchemeName=varchar2(15)
 )
);
  set oralib.SCHEMEBENEDETAIL;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make sure the types used are valid syntax for the target database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you have non-7bit ASCII characters in any of your strings and you are using a single byte encoding (suc as WLATIN1) and the database is using a multi-byte encoding (such as UTF-8) then make sure the target variables lengths reflect any extra bytes needed for those multibyte characters.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Sep 2023 17:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/892494#M352489</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-03T17:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error while trying to reduce the length also pushing the data in oracle database</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/894042#M353196</link>
      <description>&lt;P&gt;Hi - I have used this to fix the above issue in the Libname.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider eo bhi baw buc bud bue buf bug buh bui buj buk bul bum bun buo bup buq bur bus but buu buv buw bux buy buz bva bvb bvc bvd bve bvf bvg bvh"&gt;preserve_col_names=yes DB_LENGTH_SEMANTICS_BYTE=NO DBCLIENT_MAX_BYTES=1;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 13:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-error-while-trying-to-reduce-the-length-also-pushing-the/m-p/894042#M353196</guid>
      <dc:creator>animesh123</dc:creator>
      <dc:date>2023-09-13T13:17:07Z</dc:date>
    </item>
  </channel>
</rss>

