If the value of the macro variable have spaces then the following code is throwing the syntax error. Code and log is shown below. Any help to resolve the issue?
Value of macro variable 'parameter_2' resolves to 'Data Management'
Program:
proc print data=sorted_nodup noobs;
where ¶meter_1 IN("¶meter_2");
var &_field;
run;
data _null_;
test = '/'||¶meter_2||'/';
put test=;
run;
Log:
12 proc print data=sorted_nodup noobs;
13 where ¶meter_1 IN("¶meter_2");
14 var &_field;
15 run;
NOTE: There were 194 observations read from the data set WORK.SORTED_NODUP.
WHERE DIVISION='Data Management';
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
16
17 data _null_;
18 test = '/'||¶meter_2||'/';
NOTE: Line generated by the macro variable "PARAMETER_2".
18 Data Management
----------
22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT,
LE, LT, MAX, MIN, NE, NG, NL, OR, [, ^=, {, |, ||, ~=.
19 put test=;
20 run;
... View more