proc sql;
create table Accounts_left_Trace AS
Select
account_code
From work.acc_left_trace; (acc_left_trace is the file that I mported in SAS)
quit;
proc sql;
create table Add_repcode AS
Select a.*,
b.rep_code
From work.acc_left_trace as A
inner join p2scflow.debt as b on a.debt_code = b.debt_code;
quit;
The underlined highlighted text assigns an alias of A to the data set Acc_left so you can use that in the A.debt_code or A.*.
You did that for the alias B, so I am very confused why not noticing it was not done for A.