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.

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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