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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 2640 views
  • 2 likes
  • 2 in conversation