Loading...
Searching...
No Matches
dc_cassave.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Saves an in-memory CAS table back to persistent storage
4 @details There are three versions of this macro, one per build
5 target. The interface is the same. This version is VIYA and
6 saves the named table back to its original source file.
7 Note that we cannot collect metadata from the APIs (like in
8 mv_castabsave) because the server info may be inacessible to
9 the logged in user
10
11 Running SAS code under a system account (like proc util) DOES
12 work, so we just make the assumption that the source file and
13 library matches the libds.
14
15 @param [in] libds library.dataset of the CAS table to save
16 @param [in] mdebug= (0) Set to 1 to enable verbose logging
17
18 <h4> SAS Macros </h4>
19 @li mf_getengine.sas
20 @li mfv_getcaslib.sas
21
22 @author 4GL Apps Ltd
23 @copyright 4GL Apps Ltd. This code may only be used within Data
24 Controller and may not be re-distributed or re-sold without the
25 express permission of 4GL Apps Ltd.
26**/
27
28%macro dc_cassave(libds, mdebug=0);
29 %local lib eng caslib ds;
30 %let lib=%scan(&libds,1,.);
31 %let eng=%mf_getengine(&lib);
32
33 %if &eng ne CAS %then %return;
34
35 %let caslib=%mfv_getcaslib(lib=&lib);
36 %let ds=%scan(&libds,2,.);
37 %if &mdebug=1 %then %put _local_;
38
39
40 /* ---- save to disk -------------------------------------------------- */
41 proc casutil;
42 save casdata="&ds"
43 incaslib="&caslib"
44 casout="&ds"
45 outcaslib="&caslib"
46 replace;
47 quit;
48 %put NOTE: Table &caslib..&ds saved;
49
50%mend dc_cassave;