From: Mindy on
Hey, guys,

I saw a code to get lab test number automatically. Anyone know countw
function? Is SAS's new release?

%let lablist = ca ca_cr;
....
%let lbnum=%sysfunc (countw (&lablist ) );

data temp;

%do i=1 %to &lbnum;
if lbtestcd = ...
%end;
run;
..
Thanks,
Mindy
From: Paige Miller on
On May 7, 1:06 pm, Mindy <master2005_...(a)yahoo.com> wrote:
> Hey, guys,
>
> I saw a code to get lab test number automatically. Anyone know countw
> function? Is SAS's new release?
>
> %let lablist = ca ca_cr;
> ...
> %let lbnum=%sysfunc (countw (&lablist ) );
>
> data temp;
>
>    %do i=1 %to &lbnum;
>    if lbtestcd = ...
>   %end;
> run;
>  ..
> Thanks,
> Mindy

Countw works in SAS 9.1 and higher, I believe.

Also, read http://support.sas.com/kb/26/152.html

--
Paige Miller
paige\dot\miller \at\ kodak\dot\com