

| Features: |
CASE expression joined-table component Cross join SELECT clause : DISTINCT keyword |
| Table names: | PROCLIB.MARCH FLIGHTS |
libname proclib 'SAS-library';
proc sql;
create table flights as
select distinct dest
from proclib.march;
title 'Cities Serviced by the Airline';
select * from flights;
proc sql;
title 'All Possible Connections';
select f1.Dest, case
when f1.dest ne ' ' then 'to and from'
end,
f2.Dest
from flights as f1, flights as f2
where f1.dest < f2.dest
order by f1.dest;
/* */
proc sql;
title 'All Possible Connections';
select f1.Dest, case
when f1.dest ne ' ' then 'to and from'
end,
f2.Dest
from flights as f1 cross join flights as f2
where f1.dest < f2.dest
order by f1.dest;