From: xlr82sas on 7 Feb 2010 04:40 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 7 Feb 2010 08:55 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
|
Pages: 1 Prev: Gap statistic for clusters Next: How to get SE bars in plot using mean values |