IBM Support

Web Query - Special Characters

Technote (troubleshooting)


This document discusses the use of special characters in IBM Web Query for i.

Resolving the problem

This document discusses the special characters that are used by Web Query and notes considerations and issues which users should be aware of when using these in applications.

A special character is any character in the character set other than a digit or an alphanumeric character. Following is a list of special characters:

- Dash % Percent Sign
  Space | Vertical Bar
/ Forward Slash \ Backslash
, Comma ( Open Parenthesis
$ Dollar Sign ) Closed Parenthesis
. Period
; Semicolon <   Less Than
+ Plus Sign >   Greater Than
* Asterisk ' Quote
@ At Sign = Equal Sign
& Ampersand " Double Quote

Web Query uses special characters in several places. For example:

o Double quotes (" ") in HEADINGs at the report level to specify a line for a HEADING.
o The dollar sign ($) in the Master File Description which acts as an end of line indicator.
o The percent sign (%) in a WHERE clause with the LIKE command.
o The ampersand (&) used for global or local Amper Variables.
o The quote (') in the EDIT function for the masking of character positions.
o The parenthesis () in the WHERE clause in expressions to signify order of execution.
o The asterisk (*) in the WHERE clause for global searches.
o The forward slash (/) in the development of expressions as the divisor.
User applications should avoid using any of the above special characters in table or field names and data extraction procedures.

Amper variables:

Special characters are also used in amper variables. When using special characters in naming amper variables, there are a few considerations to keep in mind. The following rules apply to amper variable naming conventions:

o A local variable name is always preceded by an ampersand (&) and a global variable name is always preceded by a double ampersand (&&).
o Embedded blanks ( ) are not permitted in a variable name. For example: VAR 1
o If a value for a variable might contain an embedded blank ( ), comma (,) or equal sign (=), enclose the value in single quotation marks when you refer to it.
o If the value for a variable will contain an embedded single quote (for example, O'Malley), use a double quote instead of the single quote in the value and enclose the entire value in single quotes. This allows you to include the single quote without having to use concatenation.
o If the value for a variable will contain an embedded ampersand (for example AT&T), use a vertical bar directly after the ampersand.
o A variable name may be any combination of letters (A through Z), digits (0 through 9), and the underscore (_). The first character of the variable should be a letter.
o The underscore may be included in a variable name, but the following special characters are not permitted:
Plus sign +
Minus sign -
Asterisk *
Forward slash /
Back slash \
Period .
Ampersand &
Semicolon ;

The fieldname used in a Master File Description can include any combination of letters (A through Z), digits (0 through 9), and the underscore (_). The first character of the name should be a letter. The use of special characters in a fieldname of a Master File Description is not recommended and may cause problems in some operating system environments or when resolving expressions.

Although some special characters are allowed as part of a fieldname, many times these special characters are automatically replaced with underscores. The alias for the fieldname still contains the true fieldname surrounded by double quotation marks. For example:


If special characters are desired in a fieldname column title, consider using the TITLE attribute in the Master File. For example:

FIELD = LNAME, ALIAS = LN, USAGE = A15, TITLE = 'Client&Name' ,$

will replace the default column heading, LNAME, with the following:


Editing of Master Files is supported only using the Developer Workbench product.

Cross reference information
Segment Product Component Platform Version Edition
Operating System IBM i 6.1
Operating System IBM i 7.1

Historical Number


Document information

More support for: IBM i
DB2 Web Query

Software version: 5.4.0, 6.1.0, 7.1.0

Operating system(s): IBM i

Reference #: N1013655

Modified date: 18 July 2013