<?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: error dataDiscovery in Developers</title>
    <link>https://communities.sas.com/t5/Developers/error-dataDiscovery/m-p/896928#M6437</link>
    <description>&lt;P&gt;I think it's because you are not &lt;STRONG&gt;specifying the caslib in the dataDiscovery.profile action&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In CAS, you have what's called an active caslib. The active caslib is like your current working directory. &lt;STRONG&gt;If you do not specify a caslib, CAS will use the active caslib.&lt;/STRONG&gt; By default, the &lt;STRONG&gt;Casuser&lt;/STRONG&gt; caslib is typically the active caslib. You can check with this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;
    sessionProp.getSessOpt / name = 'caslib';
quit;&lt;BR /&gt;
/* results */
{caslib=CASUSER(user-name)}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your working code &lt;STRONG&gt;you changed the active caslib in the CAS statement&lt;/STRONG&gt; to the &lt;STRONG&gt;AAAA&lt;/STRONG&gt; caslib. Now if you specify a CAS table without specifying &lt;I&gt;where&amp;nbsp;&lt;/I&gt;the CAS table is, it'll use&amp;nbsp;&lt;STRONG&gt;AAAA by default.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mysess sessopts=(caslib=&amp;amp;caslib.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you load the sashelp.cars SAS data set into memory in the &lt;STRONG&gt;AAAA&lt;/STRONG&gt; caslib. Now this data set was loaded to the&amp;nbsp;&lt;STRONG&gt;AAAA&lt;/STRONG&gt; caslib (whatever data source that connects to. Could be a database, path, cloud, etc.). In the CASUTIL code you specified the outcaslib parameter, indicating which caslib you want to load this table to. If you didn't specify the outcaslib parameter, it would &lt;STRONG&gt;use the active caslib.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc casutil;
	load data=&amp;amp;libname..&amp;amp;table.
	outcaslib="&amp;amp;caslib." casout="&amp;amp;table." REPLACE;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your dataDiscover.profile action you don't specify &lt;STRONG&gt;where the CAS table you want is.&lt;/STRONG&gt; So SAS will use the active caslib by default. In your working code the active caslib is &lt;STRONG&gt;AAAA&lt;/STRONG&gt; since you set it in your CAS statement. In the code that's erroring out my guess is the active caslib is &lt;STRONG&gt;Casuser&lt;/STRONG&gt;, and the CARS table doesn't exist in Casuser.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	dataDiscovery.profile result=r / table={name="&amp;amp;table."},   /* &amp;lt;--where should I look for this table??? SAS will look in the active caslib */
	casOut={name="Profilazione", replace=true};                /* &amp;lt;--where should I create this table??? SAS will use the active caslib */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recommend always specifying the caslib and not relying on the active caslib, even though it's not always required. It's very easy to change the active caslib accidently, and this could cause issues like this. Being explicit avoids these issues and honestly makes your code easier to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is how I would type out the action.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;
	loadactionset / actionSet="dataDiscovery";
run;
	dataDiscovery.profile result=r / 
		table={
			name="&amp;amp;table.",
			caslib="&amp;amp;caslib"   /*Specify input caslib. If this is omitted, the active caslib is used */
		},
		casOut={
			name="Profilazione", 
			caslib="&amp;amp;caslib",   /*Specify output caslib. If this is omitted, the active caslib is used */
			replace=true
		};
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also have a series of blogs on CAS actions. Feel free to check out them out:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sgf/2021/08/06/cas-action-a-series-on-fundamentals/" target="_self"&gt;https://blogs.sas.com/content/sgf/2021/08/06/cas-action-a-series-on-fundamentals/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Oct 2023 12:58:28 GMT</pubDate>
    <dc:creator>Panagiotis</dc:creator>
    <dc:date>2023-10-03T12:58:28Z</dc:date>
    <item>
      <title>error dataDiscovery</title>
      <link>https://communities.sas.com/t5/Developers/error-dataDiscovery/m-p/884817#M6385</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;I have this code that works:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let caslib = AAAA;
%let libname=SASHELP;
%let table=CARS;

&lt;STRONG&gt;  cas mysess sessopts=(caslib=&amp;amp;caslib.);
  caslib _ALL_ assign;&lt;/STRONG&gt;

/* load */
proc casutil;
	load data=&amp;amp;libname..&amp;amp;table.
	outcaslib="&amp;amp;caslib." casout="&amp;amp;table." REPLACE;
run;

proc cas;
	loadactionset / actionSet="dataDiscovery";
run;
	dataDiscovery.profile result=r / table={name="&amp;amp;table."},
	casOut={name="Profilazione", replace=true};
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but if i use this it gives me an error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let caslib = AAAA;
%let libname=SASHELP;
%let table=CARS;

&lt;STRONG&gt;  cas;
  libname &amp;amp;caslib. cas caslib=&amp;amp;caslib.;&lt;/STRONG&gt;

