BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MG18
Lapis Lazuli | Level 10

HI All,


We have one requirement with following details :-

 

Bank requires to develop a custom scenario such that Customers who have monthly transactions on their accounts that exceeds 50000 JOD , with minimum transaction 5 transactions and transaction amount 10000 JOD per single transaction should generate an alert.

 

Customers who have monthly transactions on their accounts that exceeds 50000 JOD , with minimum transaction 5 transactions and transaction amount 10000 JOD per single transaction should generate an alert.

Frequency:

Monthly

Proposed Scenario Parameters:

Account_types(p10236_account_type_desc) - should specify all the account types to be monitored

Total_credit_amount (p10236_trans_total) – Total amount of credit transaction

Minimum_credit_transaction_count (p10236_day_count) – Minimum number of credit transactions

Minimum_transaction_amount (p10236_day_count) – Minimum transaction amount

Num_business_days (p10236_num_days) - Number of business days to be considered

Status_description (p10236_status_desc) -Specifies whether transaction status SUCCESS or not

Currency account indicator (&p10236_currency_acct) --- It will be N

Credit or debit indicator (p10236_cdi_indicator) : - Credit (C) and debit (D)

 

I have created the source file also with help of other sceanrio active code as below :-

%let this_macro_name = &sysmacroname;

/* save this macro name */
/*----------------------------------------------------------------------------*/
retain p10236_begin_date;
format p10236_day_list $512.;

/* This init section should be placed before any goto statements. This section of
code will only be run when processing the first BY group of the prep data set.
Any goto statements placed before it may prevent the init code from being run. */
if run_scenario_init eq 1 then
do;
p10236_begin_date = input(put(rundate_number-&p10236_num_days+1,num_to_date.),8.);
end;

/* Skip parties that do not have transactions on the current day */
if date_key{n} < rundate then
goto &sysmacroname.;
p10236_day_list = ' ';
p10236_day_count = 0;
p10236_total_amount = 0;

do i = n to 1 by -1 until(date_key{i} < p10236_begin_date);
if p10236_begin_date <= date_key{i} <= rundate then
do;
if upcase(account_type_desc{i}) in (&p10236_account_type_desc) and
upcase(currency_based_account_ind{i}) in (&p10236_currency_acct) and
upcase(transaction_cdi_code{i}) in (&p10236_cdi_indicator) and
upcase(status_desc{i}) in (&p10236_status_desc) then
do;
if currency_amount{i} le &p10236_trans_limit then
goto &sysmacroname.;

%save_transaction_key (calling_macro=&this_macro_name);
p10236_total_amount = sum(p10236_total_amount,currency_amount{i});
repeat = indexw(p10236_day_list,strip(put(date_key{i},8.)));

if repeat eq 0 and not missing(date_key{i}) then
do;
p10236_day_list = catx(' ',p10236_day_list,put(date_key{i},8.));
p10236_day_count + 1;
end;
end;
end;
end;

/* Compare party values to parameters for a match */
if p10236_day_count ge &p10236_day_count and
p10236_total_amount ge &p10236_trans_total then
do;
actual_values_text = tranwrd(&r10236_threshold_message,'#1',strip(put(p10236_total_amount,nlnum32.)) );
actual_values_text = tranwrd(actual_values_text,'#2',strip(put(p10236_day_count,nlnum32.)) );
actual_values_text = tranwrd(actual_values_text,'#$', "&currency_code" );
output &alert_fname;
end;

/* EXIT */
&sysmacroname.:
;
/* ========================================================================== */
/* END SCENARIO - SAS10236 */
/* ========================================================================== */

 

 

I have set the parameter accordingly but Can some body tell what will happen to in below statement :-

if currency_amount{i} le &p10236_trans_limit then
goto &sysmacroname.;

 

Can some body help me in this case ? Whether this logic is correct or not ? What will happen in the above statement ?

How to debug the this custom scenario ? is there any way to cross check why alerts are not generating ?

 

@manishiiita @Patrick I request you help on the review the code and guide me changes 🙂 .

 

1 ACCEPTED SOLUTION

Accepted Solutions
MG18
Lapis Lazuli | Level 10

Hi All,

 

Everything is correct in the logic but I have not added the message entry in the FSK_SCENARIO_MESSAGE table for r10236_threshold_message and after adding the same entry for these parameter and then  this it is generating alerts for the same logic   

 

For troubleshooting the same, we have to test the same scenario through SCENARIO_ADMIN screen and log will be generated /SASAMLROOT/custom/config this log file will have the error and more details .

 

Thanks all for your help .

View solution in original post

2 REPLIES 2
Astounding
PROC Star

Well, we don't really have all the related code.  I can tell you what it appears the code is doing.

 

It looks like the code searches through a set of currency amounts in backwards order (from last to first).  Subject to other calculations in the DATA step, as soon as a currency amount is less than (or equal to) the value specified in &p10236_trans_limit, the program skips over a bunch of processing and resumes with the section labeled "END SCENARIO".

 

Is it correct?  I don't think anybody could possibly tell without spending a day or two studying the rules.

MG18
Lapis Lazuli | Level 10

Hi All,

 

Everything is correct in the logic but I have not added the message entry in the FSK_SCENARIO_MESSAGE table for r10236_threshold_message and after adding the same entry for these parameter and then  this it is generating alerts for the same logic   

 

For troubleshooting the same, we have to test the same scenario through SCENARIO_ADMIN screen and log will be generated /SASAMLROOT/custom/config this log file will have the error and more details .

 

Thanks all for your help .