Hello
I am trying to send email from SAS to multiple recipients using a macro and want to bold part of the sentence. However, it seems the "bold" does not work with a macro variable
This works
put '.Message1 { color: Red; font-size: 10pt; font-weight: bold; }';
put ' <span class="Message1"> your facility is selected </span>';
But this does not
put '.Message1 { color: Red; font-size: 10pt; font-weight: bold; }';
put ' <span class="Message1"> &facilityname is selected </span>';
when I run the macro, it does not replace the facilityname with the name, but keep &facilityname as bold type
Any suggestion?
Thank you
Looks like you have the macro variable reference &facilityname between single quotes. In that case the reference is not resolved. Use double quotes and you'll be fine. You will also have to double up on the existing double quotes to retain them between double quotes (still with me?).
put " <span class=""Message1""> &facilityname is selected </span>";
Good luck
- Jan.
Looks like you have the macro variable reference &facilityname between single quotes. In that case the reference is not resolved. Use double quotes and you'll be fine. You will also have to double up on the existing double quotes to retain them between double quotes (still with me?).
put " <span class=""Message1""> &facilityname is selected </span>";
Good luck
- Jan.
Thank you very much. It works. Do you have any guidelines or links on how and when to use single and double quotes?
Quite entertaining and informative is this paper: https://support.sas.com/rnd/papers/sgf07/Macros_Dont_Work.pdf
The presentation is old but no less useful. Quoting is at the very heart of the macro facility and around since the beinning of times. I would advise to take a broader approach to learning macro and not focus too much now on this topic. It starts easy but can become complicated real fast. There are many good resources; let Google be your guide.
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 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: