Date: Mon, 18 Jan 2010 05:26:25 -0800
Reply-To: Emil <remilah@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Emil <remilah@GMAIL.COM>
Organization: http://groups.google.com
Subject: problem with automatic categorization of variables
Content-Type: text/plain; charset=ISO-8859-1
hi I need to categorize variable (let it be 'b'). I wrote this code
and i don't know what is wrong :(
data z1;
input p $ d t $ ;
cards;
3 1 a1
3 5 a3
3 7 a8
3 9 a5
3 6 g2
3 . t1
. 0 .
. . .
1 4 g2
2 1 f1
2 4 1
run;
-----------------------------------------------
and my macro
----------------------------------------------
I would have 1 category (variable 'b') every 2 units (variable 'd')
=======================================
%macro pod( n=, l=);
data new;
set z1;
%do i=1 %to &n %by 2;
%do j=&i+2 %to &n;
%do k=1 %to &l;
if &i < d < &j then b=&k;
%end;
%end;
%end;
run;
%MEND pod;
|