Formatting properties

The formatting properties specify characteristics that are meaningful when data is presented on a form or a Web browser. The properties affect data at output or at both input and output.

The properties are as follows:

align

The align property specifies the position of data in a variable field when the length of the data is smaller than the length of the field. This property is useful on text and print forms.

On output, character and numeric data are affected by this property. On input, character data is affected by this property, but numeric data is always right-justified.

Valid values are as follows:

left

Place the data at the left of the field, as is the default for character data. Initial spaces are stripped and placed at the end of the field.

none

Do not justify the data. This setting is valid only for character data.

right

Place the data at the right of the field, as is the default for numeric data. Trailing spaces are stripped and placed at the beginning of the field. This setting is required for numeric data that has a decimal position or sign.

boolean

The boolean property indicates that the field represents a Boolean value. The property restricts the valid field values and is useful in text and print forms and in page handlers, for input or output.

On a Web page associated with an EGL page handler, a boolean item is represented by a checkbox. On a form, the situation is as follows:

  • The value of a numeric field is 0 (for false) or 1 (for true).

  • The value of a character field is represented by a word or subset of a word that is national-language dependent. In English, for example, a boolean field of three or more characters has the value yes (for true) or no (for false), and a one-character boolean field value has the truncated value y or n.

    The specific character values for yes and no are determined by the locale.

currency

The currency property indicates whether to include a currency symbol before the value in the text field, with the exact position of the symbol determined by the zeroFormat property. This property is useful in text and print forms and in page handlers. Values are as follows:

No (the default)

Do not use a currency symbol.

Yes

Use the default currency symbol. The default is determined by the machine locale.

Currency

Use the specified currency symbol.

fillCharacter

The fillCharacter property indicates what character fills unused positions in a text or print form or in page-handler data. In addition, the property changes the effect of set field full, as described in set. The effect of this property is only at output.

The default is a space for numbers and a 0 for hex items. The default for character types depends on the medium:

  • In text or print forms, the default is null (binary zero)

  • For page-handler data, the default is blank for data of type CHAR or MBCHAR

In page handlers, the value of fillCharacter must be a space (as is the default) for items of type DBCHAR or UNICODE.

dateFormat

The dateFormat property identifies the format for dates that are displayed on a form or maintained in a page handler. This property affects both input and output, but is not used in the following cases:

  • The item has decimal places, a currency symbol, a numeric separator, or a sign; or

  • The data type for the data item is DBCHAR, MBCHAR, or HEX; or

  • The item is not long enough to contain the mask. (For other details, see Length considerations for times.)

Valid values are as follows:

"pattern"

The value of pattern consists of a set of characters, as described in the next table.

Characters Meaning
< If this character is in the first position of the mask, leading zeros are dropped from the item at output.
dd Day of month as a 2-digit number.
ddd Day of the year as a 3-digit number.
mm Month as a 2-digit number.
yy Year as a 2-digit number.
yyyy Year as a 4-digit number.
Any other single-byte character A separator character. Separator characters can be omitted when a date is entered by the user or maintained in the page handler.

iso

The pattern "yyyy-mm-dd", which is the date format specified by the International Standards Organization (ISO).

usa

The pattern "mm/dd/yyyy", which is the IBM USA standard date format.

eur

The pattern "dd.mm.yyyy", which is the IBM European standard date format.

jis

The pattern "yyyy-mm-dd", which is the Japanese Industrial Standard date format.

locale

If specified for a page-handler item, this choice uses the date format given in the run-time Java locale. If specified for a form item, this choice is equivalent to selecting systemGregorian.

systemGregorian

An 8- or 10-character pattern that includes DD (for numeric day), MM (for numeric month), and YY or YYYY (for numeric year), with characters other than D, M, Y, or digits used as separators.

The format is in this Java run-time property:

  vgj.datemask.gregorian.long.NLS

NLS

The NLS (national language support) code that is specified in the Java run-time property vgj.nls.code. The code is one of those listed in targetNLS. Uppercase English (code ENP) is not supported.

