Unquoted String Constants in Conditional !IF Statements (DEFINE-!ENDDEFINE command)

Prior to version 12.0, under certain circumstances unquoted string constants in conditional !IF statements were not case sensitive. Starting with version 12.0, unquoted string constants are case sensitive. For backward compatibility, always use quoted string constants.

Example

DEFINE noquote(type = !DEFAULT(a) !TOKENS(1))
!IF (!type = A)!THEN 
frequencies variables=varone.
!ELSE 
descriptives variables=vartwo.
!IFEND
!ENDDEFINE.
DEFINE yesquote(type = !DEFAULT(‘a’) !TOKENS(1)).
!IF (!type = ‘A’)!THEN 
FREQUENCIES varone.
!ELSE 
DESCRIPTIVES vartwo.
!IFEND.
!ENDDEFINE.
  • In the first macro, !IF(!type = A) is evaluated as false if the value of the unquoted string constant is lowercase ‘a’—and is therefore evaluated as false in this example.
  • Prior to version 12.0, !IF (!type = A) was evaluated as true if the value of the unquoted string constant was lowercase ‘a’ or uppercase ‘A’—and was therefore evaluated as true in this example.
  • In the second macro, !IF (!type = ‘A’) is always evaluated as false if the value of the string constant is lowercase ‘a.’