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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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