Format characters
The characters specified below have a special meaning inside format specifications, provided that these are specified in uppercase.
Characters without special meaning will be inserted in the location they are inserted in the format.
In case of an alphanumeric value being assigned to a numeric layout object with a format, the alphanumeric value must match the format in order to avoid unexpected results.
Note: When using a FORMAT on a signed numeric or financial the usage of a sign encoding character will be mandatory in the future.
Character: | Meaning: |
$ |
If added at the front it adds a currency sign in front of the value. Example:
Value 0012.95 with format $99999.99 results in $00012.95
Value 0012.95 with format $ZZZZ9.99 results in $ 12.95 Value 0012.95 with format $$$$$9.99 results in $12.95
|
B |
Adds a blank space on the location it is inserted. Example:
Value 8675309 with format 999B9999 results in 867 5309
|
' ' (space) |
A space adds a blank space on the location it is inserted, the same meaning as B. Example:
Value 8675309 with format 999 9999 results in 867 5309
|
S | Sign encoding will be set to overpunch. Note: Default overpunch position is the last digit. Use LEADING-SIGN to set the overpunch position to the first digit. Note 2: Default LION overpunch will be used. I.e. for positive numerics 0 to 9 and for negative numerics A to J. See also Overpunch Encoding. |
Z |
Suppresses leading zeroes. |
9 |
Numeric |
X |
Alpha |
/ |
Adds a slash on the location it is inserted. |
: |
Adds a colon on the location it is inserted. |
- |
Sign location, when negative '-' else ' ' |
+ |
Sign location, when positive '+' else '-' |
CR |
Credit sign location, when positive then ' ' else 'CR' |
DB |
Debit sign location, when positive then ' ' else 'DB' |
* |
Replaces leading zeroes with asterisks. |
! |
When placed at the front and the value is zero then the result will be blank. Example:Value 0000 with format !9999 results in ''
|
// using the format option
sn-62 : signed 6.2 format '-ZZ99.99'
sa-100 : alpha 100
// The structured field "sn-62" is set to -1.23
sn-62 := -1.23
// The value of sn-62 is assigned to the alpha field "sa-100"
sa-100 := sn-62
// Due to the format of sn-62 sa-100 becomes "- 01.23"