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 open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.