BookmarkSubscribeRSS Feed
vallsas
Pyrite | Level 9

Hi All,

I have created a program to load the data to update the table in cas as in-memory but while job is executing the report show no data source, then after executing the job if I refresh the report then message disappears.

how to avoid this error while updating the cas table users will be using the report so they should not effect.

1 REPLY 1
Stu_SAS
SAS Employee

Hey @vallsas! There is a way you can minimize the impact to reports by changing how you load and promote your data. 

 

Typically when people update a report, they do the following order of operations:

  • Drop the old table
  • Load and promote the new table

While the old table is dropped, the report is unavailable. This is fine if the report updates in the middle of the night, but can result in a lot of questions during working hours.

 

An alternative is to load the updated table to a temporary caslib, drop the old table, then promote the new table. Promoting is very fast, even for large tables. What you'll do instead is:

  • Load the new table to CASUSER
  • Drop the old table
  • Promote the new table from CASUSER to your final caslib

The downside is you'll temporarily have two copies of the table in memory at once. If you have a lot of memory or if the table is small then this shouldn't be a problem.

 

Your code will look like this:

cas;
caslib _ALL_ assign;

proc casutil;
    load data=have casdata='have' outcaslib='casuser';
    droptable      casdata='have' incaslib='mycaslib';
    promote        casdata='have' incaslib='casuser'  outcaslib='mycaslib';
    save           casdata='have' incaslib='mycaslib' outcaslib='mycaslib';
quit;

 

Let's test it out using a sample dataset with 100 million rows:

cas;
caslib _ALL_ assign;

data have;
	do i = 1 to 100000000;
		output;
	end;
run;

data casuser.have;
	set have;
run;

 

Checking the log, this took about 21 seconds to load to CAS:

NOTE: There were 100000000 observations read from the data set WORK.HAVE.
NOTE: The data set CASUSER.HAVE has 100000000 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           20.83 seconds
      cpu time            18.45 seconds

 

Let's take this table that's already in CASUSER and promote it to Public:

proc casutil;
	promote casdata='have' incaslib='casuser' outcaslib='public';
run;

 

Finally, let's check the log:

NOTE: Cloud Analytic Services promoted table HAVE in caslib CASUSER to table have in caslib public.
NOTE: The Cloud Analytic Services server processed the request in 0.160539 seconds.

 

It didn't even take one second to move the data between caslibs! If reducing downtime is your goal, loading to CASUSER first and then promoting to your final caslib is the way to go. Just be sure you have the memory to do it.

 

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 1 reply
  • 836 views
  • 2 likes
  • 2 in conversation