<?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 SAS DS2 Insert Problem in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/SAS-DS2-Insert-Problem/m-p/506742#M1043</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;My requirement was to insert record into oracle table using DS2 code. and the below code runs in loop and insert record&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;package _test /overwrite=yes;&lt;/P&gt;&lt;P&gt;dcl package SQLSTMT _slct1('INSERT INTO DSDATA."SCHEMANEME"."TAB_NAME"&amp;nbsp;&lt;/P&gt;&lt;P&gt;("A", "B", "C","D")&lt;BR /&gt;VALUES (?,?,?,?)');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;method execute (varchar(32767) A,&lt;/P&gt;&lt;P&gt;varchar(32767) B,&lt;/P&gt;&lt;P&gt;varchar(32767) C,&lt;/P&gt;&lt;P&gt;varchar(32767) D);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_loop=sum(countc(A,','),1);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;do i = 1 to _loop;&lt;/P&gt;&lt;P&gt;A1= scan(A,i,',');&lt;/P&gt;&lt;P&gt;B1=&amp;nbsp;scan(B,i,',');&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;C1=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;scan(C,i,',');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;D1=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;scan(D,i,',');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;_slct1.setdouble(1,A1);&lt;BR /&gt;_slct1.setdouble(2,B1);&lt;BR /&gt;_slct1.setvarchar(3,C1);&lt;BR /&gt;_slct1.setvarchar(4,D1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;rc=_slct1.execute();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;endpackage;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was working fine and successfully inserted into oracle table.due to requirement change the Column 'C' is made as Number in oracle. So when i changed my DS2 code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_slct1.setdouble(1,A1);&lt;BR /&gt;_slct1.setdouble(2,B1);&lt;BR /&gt;_slct1.setdouble(3,C1);&lt;BR /&gt;_slct1.setvarchar(4,D1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;rc=_slct1.execute();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;its inserting NULL . i tried converting the column to Number as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;declare int NUMERIC_C;&lt;/P&gt;&lt;P&gt;NUMERIC_C=inputn(C1,10.); (or) NUMERIC_C = compress(C1);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;_slct1.set&lt;/SPAN&gt;&lt;SPAN&gt;double&lt;/SPAN&gt;&lt;SPAN&gt;(3,NUMERIC_C);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;still no luck it inserted&amp;nbsp;only NULL,but the remaining double values are inserting&amp;nbsp;as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone pleases help me in this !!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Oct 2018 06:34:16 GMT</pubDate>
    <dc:creator>Saranya_Sub</dc:creator>
    <dc:date>2018-10-23T06:34:16Z</dc:date>
    <item>
      <title>SAS DS2 Insert Problem</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/SAS-DS2-Insert-Problem/m-p/506742#M1043</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;My requirement was to insert record into oracle table using DS2 code. and the below code runs in loop and insert record&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;package _test /overwrite=yes;&lt;/P&gt;&lt;P&gt;dcl package SQLSTMT _slct1('INSERT INTO DSDATA."SCHEMANEME"."TAB_NAME"&amp;nbsp;&lt;/P&gt;&lt;P&gt;("A", "B", "C","D")&lt;BR /&gt;VALUES (?,?,?,?)');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;method execute (varchar(32767) A,&lt;/P&gt;&lt;P&gt;varchar(32767) B,&lt;/P&gt;&lt;P&gt;varchar(32767) C,&lt;/P&gt;&lt;P&gt;varchar(32767) D);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_loop=sum(countc(A,','),1);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;do i = 1 to _loop;&lt;/P&gt;&lt;P&gt;A1= scan(A,i,',');&lt;/P&gt;&lt;P&gt;B1=&amp;nbsp;scan(B,i,',');&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;C1=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;scan(C,i,',');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;D1=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;scan(D,i,',');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;_slct1.setdouble(1,A1);&lt;BR /&gt;_slct1.setdouble(2,B1);&lt;BR /&gt;_slct1.setvarchar(3,C1);&lt;BR /&gt;_slct1.setvarchar(4,D1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;rc=_slct1.execute();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;endpackage;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was working fine and successfully inserted into oracle table.due to requirement change the Column 'C' is made as Number in oracle. So when i changed my DS2 code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_slct1.setdouble(1,A1);&lt;BR /&gt;_slct1.setdouble(2,B1);&lt;BR /&gt;_slct1.setdouble(3,C1);&lt;BR /&gt;_slct1.setvarchar(4,D1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;rc=_slct1.execute();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;its inserting NULL . i tried converting the column to Number as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;declare int NUMERIC_C;&lt;/P&gt;&lt;P&gt;NUMERIC_C=inputn(C1,10.); (or) NUMERIC_C = compress(C1);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;_slct1.set&lt;/SPAN&gt;&lt;SPAN&gt;double&lt;/SPAN&gt;&lt;SPAN&gt;(3,NUMERIC_C);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;still no luck it inserted&amp;nbsp;only NULL,but the remaining double values are inserting&amp;nbsp;as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone pleases help me in this !!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 06:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/SAS-DS2-Insert-Problem/m-p/506742#M1043</guid>
      <dc:creator>Saranya_Sub</dc:creator>
      <dc:date>2018-10-23T06:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DS2 Insert Problem</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/SAS-DS2-Insert-Problem/m-p/508234#M1047</link>
      <description>Hi,&lt;BR /&gt;Have you tried explicitly declaring the data type of A1 - DC1 as double ?&lt;BR /&gt;Regards&lt;BR /&gt;James&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Oct 2018 04:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/SAS-DS2-Insert-Problem/m-p/508234#M1047</guid>
      <dc:creator>JamesAnderson</dc:creator>
      <dc:date>2018-10-29T04:36:15Z</dc:date>
    </item>
  </channel>
</rss>

