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

I have a dataset which one of the column has a value of "-0.75" but in proc report I want to display as "-0.75%". When I apply the format percent9.2 it converts to "(75.435)". But I want to display as "-0.75%".

 

data Percent;
format x BEST8.
p1 PERCENT7.1;
label x = "Raw value"
p1 = "PERCENT7.1";
input x @@;
p1 = x;

datalines;
1.85185 3.44498 -0.92507 -0.7543456
;

proc print data=Percent noobs label; run;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

first divide your number by 100, then use the nlpctn6.2 format

--
Paige Miller

View solution in original post

4 REPLIES 4
BrunoMueller
SAS Super FREQ

Use the PERCENTN format and all is good

K1235
Fluorite | Level 6

Thank you for replying @BrunoMueller. But PERCENTN didnt solve. It outputs as (75.43%). I want to display as -0.75%. 

PaigeMiller
Diamond | Level 26

first divide your number by 100, then use the nlpctn6.2 format

--
Paige Miller
ballardw
Super User

@K1235 wrote:

Thank you for replying @BrunoMueller. But PERCENTN didnt solve. It outputs as (75.43%). I want to display as -0.75%. 


Show the code. One suspects you missed the format spelling. And a value to appear as -0.75% would have to be -.0075 as a decimal.

 

data junk;
   x=-.007543;
run;
proc print data=junk;
   format x percentn10.4;
run;

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
  • 4 replies
  • 2119 views
  • 0 likes
  • 4 in conversation