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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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