BookmarkSubscribeRSS Feed
ROY30426
Obsidian | Level 7

Hi Experts,

After reading this blog, I have successfully promote my data from the disk or other Database . I have configured the connection between Viya and remote LASR server on SAS Environment Manager and It works fine if I promote the LASR table using SAS Environment Manager . Now i'm trying to promote LASR table to CAS library with sas code and schedule it to update data daily.

Does anyone know how to do promote remote LASR table to CAS using sas code?

Many Thanks,

Roy

未命名.png

5 REPLIES 5
ROY30426
Obsidian | Level 7

Hi @alexal,

Thanks for the reply. 

I have tried the code you mentioned before , but still failed to promote the table to global level. Below is the issue I'm trying to solve.

 

  • This is the CAS library connect to remote LASR server.

 2.png

 

  • I want to promote LASR table :VA_SAMPLE_TELCO03(I can promote other LASR table using SAS environment manager on browser, but i want to promote it using sas code. )1.png

 

  • There is the error message when I using promote action.
cas mySession2 sessopts=(caslib=casuser timeout=1800 locale="en_US");
cas; 
caslib _all_ assign;

proc cas;
table.promote  /
caslib="valasr2"
drop=TRUE 
name="VA_SAMPLE_TELCO03"
target="lasr_test2"
targetLib="public"
;
run;
NOTE: Active Session now MYSESSION2.
ERROR: There is no session-scope table VA_SAMPLE_TELCO03 in caslib valasr2 of Cloud Analytic Services.
ERROR: The action stopped due to errors.
86
87
88 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
101
 
 
 
 
alexal
SAS Employee

@ROY30426,

 

I would like to review an output from the following piece of code:

 

proc contents data=valasr2._all_ nods; run;
ROY30426
Obsidian | Level 7

Hi @alexal,

Here is the result. I found the scope status showed "global" on the table which was promoted in sas environment manager. I'm curious about why table called  "VA_SAMPLE_TELCO03"  (which was  loaded in LASR Server) didn't show in the scope status result and I want to promote that table thru SAS code. The reason I want to using sas code to promote LASR table is that I would like to scheduled it thru crontab job on viya server to keep the data up-to-date.

Thanks!

Roy.  

test.png 

MikeMcKiernan
SAS Employee

If you are OK using PROC CAS and CASL, then check the output of the table.fileInfo action.

 

 

proc cas;
  table.fileInfo / caslib="valasr2";
quit;

That should list the tables that are in-memory on your LASR server.  Those are the candidates to transfer into CAS with the table.loadTable action.  This might do it, assuming you find VA_SAMPLE_TELCO03 in the results of the fileInfo action.

 

proc cas;
  table.loadTable /
    file="VA_SAMPLE_TELCO03"
    caslib="valasr2"
    /* I assume you want to rename the table to LASR_TEST2... */
    casOut={name="lasr_test2" caslib="public"};
run;

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2257 views
  • 0 likes
  • 3 in conversation