Date: Fri, 16 Dec 2005 23:50:54 GMT
Reply-To: Roger Lustig <trovato@VERIZON.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roger Lustig <trovato@VERIZON.NET>
Subject: Re: Number of times where the condition is met?
Content-Type: text/plain; charset=us-ascii; format=flowed
Try a loop and an array.
data new (drop=i);
***This sets up an array with default names as you have them;
array age (12);
***See docs for what to do when the names are not as nice;
do I=1 to 12; *** Look up the DIM function too!;
if age(I) < 4 then n_chlt5 + 1;
By the way, given the name of your new variable, don't you want
Elmaache, Hamani wrote:
> Hi there.
> Please can someone help?
> I want to count the number of times where the following condition is met:
> data two;
> set one;
> if age1<4 or age2<4 age3<4 or age4<4
> age5<4 or age6<4 age7<4 or age8<4
> age9<4 or age10<4 age11<4 or age12<4
> then n_chlt5 ????;
> I want to how many people ( among these 12 people)
> are aged less than 4 years.
> Thanks a lot and nice week-end.