If you are able to in the future, do you mind formatting the code? It would certainly help debugging. I went ahead and did it just to see.
DATA CYCLE15_ALLOCATION_&PREVMNTH._&MNTH.2 (
WHERE=(ALLOCATION_DATE NE .)
KEEP=ACCOUNT_NO BILLING_CYCLE_DAY ALLOCATION_DATE TAGGING OPENING_DPD
);
SET MASTER_DPD_DUELIST_&PREVMNTH._&MNTH. (
WHERE=(BKT NOT IN ('WOFF','NPA','NPA_A'))
KEEP= ACCOUNT_NO BILLING_CYCLE_DAY BKT dpd_01SEP24 -- DPD_18SEP24
);
FORMAT ALLOCATION_DATE DATE7. TAGGING $CHAR25.;
ARRAY Q[*] _NUMERIC_;
IF 61 IN Q AND 31 NOT IN Q AND 1 NOT IN Q AND BILLING_CYCLE_DAY = 15 THEN DO;
ALLOCATION_DATE = INPUT(SUBSTR(VNAME(Q[WHICHN(61,OF Q[*])]),5),DATE7.);
OPENING_DPD = 61;
TAGGING = 'BUCKET 2 NON NPA';
END;
IF ((61 IN Q AND 32 IN Q) OR (31 IN Q)) AND 1 NOT IN Q AND BILLING_CYCLE_DAY = 15 THEN DO;
ALLOCATION_DATE = INPUT(SUBSTR(VNAME(Q[WHICHN(31,OF Q[*])]),5),DATE7.);
OPENING_DPD = 31;
TAGGING = 'BUCKET 1 NON NPA';
END;
IF 1 IN Q AND 61 NOT IN Q AND 31 NOT IN Q AND BILLING_CYCLE_DAY = 15 THEN DO;
ALLOCATION_DATE = INPUT(SUBSTR(VNAME(Q[WHICHN(1,OF Q[*])]),5),DATE7.);
OPENING_DPD = 1;
TAGGING = 'BUCKET X NON NPA';
END;
RUN;
... View more