CAS 6


if
- Logical

Summary

Returns one value if a condition is true and another value if it is false.

Description

Note: CAS comes with many functions that make complex if-then logic unnecessary.

For example, to make sure a calculation result is non negative use: 0 max AMOUNT1-AMOUNT2 instead of :if (0 < AMOUNT1-AMOUNT2)(AMOUNT1-AMOUNT2)(0)

Examples

if (ORIGINATOR in 'BANKA') (ORIGDATE mplus 360) (MATURITY)
if (MARGIN gt 0) ('A') ('F')

Syntax

if ConditionExp ThenExp ElseExp

Right Arguments

Name Data Type Input Type Description Optional Default
ConditionExp Text, Numeric, Boolean, Date Field Yes
ThenExp Text, Numeric, Boolean, Date Field, Constant Yes
ElseExp Text, Numeric, Boolean, Date Field, Constant Yes

Result

Type: Text, Numeric, Boolean, Date

Merged ThenExp ElseExp



Build 6.0.624