Okay, I created some code that works. But as I said in the original post, I'm sure there is an easier way. I had to drop the table and re-create it to get it to show up in the CAS library in Environment Manager. Here is my solution in case someone else is having difficulties similar to mine.
I appreciate any recommendations anyone has to simplify it.
Thanks!
Jerry
LIBNAME vSYS cas caslib="SystemData";
LIBNAME vAdm cas caslib="AdminDataCAS";
/* 1. this creates a Work table from the contents of the SystemData.Audit table
Some of the columns are not valid SAS names */
proc sql;
create table wrk_audit as
SELECT ID
, 'Time Stamp'n as Timestamp
, Type
, Action
, State
, Description
, 'User ID'n as User_ID
, Application
, 'Remote Address'n as Remote_Address
, URI
FROM vSys.Audit;
quit;
/* 2. Get the current contents of my Audit_History table */
data cur_audit_history;
set vAdm.Audit_History;
run;
/* 3. Combine the tables and remove duplicates */
proc sql;
create table audit_history_nodups as
SELECT *
FROM cur_audit_history
UNION
SELECT *
FROM wrk_audit;
quit;
/* 4. Drop the Audit History table before we re-create it with new data */
proc casutil;
droptable casdata="audit_history"
incaslib="AdminDataCAS";
quit;
/* 5. Add new records to the Audit_History table */
proc casutil;
load data=audit_history_nodups
casout="Audit_History" outcaslib="AdminDataCAS"
promote
;
quit;
/* 6. Create a .sashdat file from the memory version. */
proc casutil;
save casdata="Audit_History" /* This is the input table to be saved */
incaslib="AdminDataCAS" outcaslib="AdminDataCAS"
casout="Audit_History" replace; /* This is the outut file */
/* use replace in case the file exists */
quit;
... View more