Use ODS OUTPUT to get the table :
ods listing select none;
proc freq data=sashelp.heart;
table (status sex) * (chol_status bp_status weight_status) / chisq;
ods output ChiSq=outChiSq;
run;
ods listing;
proc sql;
create table myChiSq as
select
scan(Table,2) as v1 length=32,
scan(Table,3) as v2 length=32,
df,
value,
prob
from outChiSq
where statistic="Chi-Square"
order by v1, v2;
select * from myChiSq;
quit;
Note : You need parentheses around the variable lists in the TABLES statement.
Use ODS OUTPUT to get the table :
ods listing select none;
proc freq data=sashelp.heart;
table (status sex) * (chol_status bp_status weight_status) / chisq;
ods output ChiSq=outChiSq;
run;
ods listing;
proc sql;
create table myChiSq as
select
scan(Table,2) as v1 length=32,
scan(Table,3) as v2 length=32,
df,
value,
prob
from outChiSq
where statistic="Chi-Square"
order by v1, v2;
select * from myChiSq;
quit;
Note : You need parentheses around the variable lists in the TABLES statement.
This is great! Thank you so much!
You are welcome. Please mark answer as accepted solution.
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.