The alert generation process, or AGP, consists of a series of jobs, macros, and flows that analyze customers and transactions, detect suspicious activities, and make results available to the SAS Anti-Money Laundering user interface. For each of the SAS jobs involved, there is a corresponding SAS macro that calls a prep macro. This prep macro queries and updates the amlprep.amlrundate table. In this post, I take a deeper look at the amlprep.aml_rundate table and how it’s used during the AGP.
The aml_rundate table has three main columns, create_date, job_name, and last_analysis_date. Last_analysis_date is the date that the next job run uses for the lower limit. Create_date is the timestamp of the completion of the flow when processing the data from last_analysis_date, and job name is the identifier for the job. In the sample jobs supplied by SAS, this is either DAILY, WEEKLY, or MONTHLY.
Before the AGP can run, the system must determine when to run the next job based on the information in these columns. This is done with the %fcf_analysis_date macro, which is called by the prep macros.
The %fcf_analysis_date macro queries and updates the aml prep.aml_rundate table according to the input parameters.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Action can either be NEW, GET (which is the default), or RESET. This parameter determines the action that the macro performs and appends a new record to the amlprep.aml_rundate table. For example, RESET deletes existing records for the specified frequency.
Run_analysis_date and last_analysis date function slightly differently depending on the action parameter specified.
Job_name can either be DAILY, WEEKLY, or MONTHLY. This is a required parameter that is the name of the AGP job that is currently running. The out-of-the-box values are DAILY, WEEKLY, or MONTHLY. If other jobs are created for a site, the job name should be specified here.
In the environment I’m using, the %fcf_analysis_date macro only specifies the required parameter for each job, which is job_name. Since no action parameter is specified, the default action parameter is GET. This means that the %fcf_analysis_date macro sets two global macro variables when it runs: fcf_last_analysis_date and fcf_run_analysis_date.
fcf_last_analysis_date is set to the maximum value of the last_analysis_date (or current date if no corresponding records are in the table) for the supplied job name from the amlprep.aml_rundate table.
fcf_run_analysis_date is set to the current date. These macro variables are then used in determining the start of the aggregation and what data to include in the prep table.
The initial date for the next run of the corresponding AGP (DAILY, WEEKLY, or MONTHLY) is defined by the last_analysis date value. The finish date is set by the default prep jobs. The date is determined by advancing from the analysis date by the amounts in the prep jobs. Daily advances one day, weekly advances 7 days, and monthly advances to the start of the month after the current analysis date. When the AGP selects core records to populate prep tables, it excludes the initial date and includes the finish date. Let's look at an example.
On January 2nd, 2026, I ran the weekly AGP job. fcf_last_analysis_date is set to the maximum value of the last_analysis_date for the previously run weekly jobs, which is December 18th 2025. This is used as the initial date of the AGP. Because this is the weekly job, the finish date is determined by advancing the analysis date of December 18th by 7 days, which is December 25th, 2025. The AGP aggregates records from December 19th – December 25th for analysis. The finish date of December 25th is then populated/updated in the amlprep.aml_rundate table after the job runs. This is then used to determine the initial date for the next run of the corresponding AGP.
To learn more about the AGP and our SAS Anti-Money Laundering solution in general, please visit https://support.sas.com/en/software/sas-anti-money-laundering-support.html.
Find more articles from SAS Global Enablement and Learning here.
Visit the Tips & Tricks page for setup guidance, demos, and practical examples that show how Copilot supports your workflows.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.