-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.sas
60 lines (46 loc) · 1.44 KB
/
main.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
53
54
55
56
57
58
59
/*
main.sas is the starting execution point for your project
Specify which macros to include and then put them in
the order you would like them submitted in %main
*/
* You must change project_root. Be sure to include the trailing delimiter:
unix example: /my/project/root/
window example: c:\my\project\root\
;
%let project_root = C:\Data\wuss2012\git\projects\sas-empty-project\;
%*let mode = PROD; %let mode = TEST;
filename logger "&project_root.log\logger.txt";
data _null_;
file logger;
put "Running project.";
run;
%include "&project_root.config/options.sas";
%include "&project_root.config/global_macro_variables.sas";
filename macros "&project_root.macros";
* sets up an aggregate fileref to be used in subsequent %include stmt;
/*
Example:
If your macros directory contains three files:
calculate_sales.sas
update.sas
finalize.sas
Then your %include statement looks like:
%include macros( calculate_sales, update, finalize);
*/
%include macros(test_suite); * add your own comma, separated;
filename libnames "&project_root.libnames";
/* include libname file the same way as macro */
%include libnames(defaults); * add your own comma,separated;
%macro main;
%if &mode = TEST %then %goto test;
/* name your macros in the order you want them executed
Example:
%calculate_sales;
%update(for_sure=YES);
%finalize;
*/
%return;
%test:
%test_suite;
%mend main;
%main;