Date: Thu, 17 Mar 2005 11:01:34 -0800
Reply-To: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject: Re: Fill up pattern
Graeme -
Don't know if you saw this post. I believe this creates your counter
correctly.
data wafers;
do y = -63 to 62 by 1;
do x = -63 to 62 by 1;
waferno=6;
output;
end;end;
do y = -64 to 62 by 1;
do x = -62 to 62 by 1;
waferno=8;
output;
end;end;
run;
data wafers;
set wafers;
if y=0 then signy=1;
else signy=sign(y);
if x=0 then signx=1;
else signx=sign(x);
y=signy*y;
x=signx*x;
run;
proc sort;
by waferno signy signx y x;
data wafers(DROP=signy signx counterx);
retain counter waferno x y;
set wafers;
by waferno signy signx;
if (y=0 and x=0)
or (y=0 and x=1 and signx=-1)
or counterx=17 then counterx=0;
counterx+1;
y=signy*y;
x=signx*x;
if signy=-1 or (y=0 and signx=-1)
then counter=18-counterx;
else counter=counterx;
run;
proc sort;
by waferno y x;
RUN;
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Graeme
Kirton
Sent: Thursday, March 17, 2005 3:05 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Fill up pattern
Hi folks, not posted for a while. Need some help.
Need a counter to fill down and fill up from co-ordinate 0,0.
I.e create new variable based on counter.
my counter is;
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
my REAL data, x ranges from -63>62 and y from -63>62 for wafer6 and x ranges
from -64>62 and y from -62>62 for wafer8.
DataSet to look something like (just need to add counter variable);
counter,waferno,x,y
<snip>
14,6,-4,0
15,6,-3,0
16,6,-2,0
17,6,-1,0
1,6,0,0
2,6,1,0
3,6,2,0
4,6,3,0
5,6,4,0
<snip>
14,8,-4,0
15,8,-3,0
16,8,-2,0
17,8,-1,0
1,8,0,0
2,8,1,0
3,8,2,0
4,8,3,0
5,8,4,0
Many Thanks to ALL
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger
|