Hi All, I have the below data set. My objective to let the Name be the last variables in every row without changing the last variables. the new data set should have James as value of L6 in row 1, Lemar as value for L8 in row 2 and Thomas as value for L7 in row 3 as the arrows indicate. The data step which creates this is in step 1 below. The code I have written is titled step 2. The error message I get follows after the codes. step 1: data Ranking;
INFILE DATALINES DLM=',' missover;
length CustID Name $10 L1 $20 L2 $20 L3 $20 L4 $20 L5 $20 L6 $20 L7 $20 L8 $20;
input CustID Name $ L1 $ L2 $ L3 $ L4 $ L5 $ L6 $ L7 $ L8 $;
cards;
1,James,CEO,Department Head,Senior Manager,Manager, Senior Analyst, , ,
2,Lemar,Major,Vice President, CEO, Department Head, Senior Manager,Manager,Senior Analyst,
3,Thomas,Technical Chief, CEO, Department Head, Senior Manager, Manager, Senior Analyst,
; Step 2: data new;
set ranking;
array L{8} $;
do i=8 to 1 by -1;
if missing(L{i} ) then do;
L{i+1} = Name;
call missing(L{i});
leave;
end;
end;
run; error message:
... View more