Date: Fri, 9 Apr 2004 14:30:04 -0500
Reply-To: aldi <aldi@WUBIOS.WUSTL.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: aldi <aldi@WUBIOS.WUSTL.EDU>
Organization: Washington University in St. Louis
Subject: Re: ERROR: Array subscript out of range
Content-Type: text/plain; charset=us-ascii; format=flowed
Ron,
Do you know the reason why SAS is not shouting: "here is the ARRAYx that
is limited by / passed the bound"?
Thanks for all your advice,
Aldi
Fehd, Ronald J. PHPPO wrote:
>>From: aldi [mailto:aldi@wubios.wustl.edu]
>>You see, I answered you and I did not ask you a very simple
>>question: (Because I have included some line space now the
>>error is saying line 6694 col 206.)
>>
>>You mentioned "that's the line and column are for..."
>>
>>My program is a group of programs and a good part of them
>>expressed in
>>macro language: how do you count the lines to match with what SAS is
>>reporting?
>>
>>Right now if I go to the log, where SAS is reporting the
>>error the line
>>number is 279,334. If I return to the numbering of the lines of the
>>program interface (in the log) SAS has provided numbers for
>>the program
>>interface only, but not the other subprograms that I call in
>>and where
>>the problem is happening.
>>Any feedback?
>
>
> okay,
> well, if you're going to use macros
> and dispense with line numbers
> then you're going to have to get good at debugging your SAS statements
> yourself, since your line numbers are lost and gone forever.
>
> I would review the data structure.
> I would review the data structure.
> I would review the data structure.
>
> the above repetition is no accident.
> first you have to be sure that you have enough variable to fill the
> array
> second, since you are looping thru two arrays
> you have to be sure you have enough variables to fill -both- arrays
>
> next: array dimension:
> I do not have much experience with multi-dimension arrays,
> but I'll guess that I'm correct in saying that
> the dimension is the product of the two upper-bounds
> assuming that the lower bound is one.
>
> you may wish to do the multiplication with your macro variables
> to check your assumptions.
>
> testing:
> there are various ways of setting obs=1:
>
> options obs=1
> or
> set Lib.Data(obs=1)
>
> I see you have a good set of tracing statements for your indexes
> here's how to flip them on and off:
>
> %Let Testing = 0;
> %Let Testing = 1;
> if &Testing then put i= j=;
>
> uh, the problem is not your data
> it's your loop upper-bound(s)
> so this obfuscates:
> put _all_ ;
>
> Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
>
> Repetition obfuscates!
> Repetition reduction enhances elegance!
> Repetition reduction furthers finesse!
|