Appendix D: Repository Data Formats

The format specification is a sequence of characters that depicts how the contents of the field will look. The characters listed in the table below have special meanings. Any other character that appears in a format string is inserted directly into the field.

Note

If the format size (number of data characters) is larger than the field size, an alpha field will be left-justified and the format string truncated, while a decimal field will be right-justified and the format string truncated. If the format size is smaller than the field size, the data will be truncated.

Character

Meaning

@

Represents a single alpha character.

X

Represents a single digit. It causes a digit from the source data to be inserted into the specified position in the field. Digits are extracted from the source data beginning at the right and continuing to the left; the rightmost X in the format is loaded with the rightmost digit in the source data. If there are more X characters than there are significant digits in the source data, the leftmost X positions are loaded with zeros.

Z

Represents a single digit. Z differs from X when there are more Z characters than significant digits to be transferred from the source data. The Z position is loaded with a blank if no X character or period appears to the left of it in the format. If a period appears to the left but not to the right, the Z position is loaded with a zero. A zero is also loaded if an X appears to the left of the Z.

*

(asterisk)

Represents a digit position. The * is similar to an X, except that when there are no more significant digits, the position is loaded with an asterisk rather than a zero.

money sign

Represents a digit position. If there are more significant digits to be transferred, the position is loaded with the next digit. If no more significant digits remain to be transferred, the position is loaded with a blank. The rightmost money character is changed to a dollar sign when field loading is concluded. The default money sign is “$”, but you can use the MONEY subroutine to change it to any character. See MONEY.

Causes a minus sign to be inserted at the corresponding position in the field if the – is the first or last character of a format. If the source data is positive, a blank will be inserted. If the – is used within the format, a hyphen is inserted at the corresponding position in the field.

.

(period)

Causes a decimal point to be inserted at the corresponding position in the field. In addition, any Z that appears to the right of the decimal point is treated as an X.

,

(comma)

Causes a comma to be inserted at the corresponding destination position, but only if one of the following conditions is true:

  • More significant source digits remain to be transferred.
  • There is an X character to the left of the comma.