Alphanumeric pictures control formatting of alphanumeric strings. An alphanumeric picture allows you to mix constant characters in the picture specification with the data being processed. You can also mask out unwanted character types.
When the HPL processes an alphanumeric picture, the picture string is scanned until a picture-control character is found. All noncontrol characters in the picture string are placed directly into the output string.
When a control character is found in the picture string, the input data is scanned until a character that matches the type of the picture-replacement character is found. This character is placed in the output string, and the process is repeated.
The alphanumeric picture-control characters are X, a, A, 9, and \. A picture string that includes any of the preceding characters is, by definition, an alphanumeric picture string. All other characters in an alphanumeric picture string are treated as literals and inserted directly into the resulting output string.
The following table describes the behavior of the alphanumeric picture-control characters.
The following table lists some examples of alphanumeric pictures.
Picture | Input Data | Output Data |
---|---|---|
XX-AJXXXX | 12P45-q | 12-PJ45-q |
AA-\AJAAAA | 12P45-q | 12-AJP45q |
aaaaaaaa | 12P45-q | Pq |
aa99999 | 123abc | ab00000 |