DATA Step, Macro, Functions and more

Symget vs Resolve

Posts: 50

Symget vs Resolve

Hello Forum,

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

Thanks !!!

Super User
Posts: 3,927

Re: Symget vs Resolve

Posted in reply to kaushal2040

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

Super User
Posts: 13,583

Re: Symget vs Resolve

Posted in reply to kaushal2040

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.
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation