BookmarkSubscribeRSS Feed
BeNur
Obsidian | Level 7

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.

 

 

 

3 REPLIES 3
SASKiwi
PROC Star

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;
BeNur
Obsidian | Level 7

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 

SASKiwi
PROC Star

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.

sas-innovate-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 3 replies
  • 1586 views
  • 2 likes
  • 2 in conversation