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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 7353 views
  • 0 likes
  • 3 in conversation