<?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: Understanding of SAS AML scenario code SAS10006  . in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/493398#M129787</link>
    <description>&lt;P&gt;Can you please tell where is the macro definition for this %save_transaction_key ?&lt;/P&gt;&lt;P&gt;and what is use of it ? will it save any transaction where is it satisfying condition ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Sep 2018 13:08:31 GMT</pubDate>
    <dc:creator>MG18</dc:creator>
    <dc:date>2018-09-07T13:08:31Z</dc:date>
    <item>
      <title>Understanding of SAS AML scenario code SAS10006  .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/465606#M118773</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SAS AML but I do have basic understanding of BASE SAS ,SAS MACRO and SAS DI/BI.&lt;/P&gt;&lt;P&gt;Can somebody explain me how is&amp;nbsp;scenario code SAS10006 will execute code is given below&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;from where it will pick up values of&amp;nbsp;variables like&amp;nbsp;p10006_begin_date,run_scenario_init,n ,date_key array,account_type_desc{i}.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*==============================================================================&lt;BR /&gt;| SAS SCENARIO FILE&lt;BR /&gt;|&lt;BR /&gt;| PRODUCT: SAS Anti-Money Laundering&lt;BR /&gt;| SYSTEM: UNIX/WINDOWS&lt;BR /&gt;================================================================================&lt;BR /&gt;| NAME: | SAS10006&lt;BR /&gt;| |&lt;BR /&gt;| CATEGORY: | Cash Activity&lt;BR /&gt;| |&lt;BR /&gt;| SEVERITY: | Scenario&lt;BR /&gt;| |&lt;BR /&gt;| FREQUENCY: | Daily&lt;BR /&gt;| |&lt;BR /&gt;| DURATION: | 5 days&lt;BR /&gt;| |&lt;BR /&gt;| SUBJECT: | Customer&lt;BR /&gt;| |&lt;BR /&gt;| PREP FILE: | PARTY_TRANSACTIONS&lt;BR /&gt;| |&lt;BR /&gt;| HEADER FILE: | party_header&lt;BR /&gt;| |&lt;BR /&gt;| TRIGGER: | Yes&lt;BR /&gt;| |&lt;BR /&gt;| DAYS CONSIDERED: | Business&lt;BR /&gt;================================================================================&lt;/P&gt;&lt;P&gt;SHORT DESCRIPTION&lt;BR /&gt;-----------------&lt;BR /&gt;Large Total Cash Transactions&lt;/P&gt;&lt;P&gt;DESCRIPTION&lt;BR /&gt;-----------&lt;BR /&gt;A customer's total amount of cash transactions exceeds a threshold over several&lt;BR /&gt;days.&lt;/P&gt;&lt;P&gt;BUSINESS NOTES&lt;BR /&gt;--------------&lt;BR /&gt;This scenario calculates the sum of a customer's cash credit and cash debit&lt;BR /&gt;transactions over a specified time period. If the total amount of the cash&lt;BR /&gt;transactions is greater than or equal to the specified threshold, a match is&lt;BR /&gt;found. This scenario considers both credit and debit cash transactions based on&lt;BR /&gt;business days. Related scenarios SAS10007 only considers cash deposits and&lt;BR /&gt;SAS10020 allows for examining multiple transaction types.&lt;/P&gt;&lt;P&gt;TECHNICAL NOTES&lt;BR /&gt;---------------&lt;BR /&gt;Not Applicable&lt;/P&gt;&lt;P&gt;MESSAGE&lt;BR /&gt;-------&lt;BR /&gt;r10006_threshold_message = %str("Total Cash Transactions = #$ #1;&lt;BR /&gt;Business Day Count = #2");&lt;/P&gt;&lt;P&gt;SAMPLE MESSAGE&lt;BR /&gt;--------------&lt;BR /&gt;Total Cash Transactions = USD 20,708; Business Day Count = 5&lt;/P&gt;&lt;P&gt;================================================================================&lt;BR /&gt;PARAMETERS&lt;/P&gt;&lt;P&gt;Name Type Default Value&lt;BR /&gt;---------------------------------|-------------------|--------------------------&lt;BR /&gt;p10006_account_type_desc | Character List | 'P'&lt;BR /&gt;p10006_cdi_indicator | Character List | 'C','D'&lt;BR /&gt;p10006_currency_acct | Character List | 'N'&lt;BR /&gt;p10006_num_days | Numeric Constant | 5&lt;BR /&gt;p10006_pri_medium_desc | Character List | 'CASH'&lt;BR /&gt;p10006_status_desc | Character List | 'SUCCESS'&lt;BR /&gt;p10006_trans_limit | Numeric Constant | 10000&lt;BR /&gt;p10006_trans_today | Numeric Constant | 2000&lt;BR /&gt;p10006_trans_total | Numeric Constant | 20000&lt;/P&gt;&lt;P&gt;Descriptions&lt;BR /&gt;------------&lt;BR /&gt;- p10006_account_type_desc&lt;BR /&gt;List denoting valid types of accounts&lt;/P&gt;&lt;P&gt;- p10006_cdi_indicator&lt;BR /&gt;List denoting credit and debit activities&lt;/P&gt;&lt;P&gt;- p10006_currency_acct&lt;BR /&gt;List denoting non-exempt accounts&lt;/P&gt;&lt;P&gt;- p10006_num_days&lt;BR /&gt;Number of business days in interval&lt;/P&gt;&lt;P&gt;- p10006_pri_medium_desc&lt;BR /&gt;List denoting currency activities&lt;/P&gt;&lt;P&gt;- p10006_status_desc&lt;BR /&gt;List denoting completed transactions&lt;/P&gt;&lt;P&gt;- p10006_trans_limit&lt;BR /&gt;Maximum single amount of a valid transaction in interval&lt;/P&gt;&lt;P&gt;- p10006_trans_today&lt;BR /&gt;Minimum aggregate amount of valid transactions on the current day&lt;/P&gt;&lt;P&gt;- p10006_trans_total&lt;BR /&gt;Minimum aggregate amount of valid credits&lt;/P&gt;&lt;P&gt;================================================================================&lt;/P&gt;&lt;P&gt;================================================================================&lt;BR /&gt;Copyright (c) 2012 by SAS Institute Inc., Cary, NC 27513 USA&lt;BR /&gt;- All rights reserved&lt;BR /&gt;==============================================================================*/&lt;/P&gt;&lt;P&gt;/*----------------------------------------------------------------------------&lt;BR /&gt;NOTE:&amp;gt; The statement below required for triggering transaction processing&lt;BR /&gt;------------------------------------------------------------------------------*/&lt;BR /&gt;%let this_macro_name = &amp;amp;sysmacroname; /* save this macro name */&lt;BR /&gt;/*----------------------------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;retain p10006_begin_date;&lt;BR /&gt;format p10006_day_list $512.;&lt;/P&gt;&lt;P&gt;/* This init section should be placed before any goto statements. This section of&lt;BR /&gt;code will only be run when processing the first BY group of the prep data set.&lt;BR /&gt;Any goto statements placed before it may prevent the init code from being run. */&lt;BR /&gt;if run_scenario_init eq 1 then do;&lt;BR /&gt;p10006_begin_date = input(put(rundate_number-&amp;amp;p10006_num_days+1,num_to_date.),8.);&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;/* Skip parties that do not have transactions on the current day */&lt;BR /&gt;if date_key{n} &amp;lt; rundate then goto &amp;amp;sysmacroname.;&lt;/P&gt;&lt;P&gt;p10006_day_list = ' ';&lt;BR /&gt;p10006_day_count = 0;&lt;BR /&gt;p10006_todays_total = 0;&lt;BR /&gt;p10006_total_amount = 0;&lt;/P&gt;&lt;P&gt;do i = n to 1 by -1 until(date_key{i} &amp;lt; p10006_begin_date);&lt;BR /&gt;if p10006_begin_date &amp;lt;= date_key{i} &amp;lt;= rundate then do;&lt;BR /&gt;if upcase(account_type_desc{i}) in (&amp;amp;p10006_account_type_desc) and&lt;BR /&gt;upcase(currency_based_account_ind{i}) in (&amp;amp;p10006_currency_acct) and&lt;BR /&gt;upcase(primary_medium_desc{i}) in (&amp;amp;p10006_pri_medium_desc) and&lt;BR /&gt;upcase(transaction_cdi_code{i}) in (&amp;amp;p10006_cdi_indicator) and&lt;BR /&gt;upcase(status_desc{i}) in (&amp;amp;p10006_status_desc)&lt;BR /&gt;then do;&lt;BR /&gt;if currency_amount{i} gt &amp;amp;p10006_trans_limit then goto &amp;amp;sysmacroname.;&lt;BR /&gt;%save_transaction_key (calling_macro=&amp;amp;this_macro_name);&lt;BR /&gt;p10006_total_amount = sum(p10006_total_amount,currency_amount{i});&lt;BR /&gt;repeat = indexw(p10006_day_list,strip(put(date_key{i},8.)));&lt;BR /&gt;if repeat eq 0 and not missing(date_key{i}) then do;&lt;BR /&gt;p10006_day_list = catx(' ',p10006_day_list,put(date_key{i},8.));&lt;BR /&gt;p10006_day_count + 1;&lt;BR /&gt;end;&lt;BR /&gt;if date_key{i} = rundate then&lt;BR /&gt;p10006_todays_total = sum(p10006_todays_total,currency_amount{i});&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;/* Compare party values to parameters for a match */&lt;BR /&gt;if p10006_todays_total ge &amp;amp;p10006_trans_today and&lt;BR /&gt;p10006_total_amount ge &amp;amp;p10006_trans_total then do;&lt;BR /&gt;actual_values_text = tranwrd(&amp;amp;r10006_threshold_message,'#1',strip(put(p10006_total_amount,nlnum32.)) );&lt;BR /&gt;actual_values_text = tranwrd(actual_values_text,'#2',strip(put(p10006_day_count,nlnum32.)) );&lt;BR /&gt;actual_values_text = tranwrd(actual_values_text,'#$', "&amp;amp;currency_code" );&lt;BR /&gt;output &amp;amp;alert_fname;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;/* EXIT */&lt;BR /&gt;&amp;amp;sysmacroname.:;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* ========================================================================== */&lt;BR /&gt;/* END SCENARIO - SAS10006 */&lt;BR /&gt;/* ========================================================================== */&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 06:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/465606#M118773</guid>
      <dc:creator>MG18</dc:creator>
      <dc:date>2018-05-29T06:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of SAS AML scenario code SAS10006  .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/465613#M118775</link>
      <description>&lt;P&gt;This macro is supposed to be called as part of a data step where the data step supplies the variables (most probably from a dataset in set/merge)&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 06:55:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/465613#M118775</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-29T06:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of SAS AML scenario code SAS10006  .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/465616#M118777</link>
      <description>&lt;P&gt;&lt;SPAN&gt;from where it will pick up values of&amp;nbsp;variables like&amp;nbsp;p10006_begin_date,run_scenario_init,n ,date_key array,account_type_desc{i} ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;where those values are stored ? what will be the input dataset for scenario SAS10006.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 07:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/465616#M118777</guid>
      <dc:creator>MG18</dc:creator>
      <dc:date>2018-05-29T07:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of SAS AML scenario code SAS10006  .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/465619#M118778</link>
      <description>&lt;P&gt;As I already said, that's up to the data step in which this macro is used. You have to look there. On it's own, the definition of a macro does NOTHING.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2018 07:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/465619#M118778</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-29T07:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of SAS AML scenario code SAS10006  .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/493398#M129787</link>
      <description>&lt;P&gt;Can you please tell where is the macro definition for this %save_transaction_key ?&lt;/P&gt;&lt;P&gt;and what is use of it ? will it save any transaction where is it satisfying condition ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 13:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/493398#M129787</guid>
      <dc:creator>MG18</dc:creator>
      <dc:date>2018-09-07T13:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding of SAS AML scenario code SAS10006  .</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/498947#M132691</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The scenario code which you are seeing is the part of SAS Data Step (SET statement inside it). This scenario code is being called in datastep as explained in previous comments.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can only tell, this is typically the SAS AML design of writing scenario codes by using SAS Arrays, SAS Hash and SAS Hash Hiter programming. More information can be found in SAS AML user's guide.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Urvish&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 04:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understanding-of-SAS-AML-scenario-code-SAS10006/m-p/498947#M132691</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2018-09-26T04:42:23Z</dc:date>
    </item>
  </channel>
</rss>

