I would like to know if it is possible to execute multiple assignments as a consequence of a single CASE. That is, instead of having two CASE statements, have a single CASE statement with a 'then-do-end' like structure.
For example, how would I assign values to
input x $;
create table make_two_from_one as
when x = 'A' then 'Result1A'
when x = 'B' then 'Result1B'
end as thing1
when x = 'A' then 'Result2A'
when x = 'B' then 'Result2B'
end as thing2
Case statement constructs one variable.
For your example you can try this, with one statement of Case :
data example; input x $; datalines; A A A B B ; run; proc sql; create table make_two_from_one_2 as select * , case when x = 'A' then 'Result1A,Result2A' when x = 'B' then 'Result1B,Result2B' else 'Error' end as thing0 from example ; quit; data example1(drop=thing0); set make_two_from_one_2; thing1=scan(thing0,1,','); thing2=scan(thing0,2,','); run;