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
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.
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;
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.
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.