<?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: PROC DS2 code having error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/548099#M282283</link>
    <description>&lt;P&gt;Assigning a ODBC libname before calling PROC DS2 will cause the PROC DS2 to fail with error: "TKTS initialization failed"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try &lt;STRONG&gt;de-assigning any ODBC libname&lt;/STRONG&gt; before running the PROC DS2 (i.e: LIBNAME &amp;lt;libref&amp;gt; CLEAR)&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2019 03:51:54 GMT</pubDate>
    <dc:creator>ashten28</dc:creator>
    <dc:date>2019-04-03T03:51:54Z</dc:date>
    <item>
      <title>PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437591#M282274</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am trying to use proc DS2 for the first time. While converting base sas code to DS2 code, probably, I am doing some mistake and getting an error message:&amp;nbsp;ERROR: General error ORA-12154: TNS:could not resolve the connect identifier specified&lt;BR /&gt;ERROR: TKTS initialization failed. I am sharing my sas code for your kind advice.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test101;
input id name $;
datalines;
101 abc
102 def
103 ghi
104 jkl
105 mno
;
run;



proc ds2;
data test201/overwrite=yes;
	method run();
    dcl integer id, char name ;
	set {select * from test101 where id =101};
	end;
enddata;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you in advance for your kind reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 14:20:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437591#M282274</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2018-02-15T14:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437673#M282275</link>
      <description>&lt;P&gt;I do not know&amp;nbsp;much about DS2 but one thing odd i found is&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;char name
/*change it to any length you want*/
char(20) name&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2018 16:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437673#M282275</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-02-15T16:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437683#M282276</link>
      <description>Tried. Not working.</description>
      <pubDate>Thu, 15 Feb 2018 16:31:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437683#M282276</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2018-02-15T16:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437810#M282277</link>
      <description>&lt;P&gt;Proc DS2 wants to connect to a specified data source type. You need to specify a libname with the type of data connection.&lt;/P&gt;
&lt;P&gt;From the online documentation example see the libname statement using the BASE engine description so Proc DS2 know that when you use that library it is a SAS data set.&lt;/P&gt;
&lt;PRE&gt;libname MyFiles base 'C:\Myfiles';
proc ds2;
   data MyFiles.BaseTable; 
      declare double j j2;
      method run();
         do j = 1 to 1000;
            j2 = 2*j;
            output;
         end;
      end;
   enddata;

run;
quit;
proc print data=myfiles.basetable (obs=10);
run; 
&lt;/PRE&gt;
&lt;P&gt;I get different errors running your code involving the comma in the dcl. I don't think declaring multiple data types in a single declare statement is valid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the ORA-12154 is because for some reason DS2 thinks oracle is involved. Since you don't specify a library the connection to the library can't be found.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 22:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437810#M282277</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-15T22:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437811#M282278</link>
      <description>&lt;P&gt;Proc DS2 wants to connect to a specified data source type. You need to specify a libname with the type of data connection.&lt;/P&gt;
&lt;P&gt;From the online documentation example see the libname statement using the BASE engine description so Proc DS2 know that when you use that library it is a SAS data set.&lt;/P&gt;
&lt;PRE&gt;libname MyFiles base 'C:\Myfiles';
proc ds2;
   data MyFiles.BaseTable; 
      declare double j j2;
      method run();
         do j = 1 to 1000;
            j2 = 2*j;
            output;
         end;
      end;
   enddata;

run;
quit;
proc print data=myfiles.basetable (obs=10);
run; 
&lt;/PRE&gt;
&lt;P&gt;I get different errors running your code involving the comma in the dcl. I don't think declaring multiple data types in a single declare statement is valid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the ORA-12154 is because for some reason DS2 thinks oracle is involved. Since you don't specify a library the connection to the library can't be found.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 22:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437811#M282278</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-15T22:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437854#M282279</link>
      <description>&lt;P&gt;Firstly as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;says you need two separate dcl statements for your variables - correcting that to the following runs fine for me&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc ds2;
data test201/overwrite=yes;
	method run();
    dcl integer id;
    dcl char name ;
	set {select * from test101 where id =101};
	end;
enddata;
run;
quit;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;One thing to note is that because you don't specify a length for the name variable it defaults to a char(8). It is, I believe good practice to ALWAYS declare a length for character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question remains as to why your getting an ORACLE error. I can only assume that something else must have occurred during your session to make SAS think it should be connecting to ORACLE but what that is I couldn't say.....&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 00:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/437854#M282279</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-02-16T00:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/438985#M282280</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think SAS 9.4 1M4 version supports PROC DS2 and I am having SAS 9.4 1M3. That may be the reason for the error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 16:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/438985#M282280</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2018-02-21T16:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/439119#M282281</link>
      <description>&lt;P&gt;If I remember rightly Proc DS2 was in earlier versions than 9.4 1M4 but experimental (which in my experience meant it didn't work&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; )&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 23:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/439119#M282281</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-02-21T23:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/439196#M282282</link>
      <description>&lt;P&gt;No problem running the code the following code on 9.04.01M3P062415, using the ds2-step provided by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32246"&gt;@ChrisBrooks&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test101;
input id name $;
datalines;
101 abc
102 def
103 ghi
104 jkl
105 mno
;
run;

proc ds2;
data test201/overwrite=yes;
	method run();
    dcl integer id;
    dcl char name ;
	set {select * from test101 where id =101};
	end;
enddata;
run;
quit;

proc print data=work.test201;run;

%put &amp;amp;=SYSVLONG;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Feb 2018 08:39:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/439196#M282282</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-02-22T08:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: PROC DS2 code having error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/548099#M282283</link>
      <description>&lt;P&gt;Assigning a ODBC libname before calling PROC DS2 will cause the PROC DS2 to fail with error: "TKTS initialization failed"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try &lt;STRONG&gt;de-assigning any ODBC libname&lt;/STRONG&gt; before running the PROC DS2 (i.e: LIBNAME &amp;lt;libref&amp;gt; CLEAR)&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 03:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-DS2-code-having-error/m-p/548099#M282283</guid>
      <dc:creator>ashten28</dc:creator>
      <dc:date>2019-04-03T03:51:54Z</dc:date>
    </item>
  </channel>
</rss>

