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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.