04-18-2017 09:30 AM
I am getting this error and cant seem to figure out what is going on
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;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
04-18-2017 10:08 AM
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.
04-18-2017 10:17 AM
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.
Need further help from the community? Please ask a new question.