BookmarkSubscribeRSS Feed
Bill
Quartz | Level 8

My code:

proc format;

value &mkt

other="%nrstr(&custname);

run;

This does not resolve to the intended name but remains as &custname.  Can anyone help?

Thank you,

Bill

4 REPLIES 4
garybald
Calcite | Level 5

It would be nice to see the log to know more about your program.

You only have one double quote.

Try  other="%nrstr(&custname)";

or

other=%nrstr("&custname");

to force it to resolve.

Bill
Quartz | Level 8

Sorry, typing error on my part.  I did have

other="%nrstr(&custname)";

The log show no errors.

393 %macro fmt;

395 value $mkt

396 other="%nrstr(&CustName)";

397 run;

398 %mend fmt;

399 %fmt;

NOTE: Format $MKT has been output.

Other placements of the quotes did not help either.

394 proc format;

Reeza
Super User

We'd need to see what the &mkt macro variable does resolve to to help out.

If you're trying to create a format and have the data somewhere else consider using CNTLIN option instead of a macro variable.  CNTLIN option allows you to create a format from a dataset.

Bill
Quartz | Level 8

Thanks for the cntlin idea.  I hadn't thought of using it in this context.  I want with the following:

data Customer;

fmtname='$mkt';

start='other';

label="&custname";

run;

proc format cntlin=Customer;

run;

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