BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wwhitner0
Calcite | Level 5

I have been working on the code below to obtain cases for cath, cabg, pci, hyper, obes, diab as well as conduct frequencies and chi-square analysis.  However, I have not been successful in keeping the cagb, pci, hyper, obes, and diab variables after running the arrays. Based on my code and the log, can anyone please tell me why these new variables are not showing up to run the frequencies, etc.? I am trying to set these variables up for a logistical regression model. 

 


/*create library using mydata and the folder*/
libname mydata"/home/wwhitner0/Cardio";
data new; set mydata.mdahos;
if age_yrs <= 35 then Agegroup=1;
else if age_yrs <=44 then Agegroup=2;
else if age_yrs <=54 then Agegroup=3;
else if age_yrs <=64 then agegroup=4;
else if age_yrs <=74 then agegroup=4;
else if age_yrs >=75 then agegroup=5;

if race=1 then _race=1;
else if race=2 then _race=2;

if payer1=01 then payer=1;
else if payer1=02 then payer=2;
else if payer1=04 then payer=4;
else if payer1=05 then payer=5;
else if payer1=08 then payer=8;
else if payer1=12 then payer=12;
run;

proc freq; tables agegroup payer _race;
run;

data new; set mydata.mdahos;

cath=0;
array _CATH (15) proc_1-proc_15;
do i=1 to 15;
if _CATH (i) >=3721 and _cath (i) <=3723
then CATH=1;
if _Cath(i) >=8850 and _cath(i)<=8858
then cath=1;

end;
drop i;
run;

proc freq data=new;
tables cath;
run;


data new; set mydata.mdahos;
CABG=0;
array _CABG (15) proc_1-proc_15;
do i=1 to 15;
if _CABG (i) >=3610 and _CABG (i) <=3620
then CABG=1;

end;
drop i;
run;

proc freq data =new;
tables cabg;
run;



data new; set mydata.mdahos;
PCI=0;
array _PCI (15) proc_1-proc_15;
do i=1 to 15;
if _PCI (i) >=3600 and _PCI (i) <=3606
then PCI=1;

end;
drop i;
run;

proc freq data=new;
tables pci;
run;

data new; set mydata.mdahos;
hyper=0;
array _hyper (15) diag1-diag15;
do i=1 to 15;
if _hyper (i) >=4019 and _hyper (i) <=40291
then hyper=1;
if _hyper(i) >=4050 and _hyper(i)<=40599
then hyper=1;

end;
drop i;
run;


proc freq data=new;
tables hyper;
run;

data new; set mydata.mdahos;
Obes=0;
array _obes (15) diag1-diag15;
do i=1 to 15;
if _obes (i) >=2780 and _obes (i) <=27802
then obes=1;

end;
drop i;
run;

proc freq data=new;
tables obes;
run;

data new; set mydata.mdahos;
diab=0;
array _diab (15) diag1-diag15;
do i=1 to 15;
if _diab (i) >=25000 and _diab (i) <=25002
then diab=1;
if _diab(i) >=25010 and _diab(i)<=25012
then PCI=1;

end;
drop i;
run;

proc freq data=new;
tables diab;
run;



proc freq data=new;
proc freq; tables agegroup _race payer;
proc freq; tables payer* _race;
proc freq; tables cath * payer * _race;
proc freq; tables cabg * payer * _race;
proc freq; tables PCI * payer * _race;
proc freq; tables obes*cath;
proc freq; tables obes*cabg;
proc freq; tables obes*pci;
proc freq; tables hyper*cath;
proc freq; tables hyper*cabg;
proc freq; tables hyper*pci;
proc freq; tables diab*cath;
proc freq; tables diab*cabg;
proc freq; tables diab*pci;
proc freq; tables payer* _race / chisq relrisk cl;
proc freq; tables cath * payer * _race / chisq relrisk cl;
proc freq; tables cabg * payer * _race / chisq relrisk cl;
proc freq; tables PCI * payer * _race / chisq relrisk cl;
proc freq; tables obes*cath / chisq relrisk cl;
proc freq; tables obes*cabg / chisq relrisk cl;
proc freq; tables obes*pci / chisq relrisk cl;
proc freq; tables hyper*cath / chisq relrisk cl;
proc freq; tables hyper*cabg / chisq relrisk cl;
proc freq; tables hyper*pci / chisq relrisk cl;
proc freq; tables diab*cath / chisq relrisk cl;
proc freq; tables diab*cabg / chisq relrisk cl;
proc freq; tables diab*pci / chisq relrisk cl;
proc freq; tables agegroup*obes/chisq relrisk cl;
proc freq; tables agegroup*hyper/chisq relrisk cl;
proc freq; tables agegroup*diab/chisq relrisk cl;
proc freq; tables obes*_race/chisq relrisk cl;
proc freq; tables hyper*_race/chisq relrisk cl;
proc freq; tables diab*_race/chisq relrisk cl;
run;


 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71
