GeneralString Type

12-1
The GeneralString type provides a transparent character set of both graphic and control characters.

External Form -- Input and Output

All values are accepted as supplied.

Local Form and Behavior

On input data is stored as supplied. If the component has a fixed length, a short input string is padded with blanks, and a long input string is truncated.

Named Values

Named values are not applicable to the GeneralString type.

Constraints

There are three ways of constraining this type:
Size constraint --
the SIZE keyword can be used to constrain the number of bytes for this type to a range of values or a single value. For example:
GRAPHICSTRING (SIZE(3..8)) GRAPHICSTRING (SIZE(5))
Character set constraint
-- you can constrain the valid characters that are allowed to be used on this type as external form data by using the FROM keyword to specify a character set. For example:
GRAPHICSTRING (FROM("A"|"B"|"C"|"a"))
In the example, only strings consisting of the specified letters are treated as valid external input.
Character string constraint
-- a set of valid character strings can be specified for this type. For example:
GRAPHICSTRING ("ABC"|"PaR"c|"xYz"m)
The letter
m
can be placed after the string to indicate that case is irrelevant. The letter
c
(the default) is used to show case is relevant. If the case in the external input does not match the string, the input is rejected.
References to GRAPHICSTRING in the preceding examples should be replaced with the applicable type.