Date: Wed, 20 Aug 2008 14:43:39 -0400
Reply-To: Bucher Scott <SBucher@SCHOOLS.NYC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Bucher Scott <SBucher@SCHOOLS.NYC.GOV>
Subject: Re: macro variable generated by Proc SQL
Content-Type: text/plain; charset="us-ascii"
Are you running %PUT _USER_; inside the macro? Unless otherwise
declared, the scope of the variables will be local, i.e. will not exist
once the macro they are in stops running.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Wednesday, August 20, 2008 2:27 PM
Subject: macro variable generated by Proc SQL
I'm having some trouble with generating macro variables from a SQL
I've done that in the past and never had problems, however here I'm
adding a couple of layers of complexity and there must be something
I'm doing wrong.
Here's how the code looks like, the macro variables &id, &i and &&id&i
have been defined in a previous step and a %PUT _USER_ statement shows
they exists and are correctly defined. the macro variables that are
giving me problems are those in the "into" part of the code.
%do i=1 %to &tot;
select min(date) as mindate, max(date)as maxdate, (select dos from
chartdata_&&id&i where l=1) as lastdos
into :first_&&id&i, :last_&&id&i, :lastdos_&&id&i
When I run
I don't see any of the variables that were supposed to be created in
the Proc SQL step.
Any ideas? Is there a limit on how many macro variables SAS can