72 /*create library using mydata and the folder*/
73 libname mydata"/home/wwhitner0/Cardio";
NOTE: Libref MYDATA was successfully assigned as follows:
Engine: V9
Physical Name: /home/wwhitner0/Cardio
74 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
75 if age_yrs <= 35 then Agegroup=1;
76 else if age_yrs <=44 then Agegroup=2;
77 else if age_yrs <=54 then Agegroup=3;
78 else if age_yrs <=64 then agegroup=4;
79 else if age_yrs <=74 then agegroup=4;
80 else if age_yrs >=75 then agegroup=5;
81
82 if race=1 then _race=1;
83 else if race=2 then _race=2;
84
85 if payer1=01 then payer=1;
86 else if payer1=02 then payer=2;
87 else if payer1=04 then payer=4;
88 else if payer1=05 then payer=5;
89 else if payer1=08 then payer=8;
90 else if payer1=12 then payer=12;
91 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 145 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.05 seconds
system cpu time 0.00 seconds
memory 2539.31k
OS Memory 30120.00k
Timestamp 04/19/2018 11:16:30 PM
Step Count 18 Switch Count 2
Page Faults 0
Page Reclaims 828
Page Swaps 0
Voluntary Context Switches 16
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 7944
 
 
92
93 proc freq; tables agegroup payer _race;
94 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 3821.03k
OS Memory 31660.00k
Timestamp 04/19/2018 11:16:30 PM
Step Count 19 Switch Count 3
Page Faults 0
Page Reclaims 1038
Page Swaps 0
Voluntary Context Switches 14
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
95
96 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
97
98 cath=0;
99 array _CATH (15) proc_1-proc_15;
100 do i=1 to 15;
101 if _CATH (i) >=3721 and _cath (i) <=3723
102 then CATH=1;
103 if _Cath(i) >=8850 and _cath(i)<=8858
104 then cath=1;
105
106 end;
107 drop i;
108 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 2441.62k
OS Memory 32168.00k
Timestamp 04/19/2018 11:16:30 PM
Step Count 20 Switch Count 7
Page Faults 0
Page Reclaims 338
Page Swaps 0
Voluntary Context Switches 26
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
109
110 proc freq data=new;
111 tables cath;
112 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 2224.31k
OS Memory 32428.00k
Timestamp 04/19/2018 11:16:30 PM
Step Count 21 Switch Count 2
Page Faults 0
Page Reclaims 330
Page Swaps 0
Voluntary Context Switches 10
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
113
114
115 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
116 CABG=0;
117 array _CABG (15) proc_1-proc_15;
118 do i=1 to 15;
119 if _CABG (i) >=3610 and _CABG (i) <=3620
120 then CABG=1;
121
122 end;
123 drop i;
124 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 2449.18k
OS Memory 32168.00k
Timestamp 04/19/2018 11:16:30 PM
Step Count 22 Switch Count 7
Page Faults 0
Page Reclaims 204
Page Swaps 0
Voluntary Context Switches 28
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
125
126 proc freq data =new;
127 tables cabg;
128 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.01 seconds
memory 2139.46k
OS Memory 32428.00k
Timestamp 04/19/2018 11:16:30 PM
Step Count 23 Switch Count 2
Page Faults 0
Page Reclaims 319
Page Swaps 0
Voluntary Context Switches 10
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
129
130
131
132 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
133 PCI=0;
134 array _PCI (15) proc_1-proc_15;
135 do i=1 to 15;
136 if _PCI (i) >=3600 and _PCI (i) <=3606
137 then PCI=1;
138
139 end;
140 drop i;
141 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.05 seconds
system cpu time 0.00 seconds
memory 2441.28k
OS Memory 32168.00k
Timestamp 04/19/2018 11:16:31 PM
Step Count 24 Switch Count 7
Page Faults 0
Page Reclaims 180
Page Swaps 0
Voluntary Context Switches 25
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
142
143 proc freq data=new;
144 tables pci;
145 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 2194.59k
OS Memory 32428.00k
Timestamp 04/19/2018 11:16:31 PM
Step Count 25 Switch Count 2
Page Faults 0
Page Reclaims 318
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 288
 
 
146
147 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
148 hyper=0;
149 array _hyper (15) diag1-diag15;
150 do i=1 to 15;
151 if _hyper (i) >=4019 and _hyper (i) <=40291
152 then hyper=1;
153 if _hyper(i) >=4050 and _hyper(i)<=40599
154 then hyper=1;
155
156 end;
157 drop i;
158 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 2441.40k
OS Memory 32168.00k
Timestamp 04/19/2018 11:16:31 PM
Step Count 26 Switch Count 7
Page Faults 0
Page Reclaims 175
Page Swaps 0
Voluntary Context Switches 26
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
159
160
161 proc freq data=new;
162 tables hyper;
163 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 2138.93k
OS Memory 32428.00k
Timestamp 04/19/2018 11:16:31 PM
Step Count 27 Switch Count 2
Page Faults 0
Page Reclaims 311
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
164
165 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
166 Obes=0;
167 array _obes (15) diag1-diag15;
168 do i=1 to 15;
169 if _obes (i) >=2780 and _obes (i) <=27802
170 then obes=1;
171
172 end;
173 drop i;
174 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 2441.31k
OS Memory 32168.00k
Timestamp 04/19/2018 11:16:31 PM
Step Count 28 Switch Count 7
Page Faults 0
Page Reclaims 163
Page Swaps 0
Voluntary Context Switches 24
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
175
176 proc freq data=new;
177 tables obes;
178 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 2141.50k
OS Memory 32428.00k
Timestamp 04/19/2018 11:16:31 PM
Step Count 29 Switch Count 2
Page Faults 0
Page Reclaims 317
Page Swaps 0
Voluntary Context Switches 10
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 272
 
 
179
180 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
181 diab=0;
182 array _diab (15) diag1-diag15;
183 do i=1 to 15;
184 if _diab (i) >=25000 and _diab (i) <=25002
185 then diab=1;
186 if _diab(i) >=25010 and _diab(i)<=25012
187 then PCI=1;
188
189 end;
190 drop i;
191 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 144 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.05 seconds
system cpu time 0.00 seconds
memory 2443.18k
OS Memory 32168.00k
Timestamp 04/19/2018 11:16:31 PM
Step Count 30 Switch Count 7
Page Faults 0
Page Reclaims 178
Page Swaps 0
Voluntary Context Switches 25
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
192
193 proc freq data=new;
194 tables diab;
195 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.01 seconds
memory 2138.93k
OS Memory 32428.00k
Timestamp 04/19/2018 11:16:31 PM
Step Count 31 Switch Count 2
Page Faults 0
Page Reclaims 316
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
196
197
198
199 proc freq data=new;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 48.57 seconds
user cpu time 48.49 seconds
system cpu time 0.08 seconds
memory 15442.62k
OS Memory 47024.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 32 Switch Count 2
Page Faults 0
Page Reclaims 4418
Page Swaps 0
Voluntary Context Switches 17
Involuntary Context Switches 37
Block Input Operations 0
Block Output Operations 37024
 
