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.

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