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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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