200 proc freq; tables agegroup _race payer;
 
ERROR: Variable AGEGROUP not found.
ERROR: Variable _RACE not found.
ERROR: Variable PAYER not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.71k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 33 Switch Count 0
Page Faults 0
Page Reclaims 253
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
201 proc freq; tables payer* _race;
 
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 34 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
202 proc freq; tables cath * payer * _race;
 
ERROR: Variable CATH not found.
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 35 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
203 proc freq; tables cabg * payer * _race;
 
ERROR: Variable CABG not found.
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.71k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 36 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
204 proc freq; tables PCI * payer * _race;
 
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 37 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
205 proc freq; tables obes*cath;
 
ERROR: Variable OBES not found.
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 38 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
206 proc freq; tables obes*cabg;
 
ERROR: Variable OBES not found.
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.71k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 39 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
207 proc freq; tables obes*pci;
 
ERROR: Variable OBES not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 40 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
208 proc freq; tables hyper*cath;
 
ERROR: Variable HYPER not found.
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 41 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
209 proc freq; tables hyper*cabg;
 
ERROR: Variable HYPER not found.
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.71k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 42 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
210 proc freq; tables hyper*pci;
 
ERROR: Variable HYPER not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 43 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
211 proc freq; tables diab*cath;
 
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 44 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
212 proc freq; tables diab*cabg;
 
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.71k
OS Memory 39596.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 45 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
213 proc freq; tables diab*pci;
 
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.02 seconds
user cpu time 0.02 seconds
system cpu time 0.01 seconds
memory 2643.50k
OS Memory 40372.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 46 Switch Count 4
Page Faults 0
Page Reclaims 487
Page Swaps 0
Voluntary Context Switches 26
Involuntary Context Switches 0
Block Input Operations 32
Block Output Operations 536
 
214 proc freq; tables payer* _race / chisq relrisk cl;
 
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 47 Switch Count 0
Page Faults 0
Page Reclaims 245
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
215 proc freq; tables cath * payer * _race / chisq relrisk cl;
 
ERROR: Variable CATH not found.
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 48 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
216 proc freq; tables cabg * payer * _race / chisq relrisk cl;
 
ERROR: Variable CABG not found.
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 49 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
217 proc freq; tables PCI * payer * _race / chisq relrisk cl;
 
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 50 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
218 proc freq; tables obes*cath / chisq relrisk cl;
 
ERROR: Variable OBES not found.
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 51 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
219 proc freq; tables obes*cabg / chisq relrisk cl;
 
ERROR: Variable OBES not found.
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 52 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
220 proc freq; tables obes*pci / chisq relrisk cl;
 
ERROR: Variable OBES not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 53 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
221 proc freq; tables hyper*cath / chisq relrisk cl;
 
ERROR: Variable HYPER not found.
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 54 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
222 proc freq; tables hyper*cabg / chisq relrisk cl;
 
ERROR: Variable HYPER not found.
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 55 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
223 proc freq; tables hyper*pci / chisq relrisk cl;
 
ERROR: Variable HYPER not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 56 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
224 proc freq; tables diab*cath / chisq relrisk cl;
 
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 57 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
225 proc freq; tables diab*cabg / chisq relrisk cl;
 
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.84k
OS Memory 39852.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 58 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
226 proc freq; tables diab*pci / chisq relrisk cl;
 
 
NOTE: No statistics are computed for diab * PCI because PCI has less than 2 nonmissing levels.
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.02 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 2636.62k
OS Memory 40628.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 59 Switch Count 4
Page Faults 0
Page Reclaims 401
Page Swaps 0
Voluntary Context Switches 21
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 544
 
227 proc freq; tables agegroup*obes/chisq relrisk cl;
 
ERROR: Variable AGEGROUP not found.
ERROR: Variable OBES not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 40108.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 60 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
228 proc freq; tables agegroup*hyper/chisq relrisk cl;
 
ERROR: Variable AGEGROUP not found.
ERROR: Variable HYPER not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 40108.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 61 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
229 proc freq; tables agegroup*diab/chisq relrisk cl;
 
ERROR: Variable AGEGROUP not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 40108.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 62 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
230 proc freq; tables obes*_race/chisq relrisk cl;
 
ERROR: Variable OBES not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 40108.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 63 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
231 proc freq; tables hyper*_race/chisq relrisk cl;
 
