Loading...
Searching...
No Matches
refreshlibinfo.sas
Go to the documentation of this file.
1/**
2 @file refreshlibinfo.sas
3 @brief Refresh the Data Catalog for a particular library
4 @details When showing library info in the VIEW menu, the data is taken from
5 the Data Catalog tables. These may be empty or outdated, and so this service
6 allows end users to run a refresh of the data.
7
8 <h4> Service Inputs </h4>
9 <h5> lib2refresh </h5>
10 Should contain the libref to be refreshed.
11 |libref:$8.|
12 |---|
13 |SOMELIB|
14
15 <h4> Service Outputs </h4>
16
17 <h5> libinfo </h5>
18
19 |engine $|libname $|paths $|perms $|owners $|schemas $ |libid $|libsize $|table_cnt |
20 |---|---|---|---|---|---|---|---|---|
21 |V9|SOMELIB|"some/path"|rwxrwxr-x|sassrv|` `|` `|636MB|33|
22
23 <h4> SAS Macros </h4>
24 @li dc_assignlib.sas
25 @li dc_refreshcatalog.sas
26 @li mp_abort.sas
27
28 @version 9.3
29 @author 4GL Apps Ltd
30 @copyright 4GL Apps Ltd. This code may only be used within Data Controller
31 and may not be re-distributed or re-sold without the express permission of
32 4GL Apps Ltd.
33
34 @sasjslint {"maxLineLength": 87}
35
36**/
37
38
39%mpeinit()
40
41%webout(FETCH)
42
43%mp_abort(iftrue= (&syscc ne 0)
44 ,msg=%str(syscc=&syscc Problem on startup)
45)
46
47%let libref=;
48data _null_;
49 set work.lib2refresh;
50 call symputx('libref',libref);
51run;
52
53%mp_abort(iftrue= (&syscc ne 0)
54 ,msg=%str(syscc=&syscc Problem with inputs - was lib2refresh object sent?)
55)
56
57%dc_assignlib(WRITE,&libref)
58
59%mp_abort(iftrue= (&syscc ne 0)
60 ,msg=%str(syscc=&syscc after lib assignment)
61)
62
63%dc_refreshcatalog(&libref)
64
65%mp_abort(iftrue= (&syscc ne 0)
66 ,msg=%str(syscc=&syscc Problem when running the catalog refresh)
67)
68
69/* get libinfo */
70proc sql;
71create table work.libinfo as
72 select a.engine,
73 a.libname,
74 a.paths,
75 a.perms,
76 a.owners,
77 a.schemas,
78 a.libid,
79 b.libsize,
80 b.table_cnt,
81 b.catalog_cnt
82 from &mpelib..mpe_datacatalog_libs(where=(&dc_dttmtfmt. lt tx_to)) a
83 inner join &mpelib..mpe_datastatus_libs(where=(&dc_dttmtfmt. lt tx_to)) b
84 on a.libref=b.libref
85 where a.libref="&libref";
86
87%webout(OPEN)
88%webout(OBJ,libinfo)
89%webout(CLOSE)