That looks like homework to me, but I'll tell you its wrong. Take a look at your proc freq output, the table should at least match your input table, if it doesn't you haven't done your chi-square correctly. See the example in the docs that does pretty much what you're looking for: Base SAS(R) 9.2 Procedures Guide: Statistical Procedures, Third Edition
... View more