LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 19 Oct 2005 11:23:46 -0700
Reply-To:     David L Cassell <davidlcassell@MSN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         David L Cassell <davidlcassell@MSN.COM>
Subject:      Re: 3-D array error
In-Reply-To:  <200510191522.j9JEn0Mc018352@malibu.cc.uga.edu>
Content-Type: text/plain; format=flowed

shuklak@HOTMAIL.COM wrote: >I have 'inherited' SAS code for a fairly complicated 3-D array with a >bunch of temporary arrays, which processes data by 4 'groups'. When I run >this code, I get an array subscript error on the even numbered groups, >while the code runs perfectly for the odd groups. > >Array subscript out of range at line 27237 column 16. > >I am unable to debug this code, and figure out what is going wrong. Given >the lengthy code, it would be impossible for me to share the code. > >I read some earlier postings about bug in the data step within SAS, and am >wondering if there is any detailed explanation of this bug, and a fix for >it, if any.

[1] "Inherited" code is not always "functional" code. Is it even generating the correct answers all the time?

[2] Isn't there appropriate documentation for this pile of.. umm.. dreck?

[3] If you're getting errors at "line 27237 column 16" then either there is *way* too much code to drop on us [good call, by the way!] or there is some major use of macro programming that may make things harder to debug. Line 27,237 ? Ick! If the issue is the use of macros, then you may need to use some system options like MPRINT and MLOGIC (which will also enlarge the log file a lot: make sure this is going to a file rather than a log window) to find out where the problem is actually happening.

[4] Does this happen on test cases? Does this happen on old data, like whatever the original programmer used for testing and evaluation? If so, then take this to your boss at *once* and point out that this NEVER worked properly and has always errored out, and needs to be re-done from scratch. If it works on smaller cases, then the problem may be that the programmer hard-coded the array bounds and never anticipated the size of the proplem you are using. In this case, check the array bounds in the code.

[5] If this works properly (not just passing with no errors) on the even groups, then the problem may be the way in which the code *steps* from the lower bound of a do-loop to the upper bound. That's just a wild guess on my part, but I have seen code which does things like

do i = 1 to 100 by 9;

but then checks some array value like MyArray{i+6} in the code. Only the last legal value of here (i=99) would be looking at a place well off the array, and throwing the error message you saw. Perhaps the error is in code like this. Or not. But it is something to consider.

HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330

_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Back to: Top of message | Previous page | Main SAS-L page