<?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: Checking Null Exception Oracle Table with SAS in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809549#M24241</link>
    <description>&lt;P&gt;It makes a developer's life harder if one can't directly access a DB via a client. IF you've got the credentials the SAS library uses to access Oracle then the easiest way would be to get a client like DBeaver or SQL Developer. There are portable versions around so it's software you can just download and use even if you can't install software on your local machine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using a pre-assigned SAS library and though might not know the credentials then you can still query Oracle directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume the libref of your pre-assigned library a &lt;EM&gt;blah.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The following statement writes the library definition to your SAS log - one component of it is the Oracle schema name.&lt;/P&gt;
&lt;PRE&gt;libname bla list;&lt;/PRE&gt;
&lt;P&gt;You can also determine the schema name with below syntax.&lt;/P&gt;
&lt;PRE&gt;%let ora_schema=;
proc sql noprint;
  select sysvalue into :ora_schema trimmed
  from dictionary.libnames
  where 
    libname="BLAH"
    and sysname='Schema/Owner'
  ;
quit;
%put &amp;amp;=ora_schema;&lt;/PRE&gt;
&lt;P&gt;You can issue explicit Oracle SQL syntax out of SAS&amp;nbsp; to query Oracle dictionary tables and so derive the DDL of a table.&lt;/P&gt;
&lt;PRE&gt;proc sql;
  connect using blah;
  select * from connection to bla
  (
    &amp;lt;Oracle SQL syntax to be Googled&amp;gt;
  );
  disconnect from blah;
quit;&lt;/PRE&gt;
&lt;P&gt;How the Oracle syntax needs to look like so it works for you (also dependent on the permissions your Oracle user has) is something you need to Google. A very quick try led me to &lt;A href="https://stackoverflow.com/questions/19564989/how-to-extract-table-definitions-using-sql-or-toad" target="_self"&gt;this link&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Apr 2022 22:16:54 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2022-04-24T22:16:54Z</dc:date>
    <item>
      <title>Checking Null Exception Oracle Table with SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809133#M24227</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Could you please help me to check the Oracle SQL definition (including null exception) with SAS EG? We don't have access to Oracle that's why unable to check null exception in oracle.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below SAS EG query not return sql exception.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;describe table abc;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 17:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809133#M24227</guid>
      <dc:creator>SS_B</dc:creator>
      <dc:date>2022-04-21T17:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Null Exception Oracle Table with SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809332#M24228</link>
      <description>Its unclear to me what you are asking here. It sounds like you are getting an error when trying to access an Oracle table. Can you provide the exact error you are receiving?&lt;BR /&gt;How are you connecting to Oracle from SAS? Are you issuing a libname statement or is this library defined / preassigned in SAS Management Console? If you're issuing a libname statement, what is it? If preassigned, can you try assigning manually using a libname statement and see if you get the same issue?&lt;BR /&gt;&lt;BR /&gt;Documentation on the Oracle LIBNAME engine statement can be found here:&lt;BR /&gt;&lt;BR /&gt;LIBNAME Statement for the Oracle Engine&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/p1qft7bzdij79zn1bxh59mc3w8xj.htm" target="_blank"&gt;https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/p1qft7bzdij79zn1bxh59mc3w8xj.htm&lt;/A&gt;</description>
      <pubDate>Fri, 22 Apr 2022 15:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809332#M24228</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2022-04-22T15:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Null Exception Oracle Table with SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809508#M24240</link>
      <description>&lt;P&gt;What I understand is that you can connect to oracle through SAS code, but cannot access using SQL developer or some other tool. Happens when the code is executed through a generic ID and SAS ins running on a server (no local install).&lt;/P&gt;
&lt;P&gt;Now &lt;STRONG&gt;NULL&lt;/STRONG&gt; means nothing. In other words no values is associated with the variable in that observation. If that variable is being used in an operation requiring a value and it encounters null, then there is a null exception.&lt;/P&gt;
&lt;P&gt;There could be multiple approaches to handle the presence of Null depending what is needed.&lt;/P&gt;
&lt;P&gt;The Oracle functions &lt;STRONG&gt;NVL&lt;/STRONG&gt; and &lt;STRONG&gt;NVL2&lt;/STRONG&gt; can be used in expressions to handle NULL.&lt;BR /&gt;Oracle function &lt;STRONG&gt;NVL(Var, some_value)&lt;/STRONG&gt;., assigns&amp;nbsp; &lt;STRONG&gt;'some_value'&lt;/STRONG&gt; to the variable to the expression&amp;nbsp;if&amp;nbsp; &lt;STRONG&gt;Var&lt;/STRONG&gt; is &lt;STRONG&gt;NULL&lt;/STRONG&gt;..&lt;BR /&gt;The oracle function &lt;STRONG&gt;NVL2(Var, value1,value2)&lt;/STRONG&gt; assigns &lt;STRONG&gt;value1&lt;/STRONG&gt;&amp;nbsp;to the expression if the value of &lt;STRONG&gt;Var&lt;/STRONG&gt; is null otherwise it assigns &lt;STRONG&gt;Value2.&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;I&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 15:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809508#M24240</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2022-04-24T15:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Null Exception Oracle Table with SAS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809549#M24241</link>
      <description>&lt;P&gt;It makes a developer's life harder if one can't directly access a DB via a client. IF you've got the credentials the SAS library uses to access Oracle then the easiest way would be to get a client like DBeaver or SQL Developer. There are portable versions around so it's software you can just download and use even if you can't install software on your local machine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using a pre-assigned SAS library and though might not know the credentials then you can still query Oracle directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume the libref of your pre-assigned library a &lt;EM&gt;blah.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The following statement writes the library definition to your SAS log - one component of it is the Oracle schema name.&lt;/P&gt;
&lt;PRE&gt;libname bla list;&lt;/PRE&gt;
&lt;P&gt;You can also determine the schema name with below syntax.&lt;/P&gt;
&lt;PRE&gt;%let ora_schema=;
proc sql noprint;
  select sysvalue into :ora_schema trimmed
  from dictionary.libnames
  where 
    libname="BLAH"
    and sysname='Schema/Owner'
  ;
quit;
%put &amp;amp;=ora_schema;&lt;/PRE&gt;
&lt;P&gt;You can issue explicit Oracle SQL syntax out of SAS&amp;nbsp; to query Oracle dictionary tables and so derive the DDL of a table.&lt;/P&gt;
&lt;PRE&gt;proc sql;
  connect using blah;
  select * from connection to bla
  (
    &amp;lt;Oracle SQL syntax to be Googled&amp;gt;
  );
  disconnect from blah;
quit;&lt;/PRE&gt;
&lt;P&gt;How the Oracle syntax needs to look like so it works for you (also dependent on the permissions your Oracle user has) is something you need to Google. A very quick try led me to &lt;A href="https://stackoverflow.com/questions/19564989/how-to-extract-table-definitions-using-sql-or-toad" target="_self"&gt;this link&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 22:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Checking-Null-Exception-Oracle-Table-with-SAS/m-p/809549#M24241</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-04-24T22:16:54Z</dc:date>
    </item>
  </channel>
</rss>

