I'm working through the SAS SQL I: Essentials training videos and I'm a bit confused about the terminology of the two different forms of the CASE expressions.
Here is how the video/course materials describe the "simple expression":
"Let's start with the standard form CASE expression, or simple CASE expression. With this syntax, you can use equality and non-equality tests for validity.
SELECT col-name, col-name CASE <case-operand> WHEN when-condition THEN result-expression <WHEN when-condition THEN result-expression...> <ELSE result-expression> END <AS column> |
The "case-operand form" is then described as:
"You can also construct a CASE expression by using the CASE-OPERAND form. You specify the condition as the case-operand once at the top of the CASE expression, followed by a series of WHEN-THEN clauses. Here, we select the Married column, and based on the values, we assign them to a specified category.
When you use the CASE-OPERAND form of the CASE expression, the conditions must all be equality tests. That is, they cannot use comparison operators or other types of operators."
Unless I'm mistaken, it seems that this distinction between "simple form" versus "case-operand form" is different than the "simple case" versus "searched case" forms used in other SQL variants. For example, what the SAS training calls "simple form" corresponds to the "searched case" form and the "case-operand form" corresponds to the "simple case form" as documented by the ANSI-compliant IBM DB product: https://www.ibm.com/docs/en/db2-warehouse?topic=statements-case-statement-in-sql-procedures
The SAS 9.4 documentation doesn't appear to make the distinction between "simple form" and "case-operand form." It seems confusing to call them that in the training/videos when these definitions don't adhere to more standard SQL terminology.