BookmarkSubscribeRSS Feed
AxS
Calcite | Level 5 AxS
Calcite | Level 5
I ahve a dataset consisting of 9000+ staff members for which I have their staff ID and their manager's staff ID. I want to be able to generate the "depth" down the staff tree for these users (eg there are four upward hops from me to the Group Chairman so I have a depth of four). In addition I want to associate each staff member with their uber-manager (ie with a depth of one).

Both problems seem to call for some sort of tre-walk macro but it's outwith my experience to write one and nothin on the SAS website seems to address the issue. Closest I've seen is SUGI paper 87-28 but that's walking down an existing structure rather than up a virtual one.

Anyone seen anything like this before?

AxS
1 REPLY 1
deleted_user
Not applicable
sounds like a good casebook example for the data step hash object.
There will be some excellent examples among the SAS Samples : Go to http://support.sas.com/ and navigate (left hand side) in "Knowledge Base" to "Samples & SAS Notes"

Good Luck

PeterC

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 903 views
  • 0 likes
  • 2 in conversation