For additional details on vgj.nls.code, see Java run-time properties (details).

systemJulian

A 6- or 8-character pattern that includes DDD (for numeric day) and YY or YYYY (for numeric year), with characters other than D, Y, or digits used as separators.

The format is in this Java run-time property:

  vgj.datemask.julian.long.NLS

NLS

The NLS (national language support) code that is specified in the Java run-time property vgj.nls.code. The code is one of those listed in targetNLS. Uppercase English (code ENP) is not supported.

For additional details on vgj.nls.code, see Java run-time properties (details).

Internal date formats

When the user enters valid data, the date is converted from the format specified for the field to an internal format, as is used for subsequent validation.

The internal format for a character date is the same as the system default format and includes separator characters.

For a numeric date, the internal formats are as follows:

  • For a Gregorian short date, 00YYMMDD

  • For a Gregorian long date, 00YYYYMMDD

  • For a Julian short date, 0YYDDD

  • For a Julian long date, 0YYYYDDD

Length considerations for dates

In a form, the field length on the form must be greater than or equal to the length of the field mask that you specify. The length of the item must be long enough to hold the internal format of the date.

In a page-handler item, the rules are as follows:

  • The item length must be sufficient for the date mask you specify but can be longer

  • In the case of a numeric item, the separator characters are excluded from the length calculation.

Examples are in the next table.

Format type Example Length of form field Minimum length of page-handler item (character type) Valid length of page-handler item (numeric type)
Short Gregorian YY/MM/DD 8 8 6
Long Gregorian YYYY/MM/DD 10 10 8
Short Julian DDD-YY 6 6 5
Long Julian DDD-YYYY 8 8 7

I/O considerations for dates

Data entered into a variable field is checked to ensure that the date was entered in the format specified. The user does not need to enter the leading zeros for days and months, but can specify (for example) 8/5/1996 instead of 08/05/1996. The user who omits the separator characters, however, must enter all leading zeros.

lowerCase

The lowerCase property indicates whether to set alphabetic characters to lower case in the user's single-byte character input. Values are as follows:

no (the default)

Do not set the user's input to lower case.

yes

Set the user's input to lower case.

masked

The masked property indicates whether a user-entered character will or will not be displayed. This property is used for entering passwords. Values are as follows:

no (the default)

The user-entered character will be displayed.

yes

The user-entered character will not be displayed.

numericSeparator

The numericSeparator property indicates whether to place a character in a number that has an integer component of more than 3 digits. If the numeric separator is a comma, for example, one thousand is shown as 1,000 and one million is shown as 1,000,000. Values are as follows:

no (the default)

Do not use a numeric separator.

yes

Use a numeric separator.

The default is determined by the machine locale.

sign

The sign property indicates the position in which a positive (+) or negative (-) sign is displayed when a number is placed in the field, whether from user input or from the program. Values are as follows:

none

A sign is not displayed.

leading

The default: a sign is displayed to the left of the first digit in the number, with the exact position of the sign determined by the zeroFormat property (described later).

trailing

A sign is displayed immediately to the right of the last digit in the number.

timeFormat

The timeFormat property identifies the format for times that are displayed on a form or maintained in a page handler. This property affects both input and output, but is not used in the following cases:

  • The item has decimal places, a currency symbol, a numeric separator, or a sign; or

  • The data type for the data item is DBCHAR, MBCHAR, or HEX; or

  • The item is not long enough to contain the mask. (For other details, see Length considerations for times.)

Valid values are as follows:

"pattern"

The value of pattern consists of a set of characters, as described in the next table.

Characters Meaning
< If this character is in the first position of the mask, leading zeros are dropped from the item at output.
hh Hours of the day as a 2-digit number that ranges from 1 to 12 (if the pattern includes the characters am) or from 0 to 23.
mm Minutes as a 2-digit number.
ss Seconds as a 2-digit number.
am AM or PM; if specified, the hours range from 1 to 12.
Any other single-byte character A separator character. Separator characters can be omitted when a time is entered by the user or maintained in the page handler.

