I would like to have PAUL (played multiple teams) target or any player target that have played for multiple teams to be put in the last team he played for to avoid duplicate target.
Anyone can help? Thanks.
DATA TEST; infile DATALINES DLM=',' DSD; INPUT SEASON PLAYER $ DIV $ TEAM $ TARGET; DATALINES; 202101, JOHN,003,001,10 202102, JOHN,003,001,15 202103, JOHN,003,001,16 202101, PAUL,003,002,20 202101, PAUL,003,003,20 202101, PAUL,003,004,20 202102, PAUL,003,002,25 202102, PAUL,003,003,25 202102, PAUL,003,004,25 202103, PAUL,003,002,35 202103, PAUL,003,003,35 202103, PAUL,003,004,35 202101, KENT,,005,42 202102, KENT,,005,45 202103, KENT,,005,46 ; RUN;
My desired output will be:
Season Player Div Team Target
202101 JOHN 003 001 10 202102 JOHN 003 001 15 202103 JOHN 003 001 16 202101 PAUL 003 002 0 202101 PAUL 003 003 0 202101 PAUL 003 004 20 202102 PAUL 003 002 0 202102 PAUL 003 003 0 202102 PAUL 003 004 25 202103 PAUL 003 002 0 202103 PAUL 003 003 0 202103 PAUL 003 004 35 202101 KENT 005 42 202102 KENT 005 45 202103 KENT 005 46
... View more