BookmarkSubscribeRSS Feed
elisehoo1
Obsidian | Level 7

Hi there,

 

in general , i would like to know

1.how to restore the memory table from sashdat in coding form.

2. how to memory table does not exists but sashdat is available 

 

in the ETL we build, we saved a sashdat physical data each time  some actions performed against the CAS table.  in certain occasions, the memory table flushed out and the ETL did not have the restore process from the sashdat, it treated as new memory table and restart as a new fresh memory table . 

 

to avoid it, i would like to know if any programming or option that i can use in ETL to detect missing 

 

the simple procedures  as now :

step1 if cas  table exists we append the record else new cas table exists we append the record 

step2 save sashdat 

 

the new procedure we would like to do are : 

step1 if there is sashdat table , and in memory table not there , restore first then proceed to step2 .

 

step2 if cas  table exists we append the record else new cas table exists we append the record 

 

step3 save sashdat 

4 REPLIES 4
elisehoo1
Obsidian | Level 7

correctoin 

the simple procedures  as now :

step1 if cas  table exists we append the record to existing cas table else new cas table (promote=yes)

step2 save sashdat 

 

the new procedure we would like to do are : 

step1 if there is sashdat table , and in memory table not there , restore first then proceed to step2 .

 

step2 if cas  table exists we append the record to existing cas table else new cas table (promote=yes)

sbxkoenk
SAS Super FREQ

Hello,

 

To my knowledge, the only thing you can do with a .sashdat file is loading it into memory (in order to do something with it).

But I might be mistaken.

 

Here's how to do that (just one way):

proc cas;
   table.loadtable / path="iris.sashdat" casOut={name="IRIS"};
run; 

To make a .sashdat file , use SAVE statement of PROC CASUTIL, as in here :

SAS 9.4 / Viya 3.5
CAS User’s Guide
CASUTIL Procedure
Example 4: Saving and Loading Encrypted SASHDAT Files

https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/casref/p1et7qytnh6dvbn1urs5rhw5uyf7.htm

 

These .sashdat files can be important indeed because most (UNIX) servers are patched and re-booted like once a month. At these moments memory is purged of course and you lose all your in memory tables.

Loading a table in memory from .sashdat goes muck quicker than from .sas7bdat (in V9 permanent library).

 

Thanks,

Koen

elisehoo1
Obsidian | Level 7
thank you , wondering if there is any code to detect sashdat existence for loading?
sbxkoenk
SAS Super FREQ

Hello,

Choose your incaslib= and look in the dataset work.FileInfo !

cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");

ODS TRACE OFF;
ODS OUTPUT FileInfo=work.FileInfo;
proc casutil incaslib="Public";
 *list tables;
 list files;  run;
QUIT;

cas mySession terminate;

Koen

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Discussion stats
  • 4 replies
  • 1707 views
  • 2 likes
  • 2 in conversation