iso

The pattern "hh.mm.ss", which is the time format specified by the International Standards Organization (ISO).

usa

The pattern "hh:mm AM", which is the IBM USA standard time format.

eur

The pattern "hh.mm.ss", which is the IBM European standard time format.

jis

The pattern "hh:mm:ss", which is the Japanese Industrial Standard time format.

Length considerations for times

In a form, the field length must match the length of the time mask you specify. In a page-handler item, the rules are as follows:

  • The item length must be sufficient for the time mask you specify but can be longer

  • In the case of a numeric item, the separator characters are excluded from the length calculation.

I/O considerations for times

Data entered into a variable field is checked to ensure that the time was entered in the format specified. The user does not need to enter the leading zeros for hours, minutes, and second, but can specify (for example) 8:15 instead of 08:15. The user who omits the separator characters, however, must enter all leading zeros.

A time stored in internal format is not recognized as a time, but simply as data. If a 6-character time field is moved to a character item of length 10, for example, EGL pads the destination field with blanks. When the 6-character value is presented on a form, however, the time is converted from its internal format, as appropriate.

timeStampFormat

The timeStampFormat property identifies the format for timestamps that are displayed on a form or maintained in a page handler.

Valid values are as follows:

"pattern"

The value of pattern consists of a set of characters, as described in the next table.

Characters Meaning
< If this character is in the first position of the mask, leading zeros are dropped from the item at output.
yyyy Year as a 4-digit number.
mm Month as a 2-digit number.
dd Day as a 2-digit number.
hh Hours of the day as a 2-digit number that ranges from 1 to 12 (if the pattern includes the characters am) or from 0 to 23.
mm Minutes as a 2-digit number.
ss Seconds as a 2-digit number.
ffffff Fractions of a second. Between 0 and 6 f's may be specified.
Any other character Itself.

db2

The pattern "yyyy-mm-dd-hh.mm.ss.ffffff", which is the IBM DB2 default timestamp format.

odbc

The pattern "yyyy-mm-dd hh:mm:ss.ffffff", which is the ODBC timestamp format.

The following rules apply to timeStampFormatpatterns:

  • Patterns representing time units (years, days, etc.) must be specified in the order in which they appear in the timestamp. Patterns may be dropped from the beginning or end of the timestamp, but not from the middle.

  • The difference between month (mm) and minutes (mm) is determined by context; mm is assumed to be minutes if it is immediately preceded by hh or followed by ss or if it is specified as the only time unit pattern.MM can only represent month.

upperCase

The upperCase property indicates whether to set alphabetic characters to upper case in the user's single-byte character input.

This property is useful in forms and in page handlers.

The values of upperCase are as follows:

No (the default)

Do not set the user's input to upper case.

Yes

Set the user's input to upper case.

wordwrap

The wordwrap property indicates whether text can be wrapped onto a new line, if doing so is necessary to avoid truncating text. Values are as follows:

no (the default)

The text in the wrapping field may not be split at a white space.

yes

If possible, the text in a wrapping field will be split at a white space.

zeroFormat

The zeroFormat property specifies how zero values are displayed in numeric fields. This property is affected by the numeric separator, currency, and fillCharacter properties. The values of zeroFormat are as follows:

Yes

A zero value is displayed as the number zero, which can be expressed with decimal points (0.00 is an example, if the item is defined with two decimal places) and with currency symbols and character separators ($000,000.00 is an example, depending on the values of the currency and numericSeparator properties). The following rules apply when the value of the property zeroFormat is yes:

  • If the fill character (the value of the fillCharacter property) is 0, the data is formatted with the character 0

  • If the fill character is a null, the data is left-justified

  • If the fill character is a blank, the data is right-justified

  • If the fill character is an asterisk (*), asterisks are used as the left-side fillers instead of blanks

No

A zero value is displayed as a series of the fill character.

Related reference
Java run-time properties (details)
set