-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharceddataflow.ado
179 lines (143 loc) · 13.2 KB
/
arceddataflow.ado
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
*! version 1.0.1 Mehrab Ali 17jun2023
cap prog drop arceddataflow
program arceddataflow
version 12
**# Define syntax
*-------------------------------------------------------------------------------
syntax, DOfiles(string) CORRection(string) [author(string) email(string) project(string)]
* Copy do files
copy "https://github.com/ARCED-Foundation/arceddataflow/raw/master/dos/00_master.do" ///
"`dofiles'/00_master.do"
copy "https://github.com/ARCED-Foundation/arceddataflow/raw/master/dos/01_setup.do" ///
"`dofiles'/01_setup.do"
copy "https://github.com/ARCED-Foundation/arceddataflow/raw/master/dos/02_import.do" ///
"`dofiles'/02_import.do"
copy "https://github.com/ARCED-Foundation/arceddataflow/raw/master/dos/03_prep.do" ///
"`dofiles'/03_prep.do"
copy "https://github.com/ARCED-Foundation/arceddataflow/raw/master/dos/04_checks.do" ///
"`dofiles'/04_checks.do"
copy "https://github.com/ARCED-Foundation/arceddataflow/raw/master/assets/Correction_sheet.xlsx" ///
"`correction'/Correction_sheet.xlsx"
**# Edit headers
*-------------------------------------------------------------------------------
* 00_master.do
file open setup using "`dofiles'/00_master.do", read write
file seek setup 4
file write setup ///
_col(200) "/*" _n /// /*
_col(1) "╔═══════════════════════════════════════════════════════════════════════════════╗" _n ///
_col(1) "║" _col(19) "__" _col(23) "__" _col(27) "___" _col(31) "__" _col(38) "_____" _col(53) "__" _col(59) "___" _col(63) "__" _col(83) "║" _n ///
_col(1) "║" _col(15) "/\ |__)/ `|__ | \ |__/ \| ||\ || \ /\ ||/ \|\ |" _col(83) "║" _n ///
_col(1) "║" _col(14) "/~~\| \\__,|___|__/ | \__/\__/| \||__//~~\||\__/| \|" _col(83) "║" _n ///
_col(1) "║" _col(13) "www.arced.foundation; https://github.com/ARCED-Foundation" _col(83) "║" _n ///
_col(1) "║" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "TITLE:" _col(22) "00_master.do" _col(83) "║" _n ///
_col(1) "║" _col(6) "PROJECT:" _col(22) "`project'" _col(83) "║" _n ///
_col(1) "║" _col(6) "PURPOSE:" _col(22) "Master do file for dataflow " _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "AUTHOR:" _col(22) "`author'" _col(83) "║" _n ///
_col(1) "║" _col(6) "CONTACT:" _col(22) "`email'" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "CREATED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "║" _col(6) "MODIFIED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "╚═══════════════════════════════════════════════════════════════════════════════╝" _n ///
_col(200) "*/" _n
file close setup
* 01_Setup.do
file open setup using "`dofiles'/01_setup.do", read write
file seek setup 1
file write setup ///
_col(200) "/*" _n /// /*
_col(1) "╔═══════════════════════════════════════════════════════════════════════════════╗" _n ///
_col(1) "║" _col(19) "__" _col(23) "__" _col(27) "___" _col(31) "__" _col(38) "_____" _col(53) "__" _col(59) "___" _col(63) "__" _col(83) "║" _n ///
_col(1) "║" _col(15) "/\ |__)/ `|__ | \ |__/ \| ||\ || \ /\ ||/ \|\ |" _col(83) "║" _n ///
_col(1) "║" _col(14) "/~~\| \\__,|___|__/ | \__/\__/| \||__//~~\||\__/| \|" _col(83) "║" _n ///
_col(1) "║" _col(13) "www.arced.foundation; https://github.com/ARCED-Foundation" _col(83) "║" _n ///
_col(1) "║" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "TITLE:" _col(22) "01_setup.do" _col(83) "║" _n ///
_col(1) "║" _col(6) "PROJECT:" _col(22) "`project'" _col(83) "║" _n ///
_col(1) "║" _col(6) "PURPOSE:" _col(22) "All setup for the Data Flow " _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "AUTHOR:" _col(22) "`author'" _col(83) "║" _n ///
_col(1) "║" _col(6) "CONTACT:" _col(22) "`email'" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "CREATED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "║" _col(6) "MODIFIED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "╚═══════════════════════════════════════════════════════════════════════════════╝" _n ///
_col(200) "*/" _n
file close setup
* 02_import.do
file open setup using "`dofiles'/02_import.do", read write
file seek setup 1
file write setup ///
_col(200) "/*" _n /// /*
_col(1) "╔═══════════════════════════════════════════════════════════════════════════════╗" _n ///
_col(1) "║" _col(19) "__" _col(23) "__" _col(27) "___" _col(31) "__" _col(38) "_____" _col(53) "__" _col(59) "___" _col(63) "__" _col(83) "║" _n ///
_col(1) "║" _col(15) "/\ |__)/ `|__ | \ |__/ \| ||\ || \ /\ ||/ \|\ |" _col(83) "║" _n ///
_col(1) "║" _col(14) "/~~\| \\__,|___|__/ | \__/\__/| \||__//~~\||\__/| \|" _col(83) "║" _n ///
_col(1) "║" _col(13) "www.arced.foundation; https://github.com/ARCED-Foundation" _col(83) "║" _n ///
_col(1) "║" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "TITLE:" _col(22) "02_import.do" _col(83) "║" _n ///
_col(1) "║" _col(6) "PROJECT:" _col(22) "`project'" _col(83) "║" _n ///
_col(1) "║" _col(6) "PURPOSE:" _col(22) "Import, label and deidentify data " _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "AUTHOR:" _col(22) "`author'" _col(83) "║" _n ///
_col(1) "║" _col(6) "CONTACT:" _col(22) "`email'" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "CREATED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "║" _col(6) "MODIFIED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "╚═══════════════════════════════════════════════════════════════════════════════╝" _n ///
_col(200) "*/" _n
file close setup
* 03_prep.do
file open setup using "`dofiles'/03_prep.do", read write
file seek setup 1
file write setup ///
_col(200) "/*" _n /// /*
_col(1) "╔═══════════════════════════════════════════════════════════════════════════════╗" _n ///
_col(1) "║" _col(19) "__" _col(23) "__" _col(27) "___" _col(31) "__" _col(38) "_____" _col(53) "__" _col(59) "___" _col(63) "__" _col(83) "║" _n ///
_col(1) "║" _col(15) "/\ |__)/ `|__ | \ |__/ \| ||\ || \ /\ ||/ \|\ |" _col(83) "║" _n ///
_col(1) "║" _col(14) "/~~\| \\__,|___|__/ | \__/\__/| \||__//~~\||\__/| \|" _col(83) "║" _n ///
_col(1) "║" _col(13) "www.arced.foundation; https://github.com/ARCED-Foundation" _col(83) "║" _n ///
_col(1) "║" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "TITLE:" _col(22) "03_prep.do" _col(83) "║" _n ///
_col(1) "║" _col(6) "PROJECT:" _col(22) "`project'" _col(83) "║" _n ///
_col(1) "║" _col(6) "PURPOSE:" _col(22) "Prepare and clean data " _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "AUTHOR:" _col(22) "`author'" _col(83) "║" _n ///
_col(1) "║" _col(6) "CONTACT:" _col(22) "`email'" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "CREATED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "║" _col(6) "MODIFIED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "╚═══════════════════════════════════════════════════════════════════════════════╝" _n ///
_col(200) "*/" _n
file close setup
* 04_checks.do
file open setup using "`dofiles'/04_checks.do", read write
file seek setup 1
file write setup ///
_col(200) "/*" _n /// /*
_col(1) "╔═══════════════════════════════════════════════════════════════════════════════╗" _n ///
_col(1) "║" _col(19) "__" _col(23) "__" _col(27) "___" _col(31) "__" _col(38) "_____" _col(53) "__" _col(59) "___" _col(63) "__" _col(83) "║" _n ///
_col(1) "║" _col(15) "/\ |__)/ `|__ | \ |__/ \| ||\ || \ /\ ||/ \|\ |" _col(83) "║" _n ///
_col(1) "║" _col(14) "/~~\| \\__,|___|__/ | \__/\__/| \||__//~~\||\__/| \|" _col(83) "║" _n ///
_col(1) "║" _col(13) "www.arced.foundation; https://github.com/ARCED-Foundation" _col(83) "║" _n ///
_col(1) "║" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "TITLE:" _col(22) "04_checks.do" _col(83) "║" _n ///
_col(1) "║" _col(6) "PROJECT:" _col(22) "`project'" _col(83) "║" _n ///
_col(1) "║" _col(6) "PURPOSE:" _col(22) "Data check " _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "AUTHOR:" _col(22) "`author'" _col(83) "║" _n ///
_col(1) "║" _col(6) "CONTACT:" _col(22) "`email'" _col(83) "║" _n ///
_col(1) "║-------------------------------------------------------------------------------║" _n ///
_col(1) "║" _col(6) "CREATED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "║" _col(6) "MODIFIED:" _col(22) "`c(current_date)'" _col(83) "║" _n ///
_col(1) "╚═══════════════════════════════════════════════════════════════════════════════╝" _n ///
_col(200) "*/" _n
file close setup
end