EnQuote Character String

EnQuote

The EnQuote procedure doubles any embedded quotes within a character string and then surrounds the string in single quotation marks.

quoted-char-value EnQuote(
  szInputString    65535A   Const Varying 
  szQuote              5A   Const Options(*NOPASS) Varying
)
 

Parameters

szInputString
[input VChar(*) const]  A varying or fixed-length character value whose length is 1 to 65535. The value of this parameter is not modified but is translated to the ASCII CCSID specified on the nCCSID parameter.
szQuote [ ' (apostrophe) ]
[input VChar(5) const]  A varying or fixed-length character value that is used as the quotation mark. Normally the single quote or apostrophe is used. If this parameter is not specified, then the apostrophe is used for the default.  Override this setting when you, for example, need to enquote values that have embedded double quotes (") or other quotation marks.

Return Value

If the function succeeds, the return value is the original input text string with its quotation marks double and surrounded by quotes.

Remarks

For example, if the original value passed on the first parameter is as follows:

 *...v....1....v....2....
 It is 10 O'clock

It is enquoted and the following is returned:

 *...v....1....v....2....
 'It is 10 O''clock'