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 (February 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 3 Feb 2004 20:57:33 -0500
Reply-To:     Don Stanley <don_stanley@PARADISE.NET.NZ>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Don Stanley <don_stanley@PARADISE.NET.NZ>
Subject:      Re: Conundrum using Set Point=

And also if you put the assignment inside a loop ...

do i=1 to 1 ; P = rowmap[id]; end ; put P=;

No problems ...

Don

On Tue, 3 Feb 2004 16:36:51 -0800, Choate, Paul@DDS <pchoate@DDS.CA.GOV> wrote:

>Richard - Note that if you operate on the id variable the problem >disappears: > >(V8.02 PC and MVS) > >either >P = rowmap[id+0]; >or >id=id; >P = rowmap[id]; > >and the problem stops. The variable id is unstable for some reason. Sounds >like a question for Paul Dorfman. > > >Paul Choate >DDS Data Extraction >(916) 654-2160 > >-----Original Message----- >From: Richard A. DeVenezia [mailto:radevenz@IX.NETCOM.COM] >Sent: Tuesday, February 03, 2004 3:14 PM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Conundrum using Set Point= > >I've a very strange situation happening in the following program. The third >assignment to the point= variable is not 'sticking' and is thus causing a >terrific headache. >---------- >data ids; >input id; >rownum+1; >cards; > 5 > 10 > 6 > 1 > 2 > 7 > 1 > 3 > 7 > 11 > 8 > 5 > 10 > 4 > 4 > 8 > 11 > 2 > 3 > 9 > 9 > 6 >run; > >data weird; > array rowmap [11] _temporary_; > do while (not eoids); > set ids end=eoids; > if mod(rownum,2)=1 then > rowmap [id] = rownum; > end; > > P = 1; > put P=; > > set ids point=P; > rowmap [ id ] = -rowmap [ id ]; > put rownum= id= rowmap[id]=; > > P + 1; > put P=; > > set ids point=P; > put rownum= id= rowmap[id]=; > > P = rowmap[id]; > put P=; > > set ids point=P; > put rownum= id= rowmap[id]=; > > stop; >run; >---------- >LOG >---------- >P=1 >rownum=1 id=5 rowmap[5]=-1 >P=2 >rownum=2 id=10 rowmap[10]=13 >P=-1 >rownum=2 id=10 rowmap[10]=13 >eoids=1 id=10 rownum=2 P=-1 _ERROR_=1 _N_=1 > >----- >Focus on the 4th and 5th lines of the log: > rownum=2 id=10 rowmap[10]=13 > P=-1 >Generated by code > put rownum= id= rowmap[id]=; > P = rowmap[id]; > put P=; > >rowmap[10] is 13, and is assigned to P, which when put shows -1 ! ( -1 is >value of rowmap[5] ! ) > > >Any clues to what is going on ? > >-- >Richard A. DeVenezia


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