Date: Wed, 18 Feb 2004 12:09:32 -0700
Reply-To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject: Re: Persistent error in where statement...
Content-Type: text/plain; charset=us-ascii
Try
options symbolgen;
to see if the macro variables are resolving to something unexpected.
My guess is that JobArea is a character variable; you seem to be
treating it as a numeric variable.
--
JackHamilton@FirstHealth.com
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA
>>> "Jose Santos" <j-santos@TAMU.EDU> 02/18/2004 11:05 AM >>>
Hi All:
Following is a log from a program in which I'm using several macro
variables to filter the original data set.
===================================================
data temp;
set pds.maindata;
46 +where JobArea=&jobarea AND yearswit=&yearswith AND
edulevel=&educationlevel AND (pcttime between &maxpercenttime and
&minpercenttime)
________
The SAS System
22
76
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
IN (&competencies);
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.
Thanks.
Jose
|