From: xlr82sas on
Hi SAS-Lers,

proc sql;
select
name
,case (age)
when (15,16) then '1516'
else 'XXXX'
end as err
from
sashelp.class
;quit;

The code above results in an error

proc sql;
select
name
,case
when (age in (15,16)) then 'XX15'
else 'XXXX'
end as err
from
sashelp.class
;quit;

Here is a work around

data grp;
set sashelp.class;
select (age);
when (15,16) err='1516';
otherwise err='XXXX';
end;
run;

Works in the datastep
From: gupt on
On Feb 7, 2:40 pm, xlr82sas <xlr82...(a)aol.com> wrote:
> Hi SAS-Lers,
>
> proc sql;
>  select
>    name
>   ,case (age)
>      when (15,16) then '1516'
>      else 'XXXX'
>    end as err
>  from
>    sashelp.class
> ;quit;
>
> The code above results in an error
>
> proc sql;
>  select
>    name
>   ,case
>      when (age in (15,16)) then 'XX15'
>      else 'XXXX'
>    end as err
>  from
>    sashelp.class
> ;quit;
>
> Here is a work around
>
> data grp;
>   set sashelp.class;
>   select (age);
>     when (15,16) err='1516';
>     otherwise err='XXXX';
>   end;
> run;
>
> Works in the datastep

proc sql;
select name ,case (age)
when ( 15) then 'XX15'
when ( 16) then 'XX16'
else 'XXXX'
end as err
from
sashelp.class
;quit;
This is working you can use this