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 up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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