BookmarkSubscribeRSS Feed
TejaSurapaneni
Lapis Lazuli | Level 10

Hi,

 

I got struck, help me on this.

 

I have a table Empldata (EMP_ID is in character format and Interest is in Numeric Format)

 

EMP_ID    Interest

101             .2

202             .4

303             .7

404             .1

 

 

I have Another Table EMPL_Hierarachy (all columns  are in Character format)

L1_ID(Empl ID)        L2_ID (Reporting Manager ID)             L3_ID (Senior Manager ID)         L4_ID (Head of All Empls)

101                                            202                                                       303                                             404

 

 

I need I output table like below

 

EMP_ID    Interest   L1_ID        L2_ID             L3_ID         L4_ID

101             .2           101             202                 303             404

202             .4                              202                 303             404

303             .7                                                     303             404

404             .1                                                                        404

 

 

OR

 

EMP_ID    Interest   L1_ID        L2_ID             L3_ID         L4_ID

101             .2           101             202                 303             404

202             .4                              202                 

303             .7                                                     303             

404             .1                                                                        404

 

 

 

Please can some body help me on this.

 

 

Thanks in Adavance

 

 

Teja  

1 REPLY 1
Astounding
PROC Star

Assuming it's OK to give you exactly what you asked for ...

 

 

data want;

if _n_=1 then set EMPL_Hierarchy;

array L_ {4} L1_ID L2_ID L3_ID L4_ID;

set EmplData;

if _n_ > 1 then L_{_n_-1} = ' ';

run;

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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