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...

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 336 views
  • 0 likes
  • 2 in conversation