Sorry i'm not good at english..
please tell me what grammar is wrong.
how to fix it...
I attached a log message below.
%macro number;
%do i=20 %to 21;
proc sql;
create table work.bb_&i. as
select *
from work.dummy
where substr(num_str,5,2) =%nrbquote('&i.');
quit;
%end;
%mend number;
%number;
Log message
23 %macro number;
24 %do i=20 %to 21;
25 proc sql;
26 create table work.bb_&i. as
27 select *
28 from work.dummy
29 where substr(num_str,5,2) =%nrbquote('&i.');
30 quit;
31 %end;
32 %mend number;
33 %number;
NOTE: Line generated by the macro function "NRBQUOTE".
1 '20'
-
22
-
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, (, *, +, -, ALL, ANY, BTRIM, CALCULATED, CASE, INPUT, PUT, SELECT, SOME, SUBSTRING, TRANSLATE,
USER.
ERROR 200-322: The symbol is not recognized and will be ignored.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.12 seconds
cpu time 0.04 seconds
NOTE: Line generated by the macro function "NRBQUOTE".
1 '21'
-
22
-
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, (, *, +, -, ALL, ANY, BTRIM, CALCULATED, CASE, INPUT, PUT, SELECT, SOME, SUBSTRING, TRANSLATE,
USER.
ERROR 200-322: The symbol is not recognized and will be ignored.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.04 seconds
cpu time 0.00 seconds