Date: Thu, 22 Aug 2002 09:37:18 -0400
Reply-To: "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Subject: Re: Proc sql question.
Content-Type: text/plain; charset="iso-8859-1"
> I am trying to run the following code. Where macro variables &m and &y
> represent the month and year. 'test1' is the table name.The
> code is running
> fine with out any macro variables. That is when instead of
> &m.&y. , suppose we
> put '072002'. But when we put in a macro it is saying that
> "column name
> '072002' not found".
> Am I missing something here?
> Is there something in the macro variables?
> Can we use macro variables here?
> Any help is greatly appreciated
> proc sql;
> connect to sybase (server=xxxxxx db=xxxxx user=xxxx password=xxxxx);
> execute (delete from test1 where DATE="&m.&y.") by sybase;
I think you have a quoting issue here. I would guess the code SAS is seeing
(when you subsitute the macro variables) is DATE=072002, rather than
DATE='072002' or DATE="072002". The first would be interpreted as looking
for a variable call 072002, which would give the error you describe.
I'm not very good with all the variants of quoting functions and single vs.
double quotes, but this may put you on the right track for a fix.