Writing Rules › Specifying Text Strings in Rules › Enclosing Character Strings in Quotes
Enclosing Character Strings in Quotes
You must enclose a character string in quotes in these cases:
- When leading or trailing blanks are significant, as shown in this example:
WHEN(&JOBNAME EQ 'CICS ')
- When the ampersand character displays in a string and it may be mistaken for the beginning of a variable name, as in the following example. This example also shows how to concatenate quoted and unquoted strings by placing them side by side in a text string.
WTO(NOT AN ENVIRONMENTAL '&'VARIABLE)
- When the string itself contains a quote or when the string has unbalanced parentheses, as shown in this example:
WTO('TEXT WITH MANY PARENS)))))')
- Within a quoted string, you specify the quote character by writing two adjacent single quotes, as shown in these examples:
WTO('TEXT WITH ''QUOTES'' IN IT')
OSCMD('SEND ''IMS HAS ABENDED'',BRDCST')
Note: If you place two adjacent single quotes outside a quoted string, the two quotes evaluate to null, as shown in the following example:
The phrase OSCMD(SEND ''IMS HAS ABENDED'',BRDCST) produces:
SEND IMS HAS ABENDED,BRDCST
Copyright © 2012 CA.
All rights reserved.
|
|