Date: Mon, 11 Aug 2008 15:19:59 -0500
Reply-To: "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "./ ADD NAME=Data _null_," <iebupdte@GMAIL.COM>
Subject: Re: data questions
In-Reply-To: <035101c8fbe6$a50076a0$832fa8c0@HP82083701405>
Content-Type: text/plain; charset=ISO-8859-1
On 8/11/08, Mary <mlhoward@avalon.net> wrote:
> Actually, none of these looks like real-world problems;
While somewhat odd in some respects the 3 questions posed are are common usage.
in an array, you would usually assign a variable list
>
> array arraylist{*} var1--var1000;
> and thus the parameters would be a list of variables
the array statement has the ability to declare variable including
define the length. So in your example you could have
array var[1000];
and that would declare the variable var1-var1000 or reference them if
they already existed. You could also include a length although I
rarely change the default length of numeric variable and accept the
default 8. I more commonly specify the length for array of character
variables.
array var[1000] $10;
One more thing about this particular array name VAR, or any other
function name, causes a bit of problem.
492 array var[10] 4;
493 var[1]=var(1,45,90);
WARNING: The array var has the same name as a SAS-supplied or
user-defined function. Parenthesized references involving this name
have been treated as array
references and not function references.
ERROR: Too many array subscripts specified for array var.
>
> In a sum you would have a list of arguments
> sum(var1,var2,var3);
> and usually each argument would be a different variable
sum(of _NUMERIC_,5000) is a valid argument list. _NUMERIC_ is a "SAS
Variable List" a very "powerful" feature of the SAS language.
>
> and in a do loop you would usually go from one value to another value, such as
> do i=1 to dim(arraylist);
1e6 as Mark pointed out is Scientific notation for 1,000,000.
Although in the original post it was IE6, variable name which would be
a valid TO expression for a do loop, unless it was missing.
>
> So it does look like your questions are not particulaly relevant to any real-world problems. Who is making up the questions? Why!!!!
>
> -Mary
> answers: 1. the first value in your array, 2. the last argument in the sum function, 3. the upper end to the loop.
>
> ----- Original Message -----
> From: jingtailan@gmail.com
> To: SAS-L@LISTSERV.UGA.EDU
> Sent: Monday, August 11, 2008 2:03 PM
> Subject: data questions
>
>
> all:
>
> I have 3 questions:
>
> 1. array _[1000000] 8;
> question: what is 8 mean?
>
>
>
> 2. sum=sum(of _numeric_, 5000);
>
> question: what is 5000 mean?
>
>
> 3. do i=1 to le6;
>
>
> question: what is le6 mean?
>
> Thanks.
>
> Jingtailan
>