I cannot see all the tables inside a caslib I already created on the Viya GUI.
When I click on "Manage Environment" -> "Data" -> "Data Sources" -> the appropriate server name -> the specific caslib of interest, I can see all the unloaded tables within that caslib, as well as the caslib's attributes (e.g. name, description, server, source type, personal, odbc dsn, schema, catalog, authetication domain).
However, when I try listing all the tables inside the caslib in the code editor (see codes below) or use the Viya GUI ("SAS Develop Codes" -> "Libraries" -> the caslib of interest), I see no tables listed:
libname mycas cas caslib="CAS_LIB_OF_INTEREST";
proc datasets lib=mycas;
run;
In fact, in the log, I get "WARNING: No matching members in directory." Could you please let me know what's happening?
Observation 1. I will get the following, after running caslib "CAS_LIB_OF_INTEREST" list;
Within a CASlib there are two areas for data:
Using the CAS libname engine you can only see the tables (data loaded into memory) but not the files.
To have a look at both, you can use the code below:
proc casutil incaslib="Public";
list files;
list tables;
quit;
The way you loaded the data into memory created a session scope table, so it is only visible to the specific CAS session that created the data.
To create a global scope table (promoted table) use this code sample:
proc casutil ;
/* need to drop a global scoped table */
droptable incaslib="Public" casdata="cars" quiet;
/* now load the table, in this we use a SAS data set */
load data=sashelp.cars outcaslib="Public" casout="cars" promote;
quit;
Within a CASlib there are two areas for data:
Using the CAS libname engine you can only see the tables (data loaded into memory) but not the files.
To have a look at both, you can use the code below:
proc casutil incaslib="Public";
list files;
list tables;
quit;
The way you loaded the data into memory created a session scope table, so it is only visible to the specific CAS session that created the data.
To create a global scope table (promoted table) use this code sample:
proc casutil ;
/* need to drop a global scoped table */
droptable incaslib="Public" casdata="cars" quiet;
/* now load the table, in this we use a SAS data set */
load data=sashelp.cars outcaslib="Public" casout="cars" promote;
quit;
Thank you! I am trying to promote the table. However, I got an error saying I can't promote the table because I am working in a local session. So I added an extra argument in red, which gave me an error (ERROR: The CASLIB statement = parameter is invalid or missing. Correct the statement parameter).
%LET caslib_path = "/disk/path...";
caslib myCaslib datasource=(srctype="path") path=&caslib_path sessref=mySession LIBREF= myCaslib local= No;
However, running the above codes gave me an error:
/*4. load data into memory*/
proc casutil;
load casdata="TABLE_OF_INTEREST" incaslib= "MyCaslib"
outcaslib = "OUT_CASLIB_NAME" casout ="TABLE_OF_INTEREST" promote;
run;
*errors are as below;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!