/* load */
proc casutil;
	load data=&amp;amp;libname..&amp;amp;table.
	outcaslib="&amp;amp;caslib." casout="&amp;amp;table." REPLACE;
run;

proc cas;
	loadactionset / actionSet="dataDiscovery";
run;
	dataDiscovery.profile result=r / table={name="&amp;amp;table."},
	casOut={name="Profilazione", replace=true};
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just changed the bold part. Instead of allocating all CAS I allocate only one.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The error are:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR: Could not connect to the Hadoop cluster.&lt;BR /&gt;ERROR: Table 'CARS' could not be loaded.&lt;BR /&gt;ERROR: Failure opening table 'CARS': A table could not be loaded.&lt;BR /&gt;ERROR: The action stopped due to errors.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Luca&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 15:14:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/error-dataDiscovery/m-p/884817#M6385</guid>
      <dc:creator>luca87</dc:creator>
      <dc:date>2023-07-14T15:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: error dataDiscovery</title>
      <link>https://communities.sas.com/t5/Developers/error-dataDiscovery/m-p/896928#M6437</link>
      <description>&lt;P&gt;I think it's because you are not &lt;STRONG&gt;specifying the caslib in the dataDiscovery.profile action&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In CAS, you have what's called an active caslib. The active caslib is like your current working directory. &lt;STRONG&gt;If you do not specify a caslib, CAS will use the active caslib.&lt;/STRONG&gt; By default, the &lt;STRONG&gt;Casuser&lt;/STRONG&gt; caslib is typically the active caslib. You can check with this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;
    sessionProp.getSessOpt / name = 'caslib';
quit;&lt;BR /&gt;
/* results */
{caslib=CASUSER(user-name)}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your working code &lt;STRONG&gt;you changed the active caslib in the CAS statement&lt;/STRONG&gt; to the &lt;STRONG&gt;AAAA&lt;/STRONG&gt; caslib. Now if you specify a CAS table without specifying &lt;I&gt;where&amp;nbsp;&lt;/I&gt;the CAS table is, it'll use&amp;nbsp;&lt;STRONG&gt;AAAA by default.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cas mysess sessopts=(caslib=&amp;amp;caslib.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you load the sashelp.cars SAS data set into memory in the &lt;STRONG&gt;AAAA&lt;/STRONG&gt; caslib. Now this data set was loaded to the&amp;nbsp;&lt;STRONG&gt;AAAA&lt;/STRONG&gt; caslib (whatever data source that connects to. Could be a database, path, cloud, etc.). In the CASUTIL code you specified the outcaslib parameter, indicating which caslib you want to load this table to. If you didn't specify the outcaslib parameter, it would &lt;STRONG&gt;use the active caslib.&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc casutil;
	load data=&amp;amp;libname..&amp;amp;table.
	outcaslib="&amp;amp;caslib." casout="&amp;amp;table." REPLACE;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your dataDiscover.profile action you don't specify &lt;STRONG&gt;where the CAS table you want is.&lt;/STRONG&gt; So SAS will use the active caslib by default. In your working code the active caslib is &lt;STRONG&gt;AAAA&lt;/STRONG&gt; since you set it in your CAS statement. In the code that's erroring out my guess is the active caslib is &lt;STRONG&gt;Casuser&lt;/STRONG&gt;, and the CARS table doesn't exist in Casuser.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	dataDiscovery.profile result=r / table={name="&amp;amp;table."},   /* &amp;lt;--where should I look for this table??? SAS will look in the active caslib */
	casOut={name="Profilazione", replace=true};                /* &amp;lt;--where should I create this table??? SAS will use the active caslib */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recommend always specifying the caslib and not relying on the active caslib, even though it's not always required. It's very easy to change the active caslib accidently, and this could cause issues like this. Being explicit avoids these issues and honestly makes your code easier to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is how I would type out the action.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc cas;
	loadactionset / actionSet="dataDiscovery";
run;
	dataDiscovery.profile result=r / 
		table={
			name="&amp;amp;table.",
			caslib="&amp;amp;caslib"   /*Specify input caslib. If this is omitted, the active caslib is used */
		},
		casOut={
			name="Profilazione", 
			caslib="&amp;amp;caslib",   /*Specify output caslib. If this is omitted, the active caslib is used */
			replace=true
		};
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also have a series of blogs on CAS actions. Feel free to check out them out:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sgf/2021/08/06/cas-action-a-series-on-fundamentals/" target="_self"&gt;https://blogs.sas.com/content/sgf/2021/08/06/cas-action-a-series-on-fundamentals/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 12:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/error-dataDiscovery/m-p/896928#M6437</guid>
      <dc:creator>Panagiotis</dc:creator>
      <dc:date>2023-10-03T12:58:28Z</dc:date>
    </item>
  </channel>
</rss>

