BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bkv_nextbridge
Calcite | Level 5

Hi.

I am new to Viya.

I have one URL to SAS Studio and another for VA and SAS Environment Manager. They both point to the same server and I log on to both with the same credentials.

 

The CASUSER Library that I have in Studio is not the same as the CASUSER Library I have in VA and Environment Manager. The disk portion of the libraries are in different folders. 

I can use Studio to load  a table into CASUSER, but this table will not be available to me in VA. And if I load a table into CASUSER on the SAS Environment Manager, it is not reachable in Studio.  Is that how it is supposed to be? 

 

Regards,

Bjørn

1 ACCEPTED SOLUTION

Accepted Solutions
alexal
SAS Employee

@bkv_nextbridge,

 

You have to use PROMOTE Statement in CASUTIL procedure. The PROMOTE statement copies a session-scope table to global scope.

 

Documentation: SAS® 9.4 and SAS® Viya® 3.3 Programming Documentation -> CAS User’s Guide -> CASUTIL Procedure -> PR...

 

Example 3: Promote a Table

 

caslib hps datasource=(srctype="path") path="/hps" global;

cas casauto sessopts=(caslib="casuser");

libname mycas cas;

proc casutil;
   load data=sashelp.iris casout="irisraw";
quit;

data mycas.irisout;                                   
   set mycas.irisraw;
   sepalratio = sepalwidth / sepallength;
   petalratio = petalwidth / petallength;
run;

/*
 * The purpose for outcaslib= is to show how to 
 * work with more than one caslib.
 */
proc casutil outcaslib="hps";                         
   promote casdata="irisout";
quit;

proc casutil incaslib="hps";
   contents casdata="irisout";
quit;

View solution in original post

1 REPLY 1
alexal
SAS Employee

@bkv_nextbridge,

 

You have to use PROMOTE Statement in CASUTIL procedure. The PROMOTE statement copies a session-scope table to global scope.

 

Documentation: SAS® 9.4 and SAS® Viya® 3.3 Programming Documentation -> CAS User’s Guide -> CASUTIL Procedure -> PR...

 

Example 3: Promote a Table

 

caslib hps datasource=(srctype="path") path="/hps" global;

cas casauto sessopts=(caslib="casuser");

libname mycas cas;

proc casutil;
   load data=sashelp.iris casout="irisraw";
quit;

data mycas.irisout;                                   
   set mycas.irisraw;
   sepalratio = sepalwidth / sepallength;
   petalratio = petalwidth / petallength;
run;

/*
 * The purpose for outcaslib= is to show how to 
 * work with more than one caslib.
 */
proc casutil outcaslib="hps";                         
   promote casdata="irisout";
quit;

proc casutil incaslib="hps";
   contents casdata="irisout";
quit;

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Discussion stats
  • 1 reply
  • 3053 views
  • 1 like
  • 2 in conversation