Hi all!
Is there any procedure that can load all datasets from some sas library to CAS lib. (sas viya 3.3)
At this moment I'm using my macrocode in SAS Studio
cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");
%macro loadTableToCas(mvTableNm);
proc casutil;
droptable casdata="&mvTableNm" incaslib="Public" quiet;
run;
proc casutil;
load data=mylib.&mvTableNm outcaslib="Public"
casout="&mvTableNm" PROMOTE ;
run;
%mend loadTableToCas;
libname mylib '/home/sasadmin';
ods output Members=Members;
proc datasets library=mylib memtype=data nodetails;
run;
quit;
Proc sql noprint;
Select cats('%loadTableToCas(',name,')')
Into :mvLoadTableToCas separated by ';'
From work.members;
Quit;
&mvLoadTableToCas;
but maybe there can be another already existing approach - some casutil option.
As I understand it you can assign a LIBNAME to point to a CAS library (not had the chance to use Viya yet). That being the case I see no reason why you couldn't use PROC DATASETS to copy a complete SAS library:
libname MyCASLib cas caslib=casuser;
proc datasets library = MySASLib;
copy out = MyCASLib;
run;
quit;
Thank you for your advice
But I didn't find any promote option as it is in casutil or data step ( promote=yes)
This option makes the tables scope global so that they are available across sessions
OK. This looks similar to what you have to do when loading SAS VA LASR tables. I like your macro approach as I've done a very similar macro for LASR.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.