Date: Tue, 29 Apr 2008 17:35:39 -0400
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: proc sql macro does not work
In-Reply-To: <2FE93DA9114E7E4A9A2EB70A77C9FFD336876D@LTA3VS003.ees.hhs.gov>
Content-Type: text/plain; charset=us-ascii
> From: Wong, Lee-Yang (CDC/CCEHIP/NCEH)
> I have some simple codes below that used to work, but for some reason
> one of the macro variables "munit" does not get resolved any
> more. I can
> not tell what could go wrong here. Any help will be greatly
> appreciated.
> proc sql noprint ;
> SELECT unit, type, year
INTO : Munit, : Mtype, : Myear
from x ;
quit;
%Let Munit = &Munit.;%*trim leading spaces;
%Let Mtype = &Mtype.;%*trim leading spaces;
%Let Myear = &Myear.;%*trim leading spaces;
you have not allocated the length of your Text* variables
%Let Text1
= Geometric mean and selected percentiles of %trim(&mtype)
concentrations;
%Let Text2 =(in %trim(&munit)) for the total U.S.;
%Let Text3 = population aged3 years and older, %trim(&myear).;
data Work.Text;
attrib Text1 %length(&Text1.)
Text2 %length(&Text2.)
Text3 %length(&Text3.);
text1 = "&Text1." ;
text2 = "&Text2.";
text3 = "&Text3.";
output;
stop;
>
> run ;
>
proc print data = Work.Text;
var Text:;
run ;
Ron Fehd the attrib
or macro maven CDC Atlanta GA USA RJF2 at cdc dot gov