ERROR: Variable HYPER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 40108.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 64 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
232 proc freq; tables diab*_race/chisq relrisk cl;
 
ERROR: Variable _RACE not found.
233 run;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1664.21k
OS Memory 40108.00k
Timestamp 04/19/2018 11:17:19 PM
Step Count 65 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
234
235
236
237 /*proc logistic data=new
238 plots (only)=(effect);
239 class sex;
240 model cath (event='1')= sex;
241 title1 'Logistic Regression Model';
242 run;
243 title;*/
244
245
246
247 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
259
 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

@wwhitner0 Please post the solution and mark it as solved for future users. If you cannot - just mark it as solved with your comment.

View solution in original post

10 REPLIES 10
Reeza
Super User
Didn’t read all of your code but a quick glance it looks like you read from the stored dataset rather than use the previous data sets you’ve built. Each time you’re starting from scratch you lose the previous work.
Reeza
Super User
And use DATA= on your PROC FREQ and summaries so it’s clear which tables you’re trying to use as input.
wwhitner0
Calcite | Level 5

Thank you.  Unfortunately, it is not working.  

code:


/*create library using mydata and the folder*/
libname mydata"/home/wwhitner0/Cardio";
data new; set mydata.mdahos;
if age_yrs <= 35 then Agegroup=1;
else if age_yrs <=44 then Agegroup=2;
else if age_yrs <=54 then Agegroup=3;
else if age_yrs <=64 then agegroup=4;
else if age_yrs <=74 then agegroup=4;
else if age_yrs >=75 then agegroup=5;

if race=1 then _race=1;
else if race=2 then _race=2;

if payer1=01 then payer=1;
else if payer1=02 then payer=2;
else if payer1=04 then payer=4;
else if payer1=05 then payer=5;
else if payer1=08 then payer=8;
else if payer1=12 then payer=12;
run;
proc freq data=new;
proc freq; tables agegroup payer _race;
run;

data new; set mydata.mdahos;

cath=0;
array _CATH (15) proc_1-proc_15;
do i=1 to 15;
if _CATH (i) >=3721 and _cath (i) <=3723
then CATH=1;
if _Cath(i) >=8850 and _cath(i)<=8858
then cath=1;

end;
drop i;
run;

proc freq data=new;
tables cath;
run;


data new; set mydata.mdahos;
CABG=0;
array _CABG (15) proc_1-proc_15;
do i=1 to 15;
if _CABG (i) >=3610 and _CABG (i) <=3620
then CABG=1;

end;
drop i;
run;

proc freq data =new;
tables cabg;
run;



data new; set mydata.mdahos;
PCI=0;
array _PCI (15) proc_1-proc_15;
do i=1 to 15;
if _PCI (i) >=3600 and _PCI (i) <=3606
then PCI=1;

end;
drop i;
run;

proc freq data=new;
tables pci;
run;

data new; set mydata.mdahos;
hyper=0;
array _hyper (15) diag1-diag15;
do i=1 to 15;
if _hyper (i) >=4019 and _hyper (i) <=40291
then hyper=1;
if _hyper(i) >=4050 and _hyper(i)<=40599
then hyper=1;

end;
drop i;
run;


proc freq data=new;
tables hyper;
run;

data new; set mydata.mdahos;
Obes=0;
array _obes (15) diag1-diag15;
do i=1 to 15;
if _obes (i) >=2780 and _obes (i) <=27802
then obes=1;

end;
drop i;
run;

proc freq data=new;
tables obes;
run;

data new; set mydata.mdahos;
diab=0;
array _diab (15) diag1-diag15;
do i=1 to 15;
if _diab (i) >=25000 and _diab (i) <=25002
then diab=1;
if _diab(i) >=25010 and _diab(i)<=25012
then PCI=1;

end;
drop i;
run;

proc freq data=new;
tables diab;
run;



proc freq data=new;
proc freq; tables agegroup _race payer;
proc freq; tables payer* _race;
proc freq; tables cath * payer * _race;
proc freq; tables cabg * payer * _race;
proc freq; tables PCI * payer * _race;
proc freq; tables obes*cath;
proc freq; tables obes*cabg;
proc freq; tables obes*pci;
proc freq; tables hyper*cath;
proc freq; tables hyper*cabg;
proc freq; tables hyper*pci;
proc freq; tables diab*cath;
proc freq; tables diab*cabg;
proc freq; tables diab*pci;
proc freq; tables payer* _race / chisq relrisk cl;
proc freq; tables cath * payer * _race / chisq relrisk cl;
proc freq; tables cabg * payer * _race / chisq relrisk cl;
proc freq; tables PCI * payer * _race / chisq relrisk cl;
proc freq; tables obes*cath / chisq relrisk cl;
proc freq; tables obes*cabg / chisq relrisk cl;
proc freq; tables obes*pci / chisq relrisk cl;
proc freq; tables hyper*cath / chisq relrisk cl;
proc freq; tables hyper*cabg / chisq relrisk cl;
proc freq; tables hyper*pci / chisq relrisk cl;
proc freq; tables diab*cath / chisq relrisk cl;
proc freq; tables diab*cabg / chisq relrisk cl;
proc freq; tables diab*pci / chisq relrisk cl;
proc freq; tables agegroup*obes/chisq relrisk cl;
proc freq; tables agegroup*hyper/chisq relrisk cl;
proc freq; tables agegroup*diab/chisq relrisk cl;
proc freq; tables obes*_race/chisq relrisk cl;
proc freq; tables hyper*_race/chisq relrisk cl;
proc freq; tables diab*_race/chisq relrisk cl;
run;



