BookmarkSubscribeRSS Feed
ThomasH
Calcite | Level 5
Hi,

I'm trying to get rid of %nrquote for an option of a user written tool.

I have set up 2 options and for 1 of them %nrquote should not be used in the gererated code. Setting it to Integer as attribute of the option does not help.

Background:

%let x = %nrquote(7);
[...]
data &_output.;
[...]
input (fln1-fln&_x) ($);
run;
[...]

Attaching &_x nrquoted does not work, with %let x = 7 it works.

Thanks and regards,
Thomas
3 REPLIES 3
Patrick
Opal | Level 21
Hi Thomas

Not sure if that will help you:

What I encountered in DI was that options (macrovars) were somehow quoted which caused problems when using the macrovar values in comparisons.
What helped was (in user written code) to %unquote() them.

if myvar=%unquote(&myoptionMvar) then....

HTH
Patrick
LinusH
Tourmaline | Level 20
Patrick's tip has helped me as well several times, and it will help in this situation as well, except for...just of curiosity, could it really work with x = 7? x and _x are totally different macro variables...?! Have you defined _x somewhere else in your code perhaps or is it a typo?

Regards,
Linus
Data never sleeps
ThomasH
Calcite | Level 5
Hi,

that was a typo indeed, but %unquote helped out anyway!

Thanks a lot,
Thomas

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1476 views
  • 0 likes
  • 3 in conversation