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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1331 views
  • 0 likes
  • 3 in conversation