Send the output to a data set an use one of the proc reports such as Print, Report or Tabulate to display the values where you can set the display formats would likely be the best approach. Add statements such as
ODS OUTPUT tablename= wanteddatasetname;
Table name would likely be CROSSTABS if doing two-way frequencies, ONEWAY if single , CHISQ or CHISQ1 if doing chi-square tests.
Or you can run your code preceded with ODS Trace on; prior to the procedure to get a listing of tables generated. Don't forget to use ODS Trace off; afterwards.
Otherwise you have to work with Proc Template to modify the displayed tables layouts and that is usually way more work than it is worth.
Send the output to a data set an use one of the proc reports such as Print, Report or Tabulate to display the values where you can set the display formats would likely be the best approach. Add statements such as
ODS OUTPUT tablename= wanteddatasetname;
Table name would likely be CROSSTABS if doing two-way frequencies, ONEWAY if single , CHISQ or CHISQ1 if doing chi-square tests.
Or you can run your code preceded with ODS Trace on; prior to the procedure to get a listing of tables generated. Don't forget to use ODS Trace off; afterwards.
Otherwise you have to work with Proc Template to modify the displayed tables layouts and that is usually way more work than it is worth.
@Orchidn wrote:
Thank you so much! It worked, but there are still variables which were mot converted to 2 digits (the ones that are by default in the crosstab).
The table won't change the number of decimals though the number displayed may vary from the table output. You specify that in Proc Print, Report or tabulate. Or you could use Proc DATASETS or a data step (inefficient) to assign formats to specific variables.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: