BookmarkSubscribeRSS Feed
CathyVI
Pyrite | Level 9

Hi,

I ran a prof freq and I got my results but i am trying to remove the Exponent (E) from my result.

 

Example;

 

proc freq data = income;

table amount;

run;

 

Result ;

 

amount   frequency      Percent  Cum_freq       Cum_persent

  0          42344E12      60.20        3454E54             100.00

  1          44535E33       34.44       5675E44               60.00

9 REPLIES 9
Jagadishkatam
Amethyst | Level 16

I am not sure if we could resolve it, alternatively we use the proc sql.

Thanks,
Jag
Reeza
Super User
Use PROC TABULATE instead. Modifying the PROC FREQ template is a pain.
ballardw
Super User

Send the result to a data set an specify a longer format in Proc Print to display the values.

 

proc freq data = income noprint;
   table amount/ outcum out=work.count;
run;

proc print data=work.count;
   format count cum_freq best32.;
run;

HOWEVER, none of the SAS numeric formats want to display 54+digit with 32 the limit. So you are still going to have some scientific notation. And 2 to the 53rd power (15 significant digits) is the largest integer that SAS has for precision of storage so you are exceeding that anyway.

Reeza
Super User
proc tabulate data=income;
class amount;

table amount*n=''*f=32.;

run;

Maybe this will work?

 


@CathyVI wrote:

Hi,

I ran a prof freq and I got my results but i am trying to remove the Exponent (E) from my result.

 

Example;

 

proc freq data = income;

table amount;

run;

 

Result ;

 

amount   frequency      Percent  Cum_freq       Cum_persent

  0          42344E12      60.20        3454E54             100.00

  1          44535E33       34.44       5675E44               60.00


 

CathyVI
Pyrite | Level 9

So I tried this for a 2 x 2 table but didn't work

For example;

proc tabulate data=med;

class name;

table blank*name*n=''*f=32.;

run;

 

???

I am using proc freq to find 2x2 and 2x3 table so how will I use the proc tabulate without getting an exponent in my result ?

 

Reeza
Super User
What does didn't work mean? Can you generate some sample data we can use to test this? If not, please show an example of a 2x2 table and the numbers you're getting.
CathyVI
Pyrite | Level 9
@Reeza, what i mean by didn't work is that i can't get percent, cum_percent & cum_freq by using proc tabulate and i wanted percent.
Reeza
Super User

@CathyVI wrote:
@Reeza, what i mean by didn't work is that i can't get percent, cum_percent & cum_freq by using proc tabulate and i wanted percent.

Your code doesn't request the percentages as outputs, you need to explicitly code for those in PROC TABULATE, they are not part of the default output.

Tom
Super User Tom
Super User

Note that your totals are too large for SAS to represent exactly. Maximum number of decimal digits is 15 .

The value 42344E12 would take more than 15 digits.

 

So why not just accept the scientific notation?

Or roll your own CUM variables.

proc freq data=sashelp.class ;
  tables sex / noprint out=counts;
run;
data counts;
  set counts;
  cum_count+count;
  cum_percent+percent;
  format count cum_count 32. percent cum_percent 6.2 ;
run;
proc print width=min;
run;

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 9 replies
  • 6482 views
  • 1 like
  • 5 in conversation