top of page

SAS Algorithms

SAS is a statistical software developed by SAS institute for the purpose of advanced analytics, multivariate analyses, business intelligence, data management and predictive analytics.

​

Here are some SAS codes that I have written for model building purpose in the banking industry based on my experience as a credit risk modeller intern.

​

Please note that all data sets and methodologies used here are just simulated examples that reflect the banking inudtsry as the real- world data sets and methodologies could not be revealed due to privacy rights.

​

​

Here are 2 input data sets that I have simulated to start with:

​

Code that generates the following input data sets: Input data.docx

​

1. Monthly loan borrower accounts (from Jan 2013 to Dec 2014)

​

​

​

2. Name of loan borrowers

Task 1:

  • Append monthly loan borrower accounts to yearly loan borrower accounts, sorted by account number then date

Code that generates the output data associated with task 1: Task 1.docx

Output data:

Task 2:

  • Append all yearly loan borrower accounts into one big data set

Code that generates the output data associated with task 2: Task 2.docx

Output data:

Task 3:

  • Merge the appended loan borrower accounts with the name of loan borrowers

Code that generates the output data associated with task 3: Task 3.docx

Output data:

Task 4:

  • Output all default accounts.

  • Default accounts are recognised as accounts with ps = N consecutively for ≥ 8 times.

Code that generates the output data associated with task 4: Task 4.docx

Output data:

The default accounts are identified as followed:

Task 5:

  • Extract the very first default date of those default accounts

Code that generates the output data associated with task 5: Task 5.docx

Output data:

​

Task 6:

  • Track the discounted CR and DB outstanding balances of those accounts up to the default date.

  • Discounting to Jan 2013. Discount factor is 12%

Code that generates the output data associated with task 6: Task 6.docx

Output data:

Column 1- column 8

​

​

Column 8 – column 11 

{ dcrbaln: discounted CR outstanding balance n month(s) from Jan 2014 }

Column 12 – column 15

{ dcrbaln: discounted CR outstanding balance n month(s) from Jan 2014 }

Column 62 – column 65

{ ddbbaln: discounted DB outstanding balance n month(s) from Jan 2014 }

Task 7:

  • Summing all discounted CR and DB outstanding balances of all default accounts

Code that generates the output data associated with task 7:  Task 7.docx

Output data:

{ tdiscrb: Total discounted CR outstanding balance }

{ tdiscrb: Total discounted DB outstanding balance }

​

​

​

© Copyright 2016 | Jason Lim. All rights reserved.

bottom of page