BookmarkSubscribeRSS Feed
kaushal2040
Calcite | Level 5

Hello Forum,

I was trying  to understand difference between Symget and Resolve function in macro facility (if there are examples).

Thanks !!!

2 REPLIES 2
SASKiwi
PROC Star

More Like This to the right of your post - does this help?

https://communities.sas.com/message/46674#46674

ballardw
Super User

From the documentation:


  • RESOLVE resolves the value of a text expression during execution of a DATA
    step or SCL program, whereas a macro variable reference resolves when a DATA
    step is being constructed or an SCL program is being compiled. For this reason,
    the resolved value of a macro variable reference is constant during execution of
    a DATA step or SCL program. However, RESOLVE can return a different value for a
    text expression in each iteration of the program.

  • RESOLVE accepts a wider variety of arguments than the SYMGET function
    accepts. SYMGET resolves only a single macro variable but RESOLVE resolves any
    macro expression. Using RESOLVE might result in the execution of macros and
    resolution of more than one macro variable.

  • When a macro variable value contains an additional macro variable reference,
    RESOLVE attempts to resolve the reference, but SYMGET does not.

  • If argument references a nonexistent macro
    variable, RESOLVE returns the unresolved reference, whereas SYMGET returns a
    missing value.

  • Because of its greater flexibility, RESOLVE requires slightly more computer
    resources than SYMGET.

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
  • 2 replies
  • 1833 views
  • 6 likes
  • 3 in conversation