Hi,
I wanted to use a macro variable &var in the imagename like this:
ods graphics on /
reset=all imagename="ROC_&var";
I got this warning from log
WARNING: The IMAGENAME option or the output name contains invalid characters. ROC_interestrate will be used as the image name
prefix.
ROC_interestrate is the name that I wanted for my graph. So this warning didnt really affect my result. But I am curious where I did sth. wrong. Can someone please help me?
Thank you very much in advance!
BR Ding
I would suspect from the minimum information the macro variable is resolving with spaces after it, if you are sure there is no special characters. Try %trim(&var.). Maybe turn options mprint mlogic symbolgen; so you can see what it is resolving to.
how do you assign the value to the &var.
share your code please
hi
I use var as an input argument in a %marco(). The values of the var is sth. like interestrate, affordability. I just tried %trim(&var.) and still get the same warning.
BR Ding
okay input argument to the macro,but share your code to help you further.
hi
this is a part of the code:
%macro UV(data_in, var, var_class, data_out);
ods html close;
data tmp0;
format variable $20.;
Variable="&var.";
run;
ods graphics on /
reset = all imagename = "ROC_&var";
ods select ROCCurve;
.....
%mend;
thanks very much!
BR Ding
I am asking about the part when you assign the value to var and calling UV.
Give example of how you call the UV macro passing the argument to it.
I would suspect from the minimum information the macro variable is resolving with spaces after it, if you are sure there is no special characters. Try %trim(&var.). Maybe turn options mprint mlogic symbolgen; so you can see what it is resolving to.
Yes, how do you assign 'var'?
For example, this doesn't cause a problem:
%UV(flurg, interstrate, class, foo);
So, what do you do?
And you might try adding the following code to macro UV:
data a;
imagename = "ROC_&var";
put imagename;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.