Date: Thu, 8 Jan 2009 11:00:50 -0500
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: Macros in proc sql
In-Reply-To: <200901081547.n08BlLaE030044@malibu.cc.uga.edu>
Content-Type: text/plain; charset=us-ascii
%let ptno='as12' 'df14';
> proc sql;
create table cpna1_ptno as
> select Z format monyy7.,Y,X
from def.asd where z in(&ptno.);
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of SUBSCRIBE
> SAS-L Joe H. Smith
> Sent: Thursday, January 08, 2009 10:47 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Cc: SUBSCRIBE SAS-L Joe H. Smith
> Subject: Macros in proc sql
>
> data asd;
> input X $ Y z date9.;
> format z monyy7.;
> cards;
> as12 23 12\10\2002
> df14 52 12\5\2001
> ;
>
> %let ptno=as12 df14;
> proc sql;
> create table cpna1_&ptno as
> select Z format monyy7.,Y,X
> from def.asd where z="&ptno";
> quit;
>
> i am unaable to use macro variable in proc sql;
> please help
>
> Thanx
>
>
|