Good afternoon. I have the next 24 lentgh string like this: hist_payment='012212201223456789999999' Where every character represents the past due number for every single month, so the first number represents the most recent month and their past due number asociated to the number. I have to define if a customer has been cured, and a cured customer is the one who has only 0, 1 or 2 in the first 12 characters (months) of the hist_payment string. This is my work so far: if input(first(compress('9876543210',substr(HIST_PAYMENT,1,12),'k')),15.) <3 then flag_cure=1;
else flag_cure=0; But is not working at all. What I exactly need is to obeserve if the first 12 substring contains ONLY 0, 1 or 2, if this true then I can create the flag_cured as 1, otherwise the flag_cured is zero. Please help, I've beeing trying to solve this problem for a long time.
... View more