Hello I am having trouble masking the following highlighted in yellow:
proc report data=safrptshell1 nowd
...;
compute groups;
if groups='OVERALL' then
do;
groups="Criteria (%nrbquote(Dummy = "Y"))";
call define (_col_, "style/merge", "style=[font_face=&font. fontstyle=italic]");
end;
else if strip(groups) in(...) then
do;
call define (_col_, "style/merge", "style=[font_weight=bold]");
end;
endcomp;
run;
I get the following error "ERROR 388-185: Expecting an arithmetic operator." It seems no matter what type of masking I try, the procedure unmasks the block of line before execution. Is there a way to quote/mask this?
Thank you!
If you have control over the macro variable generation then it is not much of an issue.
%let group = Dummy='Y';
...
groups="Criteria (&group)";
If don't and the value of &GROUP might have double quotes then you can use QUOTE() function to make sure they are properly doubled up.
groups= %sysfunc(quote(Criteria (&group)));
At a guess, just put single quotes around it:
groups='Criteria (Dummy = "Y")';
If you have control over the macro variable generation then it is not much of an issue.
%let group = Dummy='Y';
...
groups="Criteria (&group)";
If don't and the value of &GROUP might have double quotes then you can use QUOTE() function to make sure they are properly doubled up.
groups= %sysfunc(quote(Criteria (&group)));
QUOTE function will properly quote DUMMY to produce the correct syntax.
%let dummy = dummy = "y";
data class;
length sex $32;
set sashelp.class;
run;
proc report data=class;
columns sex height;
define sex / group;
compute sex;
if sex = 'M' then do;
sex = %sysfunc(quote(Criteria(&dummy)));
end;
endcomp;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.