<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS AML Custom Scenario Coding in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-AML-Custom-Scenario-Coding/m-p/525873#M143108</link>
    <description>&lt;P&gt;I suggest you track this to SAS Tech Support. Only SAS AML users would be able to help you with this as they are the only ones with access to the AML documentation.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jan 2019 20:50:20 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2019-01-09T20:50:20Z</dc:date>
    <item>
      <title>SAS AML Custom Scenario Coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-AML-Custom-Scenario-Coding/m-p/525692#M143063</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create new scenario for SAS AML 7.1 tool and I need little help about it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Business team wants to create alerts about the persons who did same transactions and currency for past 7 days more than 4.&lt;/P&gt;&lt;P&gt;Based on given example below we are expecting that customer number 111 has 4 times same transaction with “2000$” in past 7 days. I would like to create an alert end of the day "16MAR " about this customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate it if you could help me with that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data sample;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input date_key date9. transaction_amount currency_key customer_number;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;17MAR2018 1000 USD 111&lt;BR /&gt;16MAR2018 2200 USD 111&lt;BR /&gt;15MAR2018 2200 EUR 111&lt;BR /&gt;14MAR2018 1500 EUR 111&lt;BR /&gt;13MAR2018 2200 USD 111&lt;BR /&gt;12MAR2018 1600 USD 111&lt;BR /&gt;11MAR2018 2200 USD 111&lt;BR /&gt;10MAR2018 2200 USD 111&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 12:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-AML-Custom-Scenario-Coding/m-p/525692#M143063</guid>
      <dc:creator>FerhatD</dc:creator>
      <dc:date>2019-01-09T12:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS AML Custom Scenario Coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-AML-Custom-Scenario-Coding/m-p/525873#M143108</link>
      <description>&lt;P&gt;I suggest you track this to SAS Tech Support. Only SAS AML users would be able to help you with this as they are the only ones with access to the AML documentation.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jan 2019 20:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-AML-Custom-Scenario-Coding/m-p/525873#M143108</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-01-09T20:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS AML Custom Scenario Coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-AML-Custom-Scenario-Coding/m-p/914365#M360295</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;I am too late for this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE style="position: fixed; left: -1000px;"&gt;PROC SORT DATA = your_data; BY Customer_Number Transaction_Amount currency_key;RUN;&lt;BR /&gt;&lt;BR /&gt;data alerts;&lt;BR /&gt;    set your_data;&lt;BR /&gt;    format alert_date date9.; &lt;BR /&gt;    &lt;BR /&gt;    /* Check for transactions in the last 7 days with the same amount and currency */&lt;BR /&gt;    by Customer_Number Transaction_Amount currency_key;&lt;BR /&gt;&lt;BR /&gt;    retain count;&lt;BR /&gt;&lt;BR /&gt;    if first.Customer_Number then count = 0;&lt;BR /&gt;&lt;BR /&gt;    if date_key &amp;gt;= intnx('day', today(), -10) and lag(Transaction_Amount) = Transaction_Amount and lag(currency_key) = currency_key then do;&lt;BR /&gt;        count + 1;&lt;BR /&gt;        if count &amp;gt;= 4 then do;&lt;BR /&gt;           alert_date = today(); &lt;BR /&gt;            output;&lt;BR /&gt;        end;&lt;BR /&gt;    end;&lt;BR /&gt;    else count = 0;&lt;BR /&gt;&lt;BR /&gt;    drop count;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;but one can try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE style="position: fixed; left: -1000px;"&gt;PROC SORT DATA = your_data; BY Customer_Number Transaction_Amount currency_key;RUN;&lt;BR /&gt;&lt;BR /&gt;data alerts;&lt;BR /&gt;    set your_data;&lt;BR /&gt;    format alert_date date9.; &lt;BR /&gt;    &lt;BR /&gt;    /* Check for transactions in the last 7 days with the same amount and currency */&lt;BR /&gt;    by Customer_Number Transaction_Amount currency_key;&lt;BR /&gt;&lt;BR /&gt;    retain count;&lt;BR /&gt;&lt;BR /&gt;    if first.Customer_Number then count = 0;&lt;BR /&gt;&lt;BR /&gt;    if date_key &amp;gt;= intnx('day', today(), -10) and lag(Transaction_Amount) = Transaction_Amount and lag(currency_key) = currency_key then do;&lt;BR /&gt;        count + 1;&lt;BR /&gt;        if count &amp;gt;= 4 then do;&lt;BR /&gt;           alert_date = today(); &lt;BR /&gt;            output;&lt;BR /&gt;        end;&lt;BR /&gt;    end;&lt;BR /&gt;    else count = 0;&lt;BR /&gt;&lt;BR /&gt;    drop count;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SORT DATA = your_data; BY Customer_Number Transaction_Amount currency_key;RUN;

data alerts;
set your_data;
format alert_date date9.;

/* Check for transactions in the last 7 days with the same amount and currency */
by Customer_Number Transaction_Amount currency_key;

retain count;

if first.Customer_Number then count = 0;

if date_key &amp;gt;= intnx('day', today(), -10) and lag(Transaction_Amount) = Transaction_Amount and lag(currency_key) = currency_key then do;
count + 1;
if count &amp;gt;= 4 then do;
alert_date = today();
output;
end;
end;
else count = 0;

drop count;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2024 01:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-AML-Custom-Scenario-Coding/m-p/914365#M360295</guid>
      <dc:creator>Santt0sh</dc:creator>
      <dc:date>2024-02-03T01:32:43Z</dc:date>
    </item>
  </channel>
</rss>

