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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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