I am just going to do both codes, mine and yours and then do a proc sql to get the expected frequency under independence into the output table I produce with my code. That will save me some manual work via Excel because I can link on the TIN and just say <> national in the who section. I just don't see in sashelp.heart where there is anyway to do an odds ratio, cmh and expected and have it output odds ratio, cmh and expected information. Kind of strange that the SAS creators would not have a code that outputs expected along with or, cmh, chisq, all or anything else. I have tried all and expected does not show up using just all. I have tried all with expected outexpect and still I do not get any OR, CMH, CHISQ nothing. I get the same output with only 7 columns no matter what I do with an expected outexpect in it. I don't want that. I want the 38 or so columns I produce with OR and CMH but I also want the expected frequency under independence in there.
... View more