BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Artp
Fluorite | Level 6

Hello,

 

Here is my SAS code:

 

proc tabulate data = parenting format=comma12.;

class parsel;

table parsel ='Parents' all,

n*f=7.0 pctn*f=9.1 /rts=25;

keylabelpctn = 'Percent'

all = 'Total';

run;

 

Using Proc Means i get a total sum of 13572799.05. However, Proc Tabulate yields the following number: 1.36E+07 (when expanded, it is 13570000 (see Excel attachment). How can I format 1.36E+07 to get it fully displayed with 2 decimal points like 13572799.05 (or 13,572,799.05)?

 

Thanks for your technical input,

 

Artp

 

N

Percent

Parents

1.36E+07

100

   

Total

1.36E+07

100

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

I don't know where you are getting a SUM from since you do not have any VAR type variables in the table.

 

The format would be assigned to the statistic keyword just as you have shown with N and Pctn.

The display of a value in exponential notation  means that you somewhere may have set a space that was too small for the number of digits.

 

table var*sum * f= F12.2

should work for a requested sum. IF you are using a comma format you need to allow for the extra characters the commas will take up and us Comma14.2 (or larger as needed)

View solution in original post

1 REPLY 1
ballardw
Super User

I don't know where you are getting a SUM from since you do not have any VAR type variables in the table.

 

The format would be assigned to the statistic keyword just as you have shown with N and Pctn.

The display of a value in exponential notation  means that you somewhere may have set a space that was too small for the number of digits.

 

table var*sum * f= F12.2

should work for a requested sum. IF you are using a comma format you need to allow for the extra characters the commas will take up and us Comma14.2 (or larger as needed)

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1167 views
  • 1 like
  • 2 in conversation