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:   Fri, 25 Jan 2008 09:55:54 -0500
Reply-To:   Mike Rhoads <RHOADSM1@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Mike Rhoads <RHOADSM1@WESTAT.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="utf-8"

Each of your arrays is defined as having only one dimension.

Therefore, you can only use one subscript when later referring to them.

Mike Rhoads Westat RhoadsM1@Westat.com

-----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of John Mackin Sent: Thursday, January 24, 2008 9:12 AM To: SAS-L@LISTSERV.UGA.EDU Cc: John Mackin Subject: Array Problem

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;


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