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

Hello

 

I am getting this error and cant seem to figure out what is going on

 

Thanks

 

Rida

 

 

 

WARNING: Apparent symbolic reference THRU_ALL not resolved.
NOTE 137-205: Line generated by the invoked macro "QTRLY_SUMS".
809         PROC APPEND BASE=rptlib.qrtly_sum_totals1 DATA=in_b FORCE; RUN;    PROC SQL;    CREATE TABLE rptlib.qrtly_sum_totals AS
809      !    SELECT     *     ,&thru_all.    FROM rptlib.qrtly_sum_totals1   ;QUIT;
                                                   ______
                                                   22
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

If it is undefined then it will still generate a syntax error. It will just leave the macro reference as it was and the this: 

select * &thru_all.

Is not valid syntax.

View solution in original post

6 REPLIES 6
art297
Opal | Level 21

What is the macro variable &thru_all and is it even needed. By using select * you are already selecting all of the dataset's variables.

 

Art, CEO, AnalystFinder.com

 

LinusH
Tourmaline | Level 20

Well, it could be a constant that should be added to the result.

Either way, it's not assigned at the execution time for this query.

Data never sleeps
RW9
Diamond | Level 26 RW9
Diamond | Level 26

WARNING: Apparent symbolic reference THRU_ALL not resolved.

 

The above is telling you that the macro variable THUR_ALL does not exist.  Therefore the code:

SELECT     *     ,    FROM

Is invalid.

Kurt_Bremser
Super User

If macro variable thru_all is to be used to add a variable (or several variables) to a dataset, it should contain the comma, and your code should look like

proc sql;
create table rptlib.qrtly_sum_totals as
select * &thru_all.
from rptlib.qrtly_sum_totals1;
quit;

Now you will get no ERROR if &thru_all is empty or undefined. The WARNING for an undefined macro variable will persist, though.

Tom
Super User Tom
Super User

If it is undefined then it will still generate a syntax error. It will just leave the macro reference as it was and the this: 

select * &thru_all.

Is not valid syntax.

Kurt_Bremser
Super User

@Tom wrote:

If it is undefined then it will still generate a syntax error. It will just leave the macro reference as it was and the this: 

select * &thru_all.

Is not valid syntax.


Correct. Shame on me.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 6 replies
  • 1434 views
  • 1 like
  • 6 in conversation