/*proc logistic data=new
plots (only)=(effect);
class sex;
model cath (event='1')= sex;
title1 'Logistic Regression Model';
run;
title;*/

 

Log 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71
72 /*create library using mydata and the folder*/
73 libname mydata"/home/wwhitner0/Cardio";
NOTE: Libref MYDATA was successfully assigned as follows:
Engine: V9
Physical Name: /home/wwhitner0/Cardio
74 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
75 if age_yrs <= 35 then Agegroup=1;
76 else if age_yrs <=44 then Agegroup=2;
77 else if age_yrs <=54 then Agegroup=3;
78 else if age_yrs <=64 then agegroup=4;
79 else if age_yrs <=74 then agegroup=4;
80 else if age_yrs >=75 then agegroup=5;
81
82 if race=1 then _race=1;
83 else if race=2 then _race=2;
84
85 if payer1=01 then payer=1;
86 else if payer1=02 then payer=2;
87 else if payer1=04 then payer=4;
88 else if payer1=05 then payer=5;
89 else if payer1=08 then payer=8;
90 else if payer1=12 then payer=12;
91 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 145 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 2515.62k
OS Memory 30376.00k
Timestamp 04/20/2018 01:12:03 AM
Step Count 18 Switch Count 2
Page Faults 0
Page Reclaims 814
Page Swaps 0
Voluntary Context Switches 18
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7944
 
 
92 proc freq data=new;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 49.65 seconds
user cpu time 49.52 seconds
system cpu time 0.13 seconds
memory 16930.87k
OS Memory 46256.00k
Timestamp 04/20/2018 01:12:52 AM
Step Count 19 Switch Count 3
Page Faults 0
Page Reclaims 5219
Page Swaps 0
Voluntary Context Switches 19
Involuntary Context Switches 74
Block Input Operations 0
Block Output Operations 37016
 
93 proc freq; tables agegroup payer _race;
 
94 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 2205.28k
OS Memory 42928.00k
Timestamp 04/20/2018 01:12:52 AM
Step Count 20 Switch Count 2
Page Faults 0
Page Reclaims 328
Page Swaps 0
Voluntary Context Switches 12
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 288
 
 
95
96 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
97
98 cath=0;
99 array _CATH (15) proc_1-proc_15;
100 do i=1 to 15;
101 if _CATH (i) >=3721 and _cath (i) <=3723
102 then CATH=1;
103 if _Cath(i) >=8850 and _cath(i)<=8858
104 then cath=1;
105
106 end;
107 drop i;
108 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 2442.81k
OS Memory 42668.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 21 Switch Count 7
Page Faults 0
Page Reclaims 229
Page Swaps 0
Voluntary Context Switches 28
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
109
110 proc freq data=new;
111 tables cath;
112 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 2195.15k
OS Memory 42928.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 22 Switch Count 2
Page Faults 0
Page Reclaims 313
Page Swaps 0
Voluntary Context Switches 12
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 272
 
 
113
114
115 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
116 CABG=0;
117 array _CABG (15) proc_1-proc_15;
118 do i=1 to 15;
119 if _CABG (i) >=3610 and _CABG (i) <=3620
120 then CABG=1;
121
122 end;
123 drop i;
124 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 2451.03k
OS Memory 42668.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 23 Switch Count 7
Page Faults 0
Page Reclaims 178
Page Swaps 0
Voluntary Context Switches 24
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
125
126 proc freq data =new;
127 tables cabg;
128 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 2140.90k
OS Memory 42928.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 24 Switch Count 2
Page Faults 0
Page Reclaims 314
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
129
130
131
132 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
133 PCI=0;
134 array _PCI (15) proc_1-proc_15;
135 do i=1 to 15;
136 if _PCI (i) >=3600 and _PCI (i) <=3606
137 then PCI=1;
138
139 end;
140 drop i;
141 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 2443.40k
OS Memory 42668.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 25 Switch Count 7
Page Faults 0
Page Reclaims 170
Page Swaps 0
Voluntary Context Switches 24
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
142
143 proc freq data=new;
144 tables pci;
145 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 2141.21k
OS Memory 42928.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 26 Switch Count 2
Page Faults 0
Page Reclaims 312
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
146
147 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
148 hyper=0;
149 array _hyper (15) diag1-diag15;
150 do i=1 to 15;
151 if _hyper (i) >=4019 and _hyper (i) <=40291
152 then hyper=1;
153 if _hyper(i) >=4050 and _hyper(i)<=40599
154 then hyper=1;
155
156 end;
157 drop i;
158 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.01 seconds
memory 2450.31k
OS Memory 42668.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 27 Switch Count 7
Page Faults 0
Page Reclaims 171
Page Swaps 0
Voluntary Context Switches 24
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
159
160
161 proc freq data=new;
162 tables hyper;
163 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 2142.62k
OS Memory 42928.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 28 Switch Count 2
Page Faults 0
Page Reclaims 314
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 272
 
 
164
165 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
166 Obes=0;
167 array _obes (15) diag1-diag15;
168 do i=1 to 15;
169 if _obes (i) >=2780 and _obes (i) <=27802
170 then obes=1;
171
172 end;
173 drop i;
174 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 143 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 2442.78k
OS Memory 42668.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 29 Switch Count 7
Page Faults 0
Page Reclaims 163
Page Swaps 0
Voluntary Context Switches 28
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
175
176 proc freq data=new;
177 tables obes;
178 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 2140.65k
OS Memory 42928.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 30 Switch Count 2
Page Faults 0
Page Reclaims 314
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
179
180 data new; set mydata.mdahos;
NOTE: Data file MYDATA.MDAHOS.DATA is in a format that is native to another host, or the file encoding does not match the session
encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.
181 diab=0;
182 array _diab (15) diag1-diag15;
183 do i=1 to 15;
184 if _diab (i) >=25000 and _diab (i) <=25002
185 then diab=1;
186 if _diab(i) >=25010 and _diab(i)<=25012
187 then PCI=1;
188
189 end;
190 drop i;
191 run;
 
