Hello, expert,
I have code:
ROC SQL;
CREATE TABLE WORK.Number AS
SELECT int(MAX('Primary ID'n / 7)) FORMAT=BEST12. into:RowN
FROM WORK.modeltraining_blocked;
QUIT;
%macro leaveoneout;
%local i;
%do i=1 %to 7;
data model_sample;
set WORK.modeltraining_blocked;
if ('Primary ID'n < (&i-1)*&RowN) or ('Primary ID'n > (&i+1)*&RowN);
run;
%end;
%mend;
when this code is running, it shows.
1. WARNING: INTO clause is ignored in the CREATE TABLE statement.
2. if ('Primary ID'n < (&i-1)*&RowN) or ('Primary ID'n >
78 ! (&i+1)*&RowN); (two red underlie below the ")")
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, INPUT, PUT.
would you please suggest the reason?
Many thanks
Hello,
You cannot create a new table and export columns to macrovariables using
the same SELECT instruction. Hence the INTO clause is ignored and the macrovariable
RowN not created.
Hello,
You cannot create a new table and export columns to macrovariables using
the same SELECT instruction. Hence the INTO clause is ignored and the macrovariable
RowN not created.
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.