BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
scolitti1
Calcite | Level 5

Hi,

 

I am creating code that will send out an automatic report. This is a daily report and it tracks the changes from day to day. I want to track the difference by a (+) or (-) so whoever reads it knows if the numbers are going up or down. 

 

For example, here is part of my output:

As of 19SEP2022, The percentage of beds occupied is 3.1% ( (    0.1%) change from the previous day).

 

I would like to say (-0.1% change from the previous day). Also how do I get rid of the extra parentheses around the 0.1%?

 

Please see code below: 


data test;
set counts11;
DIF_bullet1 = DIF(prop_new);
format today_s_date MMDDYY10.;
run;

 

Data bullet1;
Set test;
CALL SYMPUTX('bullet1', put(prop_new,percent10.1));
CALL SYMPUTX('DIF_bullet1', put(DIF_bullet1, percent10.1));
KEEP today_s_date prop_new DIF_bullet1;
Run;

 

OPTIONS EMAILSYS=smtp Emailhost = placeholder.org EMAILPORT=25 EMAILID="placeholder.org"; 
FILENAME Mailbox EMAIL ATTACH=("T:\Placeholder" "T:\Placeholder");
Data _NULL_;
FILE Mailbox TO=('Placeholder.org')
CC=('placeholder.org')

SUBJECT="Daily Report &today";

 

PUT "The &today  Report.";
PUT " ";
PUT "• As of &today, The percentage of beds occupied is &bullet1. ( &DIF_bullet1. change from the previous day).";

 


proc printto;
RUN;

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Use the PERCENTN. format — actually this only puts the negative sign on the percent, it will not put a plus sign on it. For 99.9% of uses, the + is understood if it is not present.

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

Use the PERCENTN. format — actually this only puts the negative sign on the percent, it will not put a plus sign on it. For 99.9% of uses, the + is understood if it is not present.

--
Paige Miller