BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jonison
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
gamotte
Rhodochrosite | Level 12

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.

View solution in original post

1 REPLY 1
gamotte
Rhodochrosite | Level 12

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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 545 views
  • 0 likes
  • 2 in conversation