Date: Mon, 3 Mar 2008 11:24:33 -0800
Reply-To: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject: Re: Question about array
In-Reply-To: <bcbe456e-79d7-4a46-a93d-4fbad9b8866e@k2g2000hse.googlegroups.com>
Content-Type: text/plain; charset=iso-8859-1
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of Mindy
> Sent: Monday, March 03, 2008 11:08 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Question about array
>
> Hey, buys,
>
> Below is part of my program, and I got some error messages after
> submission. It seems I could not define x_axis variable once I use
> array x_axis(8). Does anyone know why, and is there any way to define
> x_axis in the same data step? Thanks a lot.
> __ Mindy
>
>
> data univout3;
> set boxplot;
>
> length x_axis y_axis $50;
>
> array temp (8) min lowhisk q1 median q3 upwhisk max outlier;
> array x_axis(8) $50 x_axis1 - x_axis8 ;
>
> do i=1 to 8;
>
> if temp(i)=. then x_axis(i)='';
> else x_axis(i)=put(temp(i), 10.5);
>
> end;
>
> x_axis=outlier;
> run,
>
Mindy,
You can't x_axis as a variable name because you are already using it as an array name. Your only solution is to change the name of your array. If you want to maintain some association of array name to the variable list you could tack a "_a" on to the current array name (telling you its an array name), e.g.
array x_axis_a(8) $50 x_axis1 - x_axis8 ;
Hope this is helpful,
Dan
Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204
|