NOTE: There were 4541 observations read from the data set MYDATA.MDAHOS.
NOTE: The data set WORK.NEW has 4541 observations and 144 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 2452.43k
OS Memory 42668.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 31 Switch Count 7
Page Faults 0
Page Reclaims 163
Page Swaps 0
Voluntary Context Switches 25
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 7688
 
 
192
193 proc freq data=new;
194 tables diab;
195 run;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
user cpu time 0.02 seconds
system cpu time 0.01 seconds
memory 2200.00k
OS Memory 42928.00k
Timestamp 04/20/2018 01:12:53 AM
Step Count 32 Switch Count 2
Page Faults 0
Page Reclaims 312
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
 
196
197
198
199 proc freq data=new;
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 50.95 seconds
user cpu time 50.80 seconds
system cpu time 0.15 seconds
memory 14307.93k
OS Memory 51828.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 33 Switch Count 2
Page Faults 0
Page Reclaims 2864
Page Swaps 0
Voluntary Context Switches 17
Involuntary Context Switches 65
Block Input Operations 0
Block Output Operations 37056
 
200 proc freq; tables agegroup _race payer;
 
ERROR: Variable AGEGROUP not found.
ERROR: Variable _RACE not found.
ERROR: Variable PAYER not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.62k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 34 Switch Count 0
Page Faults 0
Page Reclaims 253
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
201 proc freq; tables payer* _race;
 
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.62k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 35 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
202 proc freq; tables cath * payer * _race;
 
ERROR: Variable CATH not found.
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.62k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 36 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
203 proc freq; tables cabg * payer * _race;
 
ERROR: Variable CABG not found.
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.62k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 37 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
204 proc freq; tables PCI * payer * _race;
 
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.62k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 38 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
205 proc freq; tables obes*cath;
 
ERROR: Variable OBES not found.
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.50k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 39 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
206 proc freq; tables obes*cabg;
 
ERROR: Variable OBES not found.
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.84k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 40 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
207 proc freq; tables obes*pci;
 
ERROR: Variable OBES not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.50k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 41 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
208 proc freq; tables hyper*cath;
 
ERROR: Variable HYPER not found.
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.46k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 42 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
209 proc freq; tables hyper*cabg;
 
ERROR: Variable HYPER not found.
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.50k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 43 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
210 proc freq; tables hyper*pci;
 
ERROR: Variable HYPER not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.84k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 44 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
211 proc freq; tables diab*cath;
 
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1666.50k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 45 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
212 proc freq; tables diab*cabg;
 
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.46k
OS Memory 47216.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 46 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
213 proc freq; tables diab*pci;
 
 
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.02 seconds
user cpu time 0.03 seconds
system cpu time 0.01 seconds
memory 2862.75k
OS Memory 47992.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 47 Switch Count 4
Page Faults 0
Page Reclaims 489
Page Swaps 0
Voluntary Context Switches 21
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 536
 
214 proc freq; tables payer* _race / chisq relrisk cl;
 
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1668.50k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 48 Switch Count 0
Page Faults 0
Page Reclaims 245
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
215 proc freq; tables cath * payer * _race / chisq relrisk cl;
 
ERROR: Variable CATH not found.
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.53k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 49 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
216 proc freq; tables cabg * payer * _race / chisq relrisk cl;
 
ERROR: Variable CABG not found.
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1668.87k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 50 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
217 proc freq; tables PCI * payer * _race / chisq relrisk cl;
 
ERROR: Variable PAYER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.53k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 51 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
218 proc freq; tables obes*cath / chisq relrisk cl;
 
ERROR: Variable OBES not found.
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1668.37k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 52 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
219 proc freq; tables obes*cabg / chisq relrisk cl;
 
ERROR: Variable OBES not found.
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.53k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 53 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
220 proc freq; tables obes*pci / chisq relrisk cl;
 
ERROR: Variable OBES not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1668.75k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 54 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
221 proc freq; tables hyper*cath / chisq relrisk cl;
 
ERROR: Variable HYPER not found.
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.53k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 55 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
222 proc freq; tables hyper*cabg / chisq relrisk cl;
 
ERROR: Variable HYPER not found.
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1668.37k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 56 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
223 proc freq; tables hyper*pci / chisq relrisk cl;
 
ERROR: Variable HYPER not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.53k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 57 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
224 proc freq; tables diab*cath / chisq relrisk cl;
 
ERROR: Variable CATH not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1668.75k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 58 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
225 proc freq; tables diab*cabg / chisq relrisk cl;
 
ERROR: Variable CABG not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 1667.53k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 59 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 8
 
