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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: