mpe_dsmeta.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Gets table metadata
4  @details Runs mp_dsmeta and adds datadictionary info
5 
6  <h4> SAS Macros </h4>
7  @li mp_dsmeta.sas
8 
9  @version 9.2
10  @author 4GL Apps Ltd
11  @copyright 4GL Apps Ltd. This code may only be used within Data Controller
12  and may not be re-distributed or re-sold without the express permission of
13  4GL Apps Ltd.
14 **/
15 
16 %macro mpe_dsmeta(libds, outds=dsmeta);
17  %local ddsd ddld notes lenstmt;
18  %let lenstmt=length ods_table $18 name $100 value $1000;
19  %let libds=%upcase(&libds);
20  %mp_dsmeta(&libds, outds=&outds)
21 
22  data _null_;
23  set &mpelib..mpe_datadictionary;
24  where &dc_dttmtfmt < tx_to & dd_source=%upcase("&libds") & dd_type='TABLE';
25  call symputx('ddsd',dd_shortdesc,'l');
26  call symputx('ddld',dd_longdesc,'l');
27  run;
28 
29  data &outds;
30  &lenstmt;
31  if last then do;
32  ODS_TABLE='MPE_DATADICTIONARY';
33  NAME='DD_SHORTDESC';
34  VALUE="&ddsd";
35  output;
36  NAME='DD_LONGDESC';
37  VALUE="&ddld";
38  output;
39  end;
40  set &outds end=last;
41  output;
42  run;
43 
44  data _data_;
45  set &mpelib..mpe_tables;
46  where libref="%scan(&libds,1,.)"
47  & dsn="%scan(&libds,2,.)"
48  & &dc_dttmtfmt<tx_to;
49  &lenstmt;
50  ODS_TABLE='MPE_TABLES';
51  array c _character_;
52  array n _numeric_;
53  do over c;
54  name=upcase(vname(c));
55  value=c;
56  output;
57  end;
58  do over n;
59  name=upcase(vname(n));
60  value=cats(n);
61  output;
62  end;
63  keep ods_table name value;
64  run;
65 
66  proc append base=&outds data=&syslast;
67  run;
68 
69 
70 %mend mpe_dsmeta;