IBM Support

Web Query - Special Characters

Troubleshooting


Problem

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:

oDouble quotes (" ") in HEADINGs at the report level to specify a line for a HEADING.
oThe dollar sign ($) in the Master File Description which acts as an end of line indicator.
oThe percent sign (%) in a WHERE clause with the LIKE command.
oThe ampersand (&) used for global or local Amper Variables.
oThe quote (') in the EDIT function for the masking of character positions.
oThe parenthesis () in the WHERE clause in expressions to signify order of execution.
oThe asterisk (*) in the WHERE clause for global searches.
oThe 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:

oA local variable name is always preceded by an ampersand (&) and a global variable name is always preceded by a double ampersand (&&).
oEmbedded blanks ( ) are not permitted in a variable name. For example: VAR 1
oIf 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.
oIf 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.
oIf the value for a variable will contain an embedded ampersand (for example AT&T), use a vertical bar directly after the ampersand.
oA 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.
oThe 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;

Fieldname
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:

FIELDNAME=FLD_1, ALIAS="FLD_1", USAGE=A1, ACTUAL=A1,$

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:

Client&Name

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

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"DB2 Web Query","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"5.4.0;6.1.0;7.1.0","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSC3X7","label":"IBM i 6.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC52E","label":"IBM i 7.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

Historical Number

488453193

Document Information

Modified date:
11 November 2019

UID

nas8N1013655