Hi Experts,
I have created a table where previous account status was 133 reference code. I want to find the looping accounts in 133 reference code to know if I am dealing with same account numbers every month. Can you please the correct way to find out? I am stuck with my code as I don't know what should I add in to see if the same accounts are coming back in 133 reference code?
/* accounts moved out from 133 in 2022 */
Proc sql;
create table accounts_moved_out_of_133 as
select accountnumber,
AccountStatus,
PreviousAccountStatus,
EnteredAccountStatusDate as entered_in_current_ref_code
from dwhdw.dim_account
where PreviousAccountStatus like '133' ;
quit;
/* Have they ever been in 133 more than once */
proc sql;
create table looping_in_133 as