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 (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

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!

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