PrintableString Type
12-1
The PrintableString is a subset of GeneralString that comprises the following:
- a to z (lowercase alphabetic characters)
- A to Z (uppercase alphabetic characters)
- 0 to 9 (numeric characters)
- Space or blank character
- ’ ( ) + , - . / : = ? (special characters)
External Form -- Input and Output
This can be any string of valid characters as described above.
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 PrintableString 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 lettermcan be placed after the string to indicate that case is irrelevant. The letterc(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.