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

Hi,

 

in my dataset Kredit1 I want to sum the values of the column c3 and want to copy the result into a new row of the same table. That works. But: The result has no or only one decimal-digit. The aim is: 3 decimal-digits.

I use the following code...is there a option for this code, which could help?

 

 

proc sql noprint; 
select sum(c3) into :Gem3 from Kredit1;
quit;

proc sql;
insert into KREDIT1 (NameBST,c3)
values ("Gem",&Gem3);
quit;

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Apply the desired format to the sum

 

Example:

proc sql noprint; 
select sum(c3) format=10.3 into :Gem3 from Kredit1;
quit;

 

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Apply the desired format to the sum

 

Example:

proc sql noprint; 
select sum(c3) format=10.3 into :Gem3 from Kredit1;
quit;

 

--
Paige Miller
Konkordanz
Pyrite | Level 9
Thank you!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 1454 views
  • 1 like
  • 2 in conversation