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 (March 2000, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 8 Mar 2000 14:26:42 +0100
Reply-To:     detecsm_hellriegelg@WESTLB.DE
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gehard Hellriegel <detecsm_hellriegelg@WESTLB.DE>
Subject:      Re: Q array prob: numer of vars > 10
Content-type: text/plain; charset=us-ascii

I've not exactly analyzed it, but one problem may be, that f3 is a subset of f2. That means, you manipulate the same variables with var31-var37 under different names with different indices! f2(11) is the same variable as f3(1), f2(12)=f3(2), ..... Is that really, what you wanted?

"Christian F.G. Schendera" <schendera@NIKOCITY.DE> on 07.03.2000 18:50:54

Bitte antworten an "Christian F.G. Schendera" <schendera@NIKOCITY.DE>

An: SAS-L@LISTSERV.UGA.EDU Kopie: (Blindkopie: DeTeCSM HellriegelG/D/ExternalStaff/WLB) Thema: Q array prob: numer of vars > 10

I have an array prob. Code runs fine for arrays with vars < 10 (see vars FRAGE1 and FRAGE3). At FRAGE2 the array misses category 10 and instead runs on into the vars of FRAGE3 (see output below). How could I stop SAS from doing this? Best, Chris

data TEST2 (keep = FBNr frage1 frage2 frage3 ) ; set TEST ; array newvars(*) FRAGE1 FRAGE2 FRAGE3 ; array f1(*) var11-var14 ; array f2(*) var21-var210 ; array f3(*) var31-var37 ;

do i = 1 to dim(newvars) ; newvars(i) = . ; end ; * set all to missing ; do i = 1 to dim(f1) ; if f1(i) = 1 then do ; FRAGE1 = i ; output ; end ; end ;

do i = 1 to dim(newvars) ; newvars(i) = . ; end ; * set all to missing ; do i = 1 to dim(f2) ; if f2(i) = 1 then do ; FRAGE2 = i ; output ; end ; end ;

do i = 1 to dim(newvars) ; newvars(i) = . ; end ; * set all to missing ; do i = 1 to dim(f3) ; if f3(i) = 1 then do ; FRAGE3 = i ; output ; end ; end ; run ;

Cumulative Cumulative FRAGE2 Frequency Percent Frequency Percent ???????????????????????????????????????????????????? 1 49 5.2 49 5.2 2 57 6.0 106 11.2 3 47 5.0 153 16.2 4 18 1.9 171 18.1 5 25 2.6 196 20.7 6 18 1.9 214 22.6 7 1 0.1 215 22.7 8 2 0.2 217 22.9 9 27 2.9 244 25.8 data of FRAGE3! -> 11 58 6.1 302 31.9 data of FRAGE3!-> 12 37 3.9 339 35.8 data of FRAGE3!-> 13 34 3.6 373 39.4 data of FRAGE3!-> 14 28 3.0 401 42.4

FRAGE3 Frequency Percent Frequency Percent ???????????????????????????????????????????????????? 1 58 33.7 58 33.7 2 37 21.5 95 55.2 3 34 19.8 129 75.0 4 28 16.3 157 91.3 5 1 0.6 158 91.9 6 12 7.0 170 98.8

Mit freundlichen Gruessen

DeTeCSM, Gerhard Hellriegel

WestLB Abteilung: 001-80622 Aderstr. 22 D - 40217 Duesseldorf Tel.: +49211 826 6173 Fax: +49211 826 5393


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