Hello all, Currently I'm writing a SAS program that will send out a status email and depending on the time of day I want it to change the Subject line of the email to say Noon/Afternoon/Evening status email. Below is the IF statement I use to decide what the subject line should read, however I am getting a problem. Since 'Noon' is the first to be looked at it makes the variable 'timeofday' set to 4 character bytes, so when it's actually 1600 hours and selects 'Afternoon' the code actually spits out 'Afte' into the subject line. In other words because timeofday shows up first as being set to 'Noon' it is restricting that variable to being set with only 4 characters. IF hour(datetime()) = 12 THEN timeofday = "Noon"; ELSE IF hour(datetime()) = 16 THEN timeofday = "Afternoon"; ELSE IF hour(datetime()) = 19 THEN timeofday = "Evening"; ELSE timeofday = "NA"; I tried using a length statement to make it allow at least 10 character bytes into the variable, however when I try this it fills in the empty spaces with spaces making the subject line look weird. For example for noon it spits out the following 'Noon '. I tried using the below bit of code to set this part. length timeofday $10 default=4; Any tips would be greatly appreciated!
... View more