Hello @Ksharp
Thanks for taking the time to give me a solution. However, if the Username's ID and the Username's name have identical values it throws an error. I have updated the dummy data to re-create the error shown below
data have;
infile cards truncover ;
input have $100.;
cards;
Johnsmith's profile picture
Johnsmith
·
Johnsmith
BW_photo's profile picture
BW_photo
Ansel Adams
IG.user's profile picture
IG.user
IG.user
;
run;
data temp;
set have;
length temp name $ 100;
retain temp;
if findw(have,'profile') and findw(have,'picture') then do;
id+1;n=1;temp=scan(have,1,"'");name='header';
end;
else if have=:temp then do;n=2;name='ID_ig';end;
else if strip(have)='·' or missing(have) then do;n=3;name='Follower';end;
else do;n=4;name='Username';end;
drop temp;
run;
proc transpose data=temp out=want(drop=_:);
by id;
id name;
var have;
run;
... View more