1

I want to truncate the table instead of drop the table when it run the code. How can I change the code, from drop existing table to truncate table? In SAS LASR table, there is a line of code like below :

/* Drop existing table */
%vdb_dt(LIBNAME.TARGETLASRTABLE);

The reason to do that, because when the table and the report designer reload at the same time, it will cause the report designer in SAS VA prompt error message "The data source (TARGETLASRTABLE) is no longer accessible, or has been replaced. Would you like to select a new data source?".

Because the table is drop in the code, therefore the prompt message will appear. to avoid the prompt message, I would like to change the drop statement to truncate statement. Is there any way to write the truncate statement code to replace drop existing table? Please help, thank you.

fl0r3k
  • 619
  • 5
  • 9
Arzozeus
  • 103
  • 2
  • 11

1 Answers1

0

There is a procedure that is designed to manage data in SAS LASR Server. It is called IMSTAT from In-Memory Statistics. It can also perform statistical and predictive modeling operations.

But returning to your question. You can use IMSTAT procedure to truncate table.

/*LASR table truncation*/
proc imstat;
   table vadst.productanalysis;
   deleterows;
   deleterows / purge;
   run;
quit;

/*appending data to existing LASR table*/
data vadst.productanalysis(append=yes);
   set vasrc.productanalysis;
run;

table vadst.productanalysis; - selects LASR table to operate on.

deleterows; - marks all rows for deletion if no WHERE clause is active. You can undelete them.

deleterows / purge; - specifies to remove from memory the rows that are marked for deletion. The memory that was used by the rows is freed.

If you are working a lot on LASR Server and in memory tables I suggest to get familiar with this procedure. Here is documentation: SAS® LASR™ Analytic Server 2.7

fl0r3k
  • 619
  • 5
  • 9