The SUM function adds two (or more) values
In this case, it adds the value of this date
"&rpt_run_dt."d
and the negative of the value of variable DATE. Essentially this is a subtraction, but because it is in the SUM function, a missing is treated as zero and then the SUM function does not return a missing if one of the values is missing.
By the way, those "curly" quotes in your code snippet will cause an error and should never be used. Use "straight" quotes as I did above.
By the way, I assume that rpt_run_dt is a macro variable even though you didn't use the & because if not, then this won't work either, the period immediately after rpt_run_dt will cause an error if it is not a macro variable.
Please type carefully!
The SUM function adds two (or more) values
In this case, it adds the value of this date
"&rpt_run_dt."d
and the negative of the value of variable DATE. Essentially this is a subtraction, but because it is in the SUM function, a missing is treated as zero and then the SUM function does not return a missing if one of the values is missing.
By the way, those "curly" quotes in your code snippet will cause an error and should never be used. Use "straight" quotes as I did above.
By the way, I assume that rpt_run_dt is a macro variable even though you didn't use the & because if not, then this won't work either, the period immediately after rpt_run_dt will cause an error if it is not a macro variable.
Please type carefully!
@bhca60 wrote:
Yes it’s a macro. Thank you. Yes I had to type this since I didn’t want to use my work computer that’s why the quotes look like that and I forgot the ampersand.
No, it's not a macro. It is a macro variable. Macros and macro variables are different things. Do not say macro variables are "a macro". Clear communication avoids confusion!
Typing here in the SAS forums will not produce curly quotes. See --> """""""
Typing in a word processor or something like PowerPoint produces the curly quotes. Don't use word processors or PowerPoint for typing SAS code.
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →