Data:
Employee Name, Manager Name
Rajiv Bajaj, Panu Thai
Panu Thai, Bob Silvers
Yi Chen, Bob Silvers
Ethan Ocampo, Bob Silvers
Bob Silvers, Dan Shak
Leo Bel, James Mane
Mamie Qwong, James Mane
James Mane, Dan Shak
Dan Shak, George Castillo
I want to get all the individuals that roll up to each manager and get an output like this:
Manager, Subordinate
George Castillo, Dan Shak
George Castillo, Bob Silvers
George Castillo, James Mane
George Castillo, Panu Thai
George Castillo, Yi Chen
George Castillo, Rajiv Bajaj
George Castillo, Ethan Ocampo
George Castillo, Leo Bel
George Castillo, Mamie Qwong
Dan Shak, Bob Silvers
Dan Shak, James Mane
Dan Shak, Panu Thai
Dan Shak, Yi Chen
Dan Shak, Rajiv Bajaj
Dan Shak, Ethan Ocampo
Dan Shak, Leo Bel
Dan Shak, Mamie Qwong
James Mane, Leo Bel
James Mane, Mamie Qwong
Bob Silvers, Rajiv Bajaj
Bob Silvers, Panu Thai
Bob Silvers, Yi Chen
Bob Silvers, Ethan Ocampo
Panu Thai, Rajiv Bajaj
Can I get SAS code to write in this fake data as a dataset and then use recursion to get all the employees who roll up to each manager.
data employees;
input Employee $ Manager $;
datalines;
...
;
run;
Reading in the data
Not sure how to move forward…
CoderSavage is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.