forked from my-liangqiongyue/generic-sas-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadata analysis file.sas
52 lines (39 loc) · 1.37 KB
/
metadata analysis file.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
dm 'odsresults; clear; log; clear; out; clear';
* to remove all datasets from within the WORK folder;
proc datasets lib=work nolist kill; quit; run;
* set working directory;
%let dir=C:\NHANES III\SAS;
* set output directory;
%let outdir=&dir.\output\tables;
* print log to file;
proc printto log="&dir.\output\logs\metadata log file.txt" new; run;
* track program run time;
* program start time;
%let datetime_start = %sysfunc(TIME()) ;
%put START TIME: %sysfunc(datetime(),datetime14.);
* load data setup file;
%include "&dir.\setup\setup.sas";
* load required macros;
%include "&dir.\macros\metadata.sas";
* data steps ...;
data clean_nhanes;
set clean_nhanes;
* data statements;
run;
* call main macro;
option mlogic mprint symbolgen;
* define input/output parameters;
%let _outdir = &outdir;
%let _tablename = nhanes_metadata;
%let _studyname = NHANES;
%let _tabletitle = Appendix 1: National Health and Nutrition Examination Survey (&_studyname) Data Dictionary;
%metadata(_dataset = clean_nhanes,
_missval = -100,
_outdir = &_outdir.,
_studyname = &_studyname.,
_tablename = &_tablename.,
_tabletitle = &_tabletitle.);
* program end time;
%put END TIME: %sysfunc(datetime(),datetime14.);
%put PROCESSING TIME: %sysfunc(putn(%sysevalf(%sysfunc(TIME())-&datetime_start.),mmss.)) (mm:ss);
proc printto; run;