Date: Thu, 10 Jan 2008 15:53:05 -0500
Reply-To: SUBSCRIBE SAS-L Philippe <laffilippe@YAHOO.FR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: SUBSCRIBE SAS-L Philippe <laffilippe@YAHOO.FR>
Subject: Error when creating view with macro variable
Hi,
I used a PROC SQL, with a simple CREATE VIEW. There is several macro
variables, especially the name of the view, and that is the problem.
I have this problem on a Solaris, but not in my environment Windows (both
is SAS 9.1).
The code :
%let LIB = %nrquote(&LIB_SPDS);
%let CLUSTER = %nrquote(&CLUSTER);
%let USER_SPDS = %nrquote(&USER_SPDS);
options mprint symbolgen;
%macro create_view_ext;
%let VIEWEXT = &LIB..&CLUSTER._EXT;
%LET datechargement='15jun2007'd;
%LET mois1=;
%LET mois2=;
%LET mois3=;
data _null_;
call symputx('mois1',intnx
('month',&datechargement,+1,'beginning'));
call symputx('mois2',intnx
('month',&datechargement,0,'beginning'));
call symputx('mois3',intnx('month',&datechargement,-
1,'beginning'));
run;
proc sql;
create view &VIEWEXT (var1, var2, flx_dis_dtd) AS
select * from &LIB..&CLUSTER
where flx_dis_dtd < &mois3;
quit;
%mend;
The log is like this :
ERROR 22-322: Syntax error, expecting one of the following: (, '.', AS
In the log, the macro variable &VIEWEXT is resolved, but there is always
this error. If i write the viewext in hard code, it works ! so what
happens ?
Thanks a lot for your help.
Philippe
|