%let DATA_PULL_TYPE=NA/Dummy
%macro datapultyp_chng;
%let DATAPULLTYPES= %sysfunc(compress("&DATA_PULL_TYPE"," "));
%If %Upcase(&DATAPULLTYPES.) = BLINDED %then %do;
%let DataPullType= 'Real(BlindBreak)';
%end;
%else %If %Upcase(&DATAPULLTYPES.) = UNBLINDED %then %do;
%let DataPullType= 'Real(Unblinded)';
%end;
%else %If %nrstr(%Upcase(&DATAPULLTYPES.)) = NADUMMY %then %do;
%let DataPullType= 'NA/Dummy';
%end;
%put &DataPullType;
%mend datapultyp_chng;
%datapultyp_chng;
*I am geeting error in resolving the above mentioned code;
post your log please
63 %let DATA_PULL_TYPE=NA/Dummy;
64
65 %macro datapultyp_chng;
66 %let DATAPULLTYPES= %sysfunc(compress("&DATA_PULL_TYPE"," "));
67 %If %Upcase(&DATAPULLTYPES.) = BLINDED %then %do;
68 %let DataPullType= 'Real(BlindBreak)';
69 %end;
70 %else %If %Upcase(&DATAPULLTYPES.) = UNBLINDED %then %do;
71 %let DataPullType= 'Real(Unblinded)';
72 %end;
73 %else %If %nrstr(%Upcase(&DATAPULLTYPES.)) = NADUMMY %then %do;
74 %let DataPullType= 'NA/Dummy';
75 %end;
76 %put &DataPullType;
77 %mend datapultyp_chng;
78 %datapultyp_chng;
MLOGIC(DATAPULTYP_CHNG): Beginning execution.
MLOGIC(DATAPULTYP_CHNG): %LET (variable name is DATAPULLTYPES)
SYMBOLGEN: Macro variable DATA_PULL_TYPE resolves to NA/Dummy
SYMBOLGEN: Macro variable DATAPULLTYPES resolves to NA/Dummy
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:
%Upcase(&DATAPULLTYPES.) = BLINDED
ERROR: The macro DATAPULTYP_CHNG will stop executing.
MLOGIC(DATAPULTYP_CHNG): Ending execution.
79
80 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
SYMBOLGEN: Macro variable GRAPHTERM resolves to GOPTIONS NOACCESSIBLE;
Use
%if %qupcase(&datapulltypes) = BLINDED %then %do;
This is required if your macro variable (in this case &datapulltypes) contains certain special characters (in this case the slash)
No not working 😞
Works for me.
My bet, Thanks you are right its working. Thaks a ton for your help
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.