The EGL keyword if marks the start of a set of statements that run only if a logical expression resolves to true. The optional keyword else marks the start of an alternative set of statements that run only if the logical expression resolves to false. The keyword end marks the close of the if statement.
You can nest if and other end-terminated statements (code blocks) to any level. Each end keyword closes the most recent open block of code.

The following if statement runs embedded statements conditionally:
if (userRequest == "U")
myCustomer.customerBalance=newTotal;
try
replace myCustomer;
onException(myEx AnyException)
myErrorHandler(myEx);
end
else
try
add myCustomer;
onException(myEx AnyException)
myErrorHandler(myEx);
end
end