Knowledge Base

Welcome to The Carlisle Group's Knowledge Base.

Search or Ask a Question

This is a keyword search that looks for matching articles that contain one or more words specifically by a user in articles’ tags, title and content. Admin writes brief intro content here via admin end. If you are unable to find an answer to your issue, please submit an issue here.

Back to Articles List

Calculation Tables vs Nested "If" Statements | CAS

Added: 05/11/2015; Last Modified: 06/01/2023; Visits:2,321

 The "if" statement in CAS is an If..Then.. Else.. expression.  It takes 3 arguments.  If a "condition" (Selection Statement and first argument) is true, use the "Then" result (second argument), otherwise, use the "Else" result (third argument).  A simple example is as follows:

if (RATETYPE in 'A')('ARM Loans')('Fixed Rate Loans')

In the cases where you want two or more results, you can nest if statements within the "Then" or "Else" clauses.  This can get confusing to write and it is also hard for a coworker to read.

Here is an example of a nested "If" statement:

 if (RATETYPE in 'A')('ARM - ' cat INDEX)(if (ORIGTERM le 120)('FRM10YR')(if(ORIGTERM le 180)('FRM15YR')(if(ORIGTERM le 240)('FRM20YR')(if (ORIGTERM le 300)('FRM25YR')(if (ORIGTERM le 360)('FRM30YR')('FRMOther'))))))

 

A much simpler tool is the CAS Calculation Table. This is located under System Folders, Calculation Tables.

 

 

Open this item and use the grid to input statements and expressions or values. The Calculation Table works from the top down, so records are given the result of the highest line they fall under. 

 

 To execute this Calculation table, go to a CAS Calculation Set and use the syntax:

calctable 'Calculation Table Name'