Employee Manager
sam Niro
kevin Daniel
george Peter
niro Leo
daniel David
peter Leo
david Leo
another data set
EMPLOYEE
sam
kevin
george
niro
daniel
peter
david
leo
i want the output the output data set to be
employee Manager
sam Niro
kevin Daniel
George Peter
niro Leo
daniel David
peter Leo
david Leo
leo
please assist with the above..
How about this?;
data one;
input Employee $ Manager $;
datalines;
sam Niro
kevin Daniel
george Peter
niro Leo
daniel David
peter Leo
david Leo
;
data two;
input EMPLOYEE $;
datalines;
sam
kevin
george
niro
daniel
peter
david
leo
;
proc sort data = one;by employee;
proc sort data = two;by employee;
data want;
merge one two;
by employee;
run;
Good luck,
Anca.
*alternatively;
proc sql;
create table want as
select a.manager,b.employee
from one as a full join two as b
on a.employee = b.employee;
quit;
This is really nice , thank you .. Anca
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.