IBM InfoSphere DataStage, Version 11.3.1
Character String Constants
In BASIC source code, character string constants are a sequence of ASCII characters enclosed in single or double quotation marks, or backslashes ( \ ). These marks are not part of the character string value. The length of character string constants is limited to the length of a statement.
Some examples of character string constants are the following:
"Emily Daniels"
'$42,368.99'
'Number of Employees'
"34 Cairo Lane"
\"Fred's Place" isn't open\
The beginning and terminating marks enclosing character string data must match. In other words, if you begin a string with a single quotation mark, you must end the string with a single quotation mark.
If you use either a double or a single quotation mark within the character string, you must use the opposite kind to begin and end the string. For example, this string should be written:
"It's a lovely day."
And this string should be written:
'Double quotation marks (") enclosing this string would be
wrong.'
The empty string is a special instance of character string data. It is a character string of zero length. Two adjacent double or single quotation marks, or backslashes, specify an empty string:
' ' or " " or \\
In your source code you can use any ASCII character in character string constants except ASCII character 0 (NUL), which the compiler interprets as an end-of-string character, and ASCII character 10 (linefeed), which separates the logical lines of a program. Use CHAR(0) and CHAR(10) to embed these characters in a string constant.
Last updated: 2015-03-09
PDF version of this information: