Character-string constants

A character-string constant specifies a varying-length character string. The two forms of character-string constant follow:

Character-string constants can contain mixed data. If the job CCSID supports mixed data, a character-string constant is classified as mixed data if it includes a DBCS substring. In all other cases, a character-string constant is classified as SBCS data.

The CCSID assigned to the constant is the CCSID of the source containing the constant unless the source is encoded in a foreign encoding scheme (such as ASCII). The data in the variable is converted from the foreign encoding scheme to the default CCSID of the current server. In this case, the CCSID assigned to the constant is the default CCSID of the current server.

The CCSID of the source is determined by the application requester. The CCSID of the source is:

Character-string constants are used to represent constant datetime values in assignments and comparisons. For more information see String representations of datetime values.

Examples

   'Peggy'     '14.12.1990'     '32'     'DON''T CHANGE'     ''     X'FFFF'