BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sasmaverick
Obsidian | Level 7
I see that when I apply proc freq on a variable in a large dataset, the result gets truncated to scientific notation. Eg. for the below on a dataset of 35 Million records

Proc freq data=sales;
Tables region;
Run;

Gives me the frequencies like follows

US 2.15E8
UK. 1.59E7
EMEA 100000

I want the numbers to appear completely with a comma separator.

I tried using formats (best12. and comma12.) in the tables statment but to no avail.

Help appreciated!
Sasmaverick
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Switch to proc tabulate and you can format the numbers easily. Otherwise google 'PROC FREQ TEMPLATE' for examples on how to modify the template for PROC FREQ to have it show the values as you want. 

View solution in original post

3 REPLIES 3
Reeza
Super User

Switch to proc tabulate and you can format the numbers easily. Otherwise google 'PROC FREQ TEMPLATE' for examples on how to modify the template for PROC FREQ to have it show the values as you want. 

Ksharp
Super User
An alternative way is using SQL.

proc sql;
create table want as
 select region,count(*) as count format=f12.
  from sales
   group by region;
quit;

sasmaverick
Obsidian | Level 7
Thank you, I was able to do it by setting default formats for frequencies by using PROC Template.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 8787 views
  • 0 likes
  • 3 in conversation