As a variation of "Producing Rows from the First Query or the Second Query" below code should do:
proc sql; create table want as
select * from Company where Deptid not in (select Deptid from Dept) outer union corr select * from Dept where Deptid not in (select Deptid from Company) ; quit;
SAS Innovate 2025: Save the Date
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!