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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.