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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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