BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi Friends,

I tried with Format negparen6.2 for numeric column. If the field is wide enough, NEGPARENw.d places parentheses around a number to represent a negative value. But i need to be negative sign. Please help me. Very urgent.

Thanks,
Selvi.
3 REPLIES 3
Cynthia_sas
Diamond | Level 26
Try making your width value -smaller- in order to get the parentheses to go away and show a negative sign (with negparen format) or simply use a w.d format as shown below. For more help with formatting numbers, there is extensive documentation in the SAS on-line doc or you can always call on Tech Support for help with a user-defined PICTURE format of your own.
cynthia
[pre]
data fmtnum;
input num;
return;
datalines;
-1
-.045
4
.065
;
run;

ods listing;
proc print data=fmtnum;
title 'with negparen format -- format cannot be too big';
format num negparen5.3 ;
run;

proc print data=fmtnum;
title 'with simple w.d format';
format num 5.3 ;
run;
[/pre]
Smora0713
Calcite | Level 5

How would you go about having both parentheses and a dollar sign? e.g. ($20.01).

 

Is there a present format that I can use if not would I need to create one with Proc Format?

 

Cynthia_sas
Diamond | Level 26

Hi:

  Rather than piggyback on such an old posting, you might want to start a new post. I nearly didn't read this when I saw how old the original post was.

 

  I think your only choice is a PICTURE format, as shown in example #3:

Cynthia_sas_0-1591141821700.png

 

 

Hope this helps,

Cynthia

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 5497 views
  • 0 likes
  • 3 in conversation