226 proc freq; tables diab*pci / chisq relrisk cl;
 
 
NOTE: No statistics are computed for diab * PCI because PCI has less than 2 nonmissing levels.
NOTE: There were 4541 observations read from the data set WORK.NEW.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.02 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 2474.87k
OS Memory 47992.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 60 Switch Count 4
Page Faults 0
Page Reclaims 398
Page Swaps 0
Voluntary Context Switches 18
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 528
 
227 proc freq; tables agegroup*obes/chisq relrisk cl;
 
ERROR: Variable AGEGROUP not found.
ERROR: Variable OBES not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.75k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 61 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
228 proc freq; tables agegroup*hyper/chisq relrisk cl;
 
ERROR: Variable AGEGROUP not found.
ERROR: Variable HYPER not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1668.21k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 62 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
229 proc freq; tables agegroup*diab/chisq relrisk cl;
 
ERROR: Variable AGEGROUP not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.75k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 63 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
230 proc freq; tables obes*_race/chisq relrisk cl;
 
ERROR: Variable OBES not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.01 seconds
memory 1668.21k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 64 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
231 proc freq; tables hyper*_race/chisq relrisk cl;
 
ERROR: Variable HYPER not found.
ERROR: Variable _RACE not found.
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1667.75k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 65 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
232 proc freq; tables diab*_race/chisq relrisk cl;
 
ERROR: Variable _RACE not found.
233 run;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1668.21k
OS Memory 47472.00k
Timestamp 04/20/2018 01:13:44 AM
Step Count 66 Switch Count 0
Page Faults 0
Page Reclaims 241
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
234
235
236
237 /*proc logistic data=new
238 plots (only)=(effect);
239 class sex;
240 model cath (event='1')= sex;
241 title1 'Logistic Regression Model';
242 run;
243 title;*/
244
245
246
247 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
259
 
User: wwhitner0
Messages: 1
Cynthia_sas
Diamond | Level 26
Hi:
After you use an ARRAY in a DATA step program, then you do NOT refer to the ARRAY name in subsequent procedures. The ARRAY name only exists for the duration of the program, as a convenient way to treat a group of variables as though they were members of an array or to create a group of variables, generally through using a DO loop.

Here's a good paper on ARRAYs that explains the basics: https://www.lexjansen.com/wuss/2007/Tutorials/TUT_Stroupe_AdventureArrays.pdf

Hope this helps,
cynthia
wwhitner0
Calcite | Level 5
Thanks Cynthnia,
For arrays, I was told i needed to.create them to being my like variables in order to determine the like variables frequency as on variable and to use that variable for statistical analysis such as chi square and logistical regression modeling. I have been lost trying to use the variable I made for the arrays to be used in the statistical analysis part. I am not understanding why I am not able to use the new variable names.

Wendy
Reeza
Super User
data new; 
set mydata.mdahos; <- uses data set to start off iwth;
if age_yrs <= 35 then Agegroup=1;
else if age_yrs <=44 then Agegroup=2;
else if age_yrs <=54 then Agegroup=3;
else if age_yrs <=64 then agegroup=4;
else if age_yrs <=74 then agegroup=4;
else if age_yrs >=75 then agegroup=5;

if race=1 then _race=1;
else if race=2 then _race=2;

if payer1=01 then payer=1;
else if payer1=02 then payer=2;
else if payer1=04 then payer=4;
else if payer1=05 then payer=5;
else if payer1=08 then payer=8;
else if payer1=12 then payer=12;
run;


data new; set mydata.mdahos; <- erases previous NEW data set AND all variables created;

 

I don't think you made the changes. See my comments above.

ballardw
Super User

As an aside to your question about arrays; you can reduce the Proc Freq code to something like:

Proc freq data=new;
   tables agegroup _race payer payer* _race;
   tables (obes hyper diab)*(cath cabg pci _race) /  chisq relrisk cl ;
   tables payer* _race / chisq relrisk cl;
   tables (cath cabg pci) * payer * _race / chisq relrisk cl;
   tables agegroup*(obes hyper diab)/chisq relrisk cl;
run;

You may have a large number of requests on a single tables statement as long as you want the same options for each.

 

Syntax like (a b c) *(x y z) creates tables of the combinations: a*x a*y a*z b*x b*y b*z c*x c*y c*z. So you can shorten the table requests. Multiple Proc Freq calls might cause SAS to reload the data multiple times where multiple tables statements within a single call will require the data load only once.

Also calling the same tables request without and with an option like chisq or relrisk creates duplicate output of the basic table.

wwhitner0
Calcite | Level 5

Hi Ballardw,

  My colleague found the issue.  Everything is working well now. 

 

Thanks,

Wendy

Reeza
Super User

@wwhitner0 Please post the solution and mark it as solved for future users. If you cannot - just mark it as solved with your comment.

wwhitner0
Calcite | Level 5

The solution we used and works is as follows:

 

*create library using mydata and the folder*/
libname mydata"/home/wwhitner0/Cardio";
data new; set mydata.mdahos;
if age_yrs <= 35 then Agegroup=1;
else if age_yrs <=44 then Agegroup=2;
else if age_yrs <=54 then Agegroup=3;
else if age_yrs <=64 then agegroup=4;
else if age_yrs <=74 then agegroup=4;
else if age_yrs >=75 then agegroup=5;

if race=1 then _race=1;
else if race=2 then _race=2;

if payer1=01 then payer=1;
else if payer1=02 then payer=2;
else if payer1=04 then payer=4;
else if payer1=05 then payer=5;
else if payer1=08 then payer=8;
else if payer1=12 then payer=12;

