In 4GL the format of DATE and MONEY values depends on the default locale.
If U.S. English is the default locale the following formats are applied:
These settings can be changed without the need to change the locale. To change the format of these values you should use the corresponding environment variable of your system. Environment variables are set using the command setenv on UNIX/Linux and set command on Windows.
To change the format of the money values, you should set the DBMONEY environment variable as follows:
DBMONEY [front] .|, [back]
Here front and back are optional specify the position of the currency symbol and the symbol itself. If no symbol is specified, it is by default the front dollar ($) sign. You can specify either a period or a coma as the decimal point. For example, if you set the DBMONEY value as follows, your money values will be preceded with the Euro sign and the period will be used as the decimal point (i.e. €234.98):
You can also change the money and the format of numeric values (DECIMAL, FLOAT, INTEGER, etc.) using the DBFORMAT environment variable, which has the following syntax (here front and back keywords also specify the currency symbol):
DBFORMAT [front]:[thousands separator]:decimal separator:[back]
To change the default date format you can use the DBDATE environment variable. Here is its syntax:
DBDATE MD|DM Y4|Y2 /|-|.|0
DBDATE Y4|Y2 MD|DM /|-|.|0
Here Y2 means year in 2-digit format, Y4 – year in 4-digit format. MD – means month-day sequence, DM – day-month sequence. You can specify a slash, a hyphen or a period as a separator or you can specify zero, if you do not want any separator to be used.
For example, if you want your date values to be in format day-month-year (4-digit format) with a hyphen separator (i.e. 28-05-2012), you need to set this variable as follows: