Date: Thu, 10 Jan 2008 21:34:57 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Error when creating view with macro variable
In-Reply-To: <200801102053.m0AKJeKn002992@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="iso-8859-1"
In this>>> create view &VIEWEXT (var1, var2, flx_dis_dtd) AS
This isnt valid syntax (var1, var2, flx_dis_dtd)
Remove it or move it to where it is suppose to go too
Toby Dunn
"Don't bail. The best gold is at the bottom of barrels of crap."
Randy Pausch
"Be prepared. Luck is where preparation meets opportunity."
Randy Pausch
> Date: Thu, 10 Jan 2008 15:53:05 -0500
> From: laffilippe@YAHOO.FR
> Subject: Error when creating view with macro variable
> To: SAS-L@LISTSERV.UGA.EDU
>
> 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
_________________________________________________________________
Get the power of Windows + Web with the new Windows Live.
http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_012008
|