cath=0;
array _CATH (15) proc_1-proc_15;
do i=1 to 15;
if _CATH (i) >=3721 and _cath (i) <=3723
then CATH=1;
if _Cath(i) >=8850 and _cath(i)<=8858
then cath=1;

end;
drop i;


CABG=0;
array _CABG (15) proc_1-proc_15;
do i=1 to 15;
if _CABG (i) >=3610 and _CABG (i) <=3620
then CABG=1;

end;
drop i;

PCI=0;
array _PCI (15) proc_1-proc_15;
do i=1 to 15;
if _PCI (i) >=3600 and _PCI (i) <=3606
then PCI=1;

end;
drop i;

hyper=0;
array _hyper (15) diag1-diag15;
do i=1 to 15;
if _hyper (i) >=4019 and _hyper (i) <=40291
then hyper=1;
if _hyper(i) >=4050 and _hyper(i)<=40599
then hyper=1;

end;
drop i;

diab=0;
array _diab (15) diag1-diag15;
do i=1 to 15;
if _diab (i) >=25000 and _diab (i) <=25002
then diab=1;
if _diab(i) >=25010 and _diab(i)<=25012
then PCI=1;

end;
drop i;

Obes=0;
array _obes (15) diag1-diag15;
do i=1 to 15;
if _obes (i) >=2780 and _obes (i) <=27802
then obes=1;

end;
drop i;
run;

proc freq data =new;
tables cath cabg pci obes hyper diab;
run;


proc freq data=new; tables agegroup _race payer
payer* _race
cath * payer * _race
cabg * payer * _race
PCI * payer * _race
obes*cath
obes*cabg
obes*pci
hyper*cath
hyper*cabg
hyper*pci
diab*cath
diab*pci
diab*cabg
payer* _race
cath * payer * _race
cabg * payer * _race
PCI * payer * _race
obes*cath
obes*cabg
obes*pci
hyper*cath
hyper*cabg
hyper*pci
diab*cath
diab*cabg
diab*pci
agegroup*obes
agegroup*hyper
agegroup*diab
obes*_race
hyper*_race
diab*_race /chisq relrisk cl;
run;


/*create library using mydata and the folder*/
libname mydata"/home/wwhitner0/Cardio";
data new; set mydata.mdahos;
if age_yrs <= 35 then Agegroup=1;
else if age_yrs <=44 then Agegroup=2;
else if age_yrs <=54 then Agegroup=3;
else if age_yrs <=64 then agegroup=4;
else if age_yrs <=74 then agegroup=4;
else if age_yrs >=75 then agegroup=5;

if race=1 then _race=1;
else if race=2 then _race=2;

if payer1=01 then payer=1;
else if payer1=02 then payer=2;
else if payer1=04 then payer=4;
else if payer1=05 then payer=5;
else if payer1=08 then payer=8;
else if payer1=12 then payer=12;

 

cath=0;
array _CATH (15) proc_1-proc_15;
      do i=1 to 15;
      if _CATH (i) >=3721 and _cath (i) <=3723
      then CATH=1;
      if _Cath(i) >=8850 and _cath(i)<=8858
      then cath=1;
     
end;
drop i;


CABG=0;
array _CABG (15) proc_1-proc_15;
      do i=1 to 15;
      if _CABG (i) >=3610 and _CABG (i) <=3620
      then CABG=1;
     
end;
drop i;

PCI=0;
array _PCI (15) proc_1-proc_15;
      do i=1 to 15;
      if _PCI (i) >=3600 and _PCI (i) <=3606
      then PCI=1; 
    
end;
drop i;

 

hyper=0;
array _hyper (15) diag1-diag15;
      do i=1 to 15;
      if _hyper (i) >=4019 and _hyper (i) <=40291
      then hyper=1;
      if _hyper(i) >=4050 and _hyper(i)<=40599
      then hyper=1;
     
end;
drop i;

 

diab=0;
array _diab (15) diag1-diag15;
      do i=1 to 15;
      if _diab (i) >=25000 and _diab (i) <=25002
      then diab=1;
      if _diab(i) >=25010 and _diab(i)<=25012
      then PCI=1;
     
end;
drop i;

 

Obes=0;
array _obes (15) diag1-diag15;
      do i=1 to 15;
      if _obes (i) >=2780 and _obes (i) <=27802
      then obes=1;
           
end;
drop i;
run;

 

proc freq data =new;
tables cath cabg pci obes hyper diab;
run;


proc freq data=new; tables agegroup _race payer
                    payer* _race
                    cath * payer * _race
                    cabg * payer * _race
                    PCI * payer * _race
                    obes*cath
                    obes*cabg
                    obes*pci
                    hyper*cath
                    hyper*cabg
                    hyper*pci
                    diab*cath
                    diab*pci
                    diab*cabg                   
                    payer* _race 
                   cath * payer * _race 
                   cabg * payer * _race 
                   PCI * payer * _race 
                   obes*cath 
                   obes*cabg 
                   obes*pci 
                   hyper*cath 
                   hyper*cabg 
                   hyper*pci 
                   diab*cath 
                   diab*cabg 
                   diab*pci 
                   agegroup*obes
                   agegroup*hyper
                   agegroup*diab
                   obes*_race
                   hyper*_race
                   diab*_race /chisq relrisk cl;
run;

 

 
 
 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 10 replies
  • 2266 views
  • 0 likes
  • 4 in conversation