| Date: | Mon, 17 Nov 2008 15:02:51 -0500 |
| Reply-To: | Hari Nath <hari_s_nath@YAHOO.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Hari Nath <hari_s_nath@YAHOO.COM> |
| Subject: | Re: Any easier way to count these. |
|---|
Thanks Dale and Akshaya for the array solution. Since i have several
variables, array seems to be more efficient than just using sas functions.
On Mon, 17 Nov 2008 11:08:55 -0800, Akshaya <akshaya.nathilvar@GMAIL.COM>
wrote:
>There's a Lost card, so include missover option, to make all record
>read.
>
>Data have;
> infile cards missover;
> input (a1-a3) ($);
> cnt=0;
> array abc a1-a3;
> do over abc;
> if indexw(abc,'bnd') then cnt+1;
> if indexw(abc,'bnid') then cnt+1;
> end;
>cards ;
>bnd bnid bnsr
>bnd bnd bnd
>bnid bnd
>;
>
>Thanks!
>Akshaya
|