BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
EEEY
Obsidian | Level 7

My post got messy up. I repost it.

 

hI Patrick,

I am sure you are the expert of hash object. Actually my dataset Have2 is even more complicated than I think.
So my datasets are:

data have1;
input empid;
cards;1111
2222
3333
2124
9999;

data have2;
  input mgrid_1 mgrid_2 mgrid_3 mgrid_4 mgrid_5;
cards;
101 1111 1212 2124 14322
201 2211 2222 3434 5656
301 3322 2124 5434 3333
401 3355 1199 55 77
234 2222 2323 2121 55;

I have added the last row into the dataset have2 to show the complexity of my dataset. 🙂
When this look-up process executes, note that value 2222 appeares at two spots in the dataset have2.
One in column mgrid_2  and the other one in column mgrid_3.The result I want to see would be like:

emplid mgrid col
1111   101   1
2222   2211  2
2222   234   1
3333   5434  4
2124   3322  2

The Column col I would like to add into the want dataset is the level of the manager from Have2 dataset.Hope you could help me out again.

Thanks a lot.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 15 replies
  • 3459 views
  • 2 likes
  • 5 in conversation