BookmarkSubscribeRSS Feed
scolitti1
Calcite | Level 5

I have created an automated report that changes based on daily numbers. I have been asked to add (+) or (-) in front of increased or decreased numbers. SAS will already put a (-) sign in front of a decreased number, so I put together code that will out put a (+) for an increased number. However, if there was no change or if there was a decrease it will still output a (+). Below is my code so far:

 


data emaster;
set counts11;
if DIF_bullet1>0 then b1='+'; else if DIF_bullet1<=0 then b1='';
format today_s_date MMDDYY10.;
run;

1 REPLY 1
Quentin
Super User

I'm not quite understanding your example, but would suggest building a picture format, as described in the answers to this post:

https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Numeric-Format-add-positive-sign-to-value...

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

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 545 views
  • 0 likes
  • 2 in conversation