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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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