LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 24 Jan 2008 14:27:50 +0000
Reply-To:   toby dunn <tobydunn@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   toby dunn <tobydunn@HOTMAIL.COM>
Subject:   Re: Array Problem
Comments:   To: John Mackin <john.mackin@fcso.com>
In-Reply-To:   <200801241411.m0OBmd6h001577@malibu.cc.uga.edu>
Content-Type:   text/plain; charset="Windows-1252"

John ,

I have no clue what the valuesa are for variable "dtl_cnt" so not sure if that will cause you more problems later on.

The error are coming from the fact that you are calling the array

a_inj1 (i, j)

Which is a call to a two demensional array, you have defined the array A_Inj1 as a one demensional array.

Explain what you were hoping to accomplish by this line of code: if a_inj1 (i, j)> 0 then do;

And we can help you rewrite you do loop to accomplish it.

Toby Dunn

"Don't bail. The best gold is at the bottom of barrels of crap." Randy Pausch

"Be prepared. Luck is where preparation meets opportunity." Randy Pausch

> Date: Thu, 24 Jan 2008 09:11:46 -0500 > From: john.mackin@FCSO.COM > Subject: Array Problem > To: SAS-L@LISTSERV.UGA.EDU > > Below is code I inherited from a previous programmer. I haven’t used > arrays much in my previous position. > > The message I am receiving is “Too many array subscripts specified for > array (array name)”. > > I have tried the brackets with {*} and then just for the number of > variables {12} but continue to get the same error. > > I am certainly appreciative of any responses to my dilemma. > > THANK YOU! > > array a_inj1 {12} A_AUJ1_1 - A_AUJ1_12; > array a_pos1 {12} $ A_SOP1_1 - A_SOP1_12; > array a_inj2 {12} A_AUJ2_1 - A_AUJ2_12; > array a_pos2 {12} $ A_SOP2_1 - A_SOP2_12; > array a_inj3 {12} A_AUJ3_1 - A_AUJ3_12; > array a_pos3 {12} $ A_SOP3_1 - A_SOP3_12; > > array n_anum {*} ATL_AUDIT1- ATL_AUDIT13 ; > array n_aind {*} $ ATL_AUDIT_IND1-ATL_AUDIT_IND13 ; > > > do i=1 to dtl_cnt; > do j=1 to 12; > if a_inj1 (i, j)> 0 then do; > Too many array subscripts specified for array a_inj1 > INJTS_NUM = i; > SEQUENCE = j; > INJTS_AUDIT_TYPE = 'DTL' ; > AUDIT = put (a_inj1 (i, j), 3.0) || a_pos1 (i, j); > Too many array subscripts specified for array a_inj1 > Too many array subscripts specified for array a_pos1 > put COBN $ @; put INJTS_NUM @; put SEQUENCE @; > put INJTS_AUDIT_TYPE $ @; > put AUDIT $ @ ; put XREF_COBN1 $ @; put PAID_DATE @; > put CREATEDON @; > put UPDATEDON @ ; put ADJUSTED $ @; put HIC $; > end; > > (same errors for a_inj2 and a_inj3) > > > do j=1 to 12; > if a_inj2 (i, j)> 0 then do; > INJTS_NUM = i; > SEQUENCE = j; > INJTS_AUDIT_TYPE = 'DTL' ; > AUDIT = put (a_inj2 (i, j), 3.0) || a_pos2 (i, j); > put COBN $ @; put INJTS_NUM @; put SEQUENCE @; > put INJTS_AUDIT_TYPE $ @; > put AUDIT $ @ ; put XREF_COBN1 $ @; put PAID_DATE @; > put CREATEDON @; > put UPDATEDON @ ; put ADJUSTED $ @; put HIC $; > end; > do j=1 to 12; > if a_inj3 (i, j)> 0 then do; > INJTS_NUM = i; > SEQUENCE = j; > INJTS_AUDIT_TYPE = 'DTL' ; > AUDIT = put a_inj3 (i, j), 3.0) || a_pos3 (i, j); > put COBN $ @; put INJTS_NUM @; put SEQUENCE @; > put INJTS_AUDIT_TYPE $ @; > put AUDIT $ @ ; put XREF_COBN1 $ @; put PAID_DATE @; > put CREATEDON @; > put UPDATEDON @ ; put ADJUSTED $ @; put HIC $; > end; > end;_anum (i)> 0 then > do; if > n_anum (i)> 0 then do; > INJTS_NUM = i; > SEQUENCE = 1; > INJTS_AUDIT_TYPE = 'NON' ; * noncov-audit 07/31/02 meeting; > AUDIT = put (n_anum (i), 3.0) || n_aind (i); > put COBN $ @; put INJTS_NUM @; put SEQUENCE @; > put INJTS_AUDIT_TYPE $ @; > put AUDIT $ @ ; put XREF_COBN1 $ @; put PAID_DATE @; > put CREATEDON @; > put UPDATEDON @ ; put ADJUSTED $ @; put HIC $; > end; > end; > > run;

_________________________________________________________________ Connect and share in new ways with Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008


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