Date: Wed, 18 Feb 2004 14:05:16 -0500
Reply-To: Jose Santos <j-santos@TAMU.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jose Santos <j-santos@TAMU.EDU>
Subject: Persistent error in where statement...
Following is a log from a program in which I'm using several macro
variables to filter the original data set.
46 +where JobArea=&jobarea AND yearswit=&yearswith AND
edulevel=&educationlevel AND (pcttime between &maxpercenttime and
The SAS System
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *,
**, +, -, /, <, <=, <>, =, >, >=, AND, EQ, GE, GT, LE, LT, NE, OR, ^=, |,
ERROR 76-322: Syntax error, statement will be ignored.
47 +AND sfyear="&startyear" and efyear="&endyear" AND competencyid
ERROR: Syntax error while parsing WHERE clause.
It's saying that I got a problem with yearswit (there's really no "h")
database variable. To discount the problem that it's not due to the
yearswit variable that's causing it, I deleted the variable from the where
statement. After deletion, the edulevel variable moved to the same
physical position where the deleted yearswit=&yearswith was before and was
showing the same error. I already checked all my macro variables against
the web form and the variables in the databsse being referenced by my where
statement. It seems that's there is something in the physical positioning
of the variable within the where statement that's causing a problem. BTW,
I am not using any option statement to run the program.
My globals are as follows:
+%GLOBAL competencies competencies0 startyear endyear jobarea yearswith
educationlevel minpercenttime maxpercenttime;
I really could use some help on this.