BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8
Where do I put the quotes in order to get this macro variable (ie &date) to work?
if (daysum=. and day< *&date.*d) then daysum=0;

where * is a single quote mark.
where &date can be, for example, 15Sep10.

Thank you.
5 REPLIES 5
art297
Opal | Level 21
Have you tried it with double quotes?

Art
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
When using macro variables coded as literal constants/data-strings with DATA/PROC code, double-quotes are required for proper resolution. Also, when debugging your program, code the OPTIONS SYMBOLGEN, also consider this coding for debugging macros and macro variables:

OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MPRINT;

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

macro variable intro site:sas.com
gzr2mz39
Quartz | Level 8
Double quotes worked.
For what ever reason they didn't work the first time I tried.
Thanks.
PatrickG
SAS Employee
With macros, use double quotes. The SAS Macro Facility will not look inside of single quotes.
chang_y_chung_hotmail_com
Obsidian | Level 7
> With macros, use double quotes. The SAS Macro
> Facility will not look inside of single quotes.


Technically, this is too sweeping a statement. You cannot really say that Macro *never* look inside of single quotes as shown on the thread started with this sas-l posting.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1489 views
  • 0 likes
  • 5 in conversation