BookmarkSubscribeRSS Feed
y1234
Calcite | Level 5

I use the following options when creating a CAS table with the Query step in a SAS Studio flow:

pic01.jpg

 

 

 

 

 

 

 

 

 

 

The generated code correctly performs the droptable, create table, and save casdata (replace) actions.

/* Delete existing session-scope and global-scope tables cas.cas_table by using two delete statements. */
proc casutil;
   droptable casdata="cas_table" incaslib="cas" quiet;
   droptable casdata="cas_table" incaslib="cas" quiet;
quit;

PROC SQL;
   CREATE TABLE cas.cas_table (promote=yes) AS
   SELECT 
      ...
   FROM
      WORK.t111 t1
   ;
QUIT;
RUN;

/* Create a permanent copy of the in-memory table cas.cas_table */
proc casutil incaslib="cas" outcaslib="cas";
   save casdata="cas_table" replace;
quit;

However, a problem occurs when a user opens a Visual Analytics report at the same time the table‑update script is running:

  1. The script deletes the CAS table from memory.
  2. A user opens the VA report.
  3. VA automatically loads the previous physical table from disk back into memory.
  4. The script then attempts to create and promote the table, but VA has already promoted it, causing the error:
    “The target table table_name of the promotion already exists. Please specify a different name.”

What is the best way to avoid conflicts between SAS Studio code and Visual Analytics? Scheduling the job outside business hours is not an option.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 363 views
  • 0 likes
  • 1 in conversation