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

I have data something which has negative values and 0 with decimals and i want 2 decimals for all non zero values.

 

I tried format=6.2 in proc report but it also makes 0 as 0.00. is there any way to skip 0 while using it in define in proc report?

1 ACCEPTED SOLUTION
2 REPLIES 2
PaigeMiller
Diamond | Level 26

A custom format ought to work

 

proc format;
    value custf 0=0 other=[6.2];
run;

Then in PROC REPORT

 

define var / format=custf.;

 

--
Paige Miller

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
  • 2 replies
  • 1033 views
  • 0 likes
  • 3 in conversation