BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ronein
Onyx | Level 15

Hello

I have numeric values with format percent8.2

The negative values are displayed with ()

Example:

(11.60%)
1.41%

 

My question:

I want that negative values diaplay with minus and not ()

what is the way to do it?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Amir
PROC Star

Hi,

 

You could try something like the below. It uses the PERCENTNw.d format (notice the extra "N" in PERCENTNw.d).

 

data have;
  format pc2 percentn8.2;
  input pc1;
  
  pc2 = pc1;
  
  datalines;
-0.116
0.0141
;

 

 

Thanks & kind regards,

Amir.

 

Edit: Typo.

View solution in original post

3 REPLIES 3
Amir
PROC Star

Hi,

 

You could try something like the below. It uses the PERCENTNw.d format (notice the extra "N" in PERCENTNw.d).

 

data have;
  format pc2 percentn8.2;
  input pc1;
  
  pc2 = pc1;
  
  datalines;
-0.116
0.0141
;

 

 

Thanks & kind regards,

Amir.

 

Edit: Typo.

Ronein
Onyx | Level 15

Thanks.

so the difference is that I used percent8.2  and you used percentn8.2 ?

Amir
PROC Star

Hi Ronein,

 

Yes, that appears to be the case. You can see more from the documentation by using the link I provided in my previous post; thanks for marking it as a solution.

 

 

Thanks & kind regards,

Amir.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 838 views
  • 1 like
  • 2 in conversation