Back to Contents


Environment Variables

Summary:

See also: Tools, Localization Support, Connections, Installation and Setup


Setting Environment Variables on UNIX

On UNIX platforms, environment variables can be set through the following methods, depending on to the command interpreter used:

Bourne shell:

  VAR=value; export VAR

Korn shell:

  export VAR=value

C shell:

  setenv VAR=value

For more details, refer to the documentation for your UNIX system.


Setting Environment Variables on Windows

On Windows platforms, environment variables can be set by one of the following methods:

For more details, refer to the documentation for your Windows system.

Warnings:

  1. When using Informix, some variables related to the database engine must be set using the SETNET32 utility.
  2. On Windows, double quotes do not have the same meaning as on UNIX systems. For example, if you set a variable with the command SET VAR="abc", the value of the variable will be "abc" (with double quotes), and not abc.

DBDATE

Purpose:

Defines the default display format for DATE values and the default picture for automatic string-to-DATE conversions.

Values:

Values can be a restricted combination of several symbols described in the following table:

Symbol Meaning in DBDATE format string
D Day of month as one or two digits
M Month as one or two digits
Y2 Year as two digits
Y4 Year as four digits
/ Default time-unit separator for the default locale
- Minus time-unit separator
, Coma time-unit separator
. Period time-unit separator
0 Indicates no time-unit separator

The combinations must follow a specific order:

  { DM | MD } { Y2 | Y4 } { / | - | , | . | 0 }
  { Y2 | Y4 } { DM | MD } { / | - | , | . | 0 }

Notes:

  1. DBDATE defines the order of the month, day, and year time units within a date, whether the year is printed with two digits (Y2) or four digits (Y4) and the time-unit separator between the month, day, and year.
  2. In programs, when you assign a string representing a date to a variable defined with the DATE data type, automatic string-to-DATE conversion takes place based on the DBDATE definition.
  3. In the default locale, the default setting for DBDATE is DMY4/.
  4. Date formatting specified in a USING clause or FORMAT attribute overrides the formatting specified in DBDATE.

Example:

DBDATE="DMY4/"
export DBDATE


DBDELIMITER

Purpose:

The DBDELIMITER environment variable defines the value delimiter for LOAD and UNLOAD instructions.

Notes:

  1. If this variable is not defined, the default delimiter is a (|) pipe.

Example:

DBDELIMITER="@"
export DBDELIMITER


DBCENTURY

Purpose:

The DBCENTURY environment variable specifies how to expand abbreviated one- and two-digit year specifications within DATE and DATETIME values.

Values:

Symbol Algorithm for Expanding Abbreviated Years
C Use the past, future, or current year closest to the current date.
F Use the nearest year in the future to expand the entered value.
P Use the nearest year in the past to expand the entered value.
R Prefix the entered value with the first two digits of the current year.

Notes:

  1. Default value is "R" (prefix the entered value with the first two digits of the current year).
  2. Values are case sensitive; only the four uppercase letters are valid.
  3. Three-digit years are not expanded.
  4. If a year is entered as a single digit, it is first expanded to two digits by prefixing it with a zero; DBCENTURY then expands this value to four digits.
  5. Years before 99 AD (or CE) require leading zeros (to avoid expansion).

Warnings:

  1. If the database server and the client system have different settings for DBCENTURY, the client system setting takes precedence for abbreviations of years in dates entered through the application. Expansion is sensitive to the time of execution and to the accuracy of the system clock-calendar. You can avoid the need to rely on DBCENTURY by requiring the user to enter four-digit years or by setting the CENTURY attribute in the form specification of DATE and DATETIME fields.

DBEDIT

Purpose:

The DBEDIT environment variable defines the editor program to be used for TEXT fields.


DBFORMAT

Purpose:

The DBFORMAT environment variable defines the input and display format for numbers.

See also DBMONEY.

Syntax:

front:thousands:decimal:back

Notes:

  1. front is the leading currency symbol, can be an asterisk ( * ).
  2. throusands is a character that you specify as a valid thousands separator, can be an asterisk ( * ).
  3. decimal is a character that you specify as a valid decimal separator.
  4. back is the trailing currency symbol, can be an asterisk ( * ).

Usage:

The DBFORMAT environment variable specifies the format in which values are entered, displayed, or passed to the database for number data types: MONEY, DECIMAL, INTEGER, SMALLINT, FLOAT, SMALLFLOAT.

The default format specified in DBFORMAT affects numeric and monetary values in display, input, and output operations.

DBFORMAT can specify the leading and trailing currency symbols (but not their default positions within a monetary value) and the decimal and thousands separators. The decimal and thousands separators defined by DBFORMAT apply to both monetary and other numeric data.

Features of BDL affected by the setting in DBFORMAT include (but are not restricted to) the following items:

The asterisk ( * ) specifies that a symbol or separator is not applicable; it is the default for any front, thousands, or back term that you do not define.

If you specify more than one character for decimal or thousands, the values in the decimal or thousands list cannot be separated by spaces (nor by any other symbols). BDL uses the first value specified as the thousands or decimal separator when displaying the number or currency value in output. The user can include any of the decimal or thousands separators when entering values.

Any printable character that your locale supports is valid for the thousands separator or for the decimal separator, except:

The same character cannot be both the thousands and decimal separator. A blank space (ASCII 32) can be the thousands separator (and is conventionally used for this purpose in some locales). The asterisk ( * ) symbol is valid as the decimal separator, but is not valid as the thousands separator.

The colon ( : ) symbol is supported as thousands or decimal separator but must be preceded by a backslash ( \ ) symbol, as in the specification :\::.:DM. .

You must include all three colons. Enclosing the DBFORMAT specification in a pair of single quotation marks is recommended to prevent the shell from attempting to interpret (or execute) any of the DBFORMAT characters.

The setting in DBFORMAT also affects how formatting masks of the FORMAT attribute and of the USING operator are interpreted. In formatting masks of FORMAT and USING, the following symbols are not literal characters but are placeholders for what DBFORMAT specifies:

In formatting masks of the FORMAT attribute, the at (@) sign is a placeholder for the back currency symbol. (The @ symbol has no special significance in formatting masks for the USING operator.)

The following table illustrates the results of different combinations of DBFORMAT setting and format string on the same value.

Value Format String DBFORMAT Result
1234.56 $$#,###.## $:,:.: $1,234.56
1234.56 $$#,###.## :.:,:DM 1.234,56
1234.56 #,###.##@ $:,:.: 1,234.56
1234.56 #,###.##@ :.:,:DM 1.234,56DM

When the user enters number or currency values, the runtime system behaves as follows:

When the runtime system displays or prints values:

When MONEY values are converted to character strings by the LET statement, both automatic data type conversion and explicit conversion with a USING clause insert the DBFORMAT-defined separators and currency symbol into the converted strings.

For example, suppose DBFORMAT is set as follows:

*:.:,:DM

The value 1234.56 will print or display as follows:

1234,56DM

Here DM stands for deutsche marks. Values input by the user into a screen form are expected to contain commas, not periods, as their decimal separator because DBFORMAT has *:.:,:DM as its setting in this example.


DBMONEY

Purpose:

The DBMONEY environment variable defines the currency symbol and the decimal separator for MONEY values.

See also DBFORMAT.

Syntax:

front{.|,}back

Notes:

  1. front is a character string representing a leading currency symbol that precedes the MONEY value. This string can be up to seven characters long and can contain any character except a comma or a period.
  2. back is a character string representing a trailing currency symbol that follows the MONEY value. This string can be up to seven characters long and can contain any character except a comma or a period. 

Usage:

This variable is used to display or input MONEY values and for implicit data conversion between MONEY values and character strings.

Currency symbol and decimal separator characters must be specified in this environment variable.

The position of the currency symbol (relative to the decimal separator) indicates whether the currency symbol appears before or after the MONEY value. When the currency symbol is positioned in DBMONEY before the decimal separator, it is displayed before the value ($1234.56). When it is positioned after the decimal separator, it is displayed after the value (1234.56F).

The runtime system recognizes the period ( . ) and the comma ( , ) as decimal separators. All other characters are considered to be part of the currency symbol. For example, ", FR" defines a MONEY format with the comma as decimal separator and the string " FR" (including the space) as the currency symbol.

The default value for DBMONEY is "$.", defining the currency symbol as the dollar sign ( $ ) and the decimal separator as the period ( . ).

Because only its position within a DBMONEY setting indicates whether a symbol is the front or back currency symbol, the decimal separator is required. If you use DBMONEY to specify a back symbol, for example, you must supply a decimal separator (a comma or period). Similarly, if you use DBMONEY to change the decimal separator from a period to a comma, you must also supply a currency symbol.

To avoid ambiguity in displayed numbers and currency values, do not use the thousands separator of DBFORMAT as the decimal separator of DBMONEY. For example, specifying comma as the DBFORMAT thousands separator dictates using the period as the DBMONEY decimal separator.

Example:

DBMONEY="$."
export DBMONEY
DBMONEY=",F"

export DBMONEY


DBPATH

Purpose:

The DBPATH environment variable defines the path to search for form files loaded by OPEN FORM.

Notes:

  1. If this variable is not defined, the default is the current directory.
  2. You can provide a list of paths, with a system specific separator.

Warnings:

  1. The path separator must be platform specific, ( : on UNIX and ; on Windows platforms).

Example:

DBPATH="/user/forms1:/user/form2"
export DBPATH


DBPRINT

Purpose:

The DBPRINT environment variable specifies the print device to be used by reports defined TO PRINTER.

Notes:

  1. On UNIX systems, this variable typically contains the printer queue command such as lp.
  2. To have the DVM print to the printer on the client running the GDC, set DBPRINT=FGLSERVER.

Example (UNIX):

DBPRINT="lpr"
export DBPRINT

Example (Client):

DBPRINT=FGLSERVER
export DBPRINT


FGLCC

Purpose:

The FGLCC environment variable defines the default C compiler to be used to create runtime system programs.

Notes:

  1. If this variable is not defined, the fglmkrun tool uses the CC environment variable.
  2. If the CC environment variable is not defined, the fglmkrun tool uses the 'cc' compiler by default.
  3. This variable is only used in development.

Warnings:

  1. This variable is only used on UNIX platforms.

See also the fglmkrun tool for runtime system program creation.


FGLDIR

Purpose:

The FGLDIR environment variable defines the BDL software installation directory.

Warnings:

  1. The variable must be set in order to use the product components.

FGLDBS

Purpose:

The FGLDBS environment variable defines the database interface type to be used to create runtime system programs.

Notes:

  1. By default, the fglmkrun tool uses predefined database interface type, in accordance with the -d option.

See also the fglmkrun tool for runtime system program creation.


FGLIMAGEPATH

Purpose:

The FGLIMAGEPATH environment variable defines the search paths to find images for the front-end.

Notes:

  1. By default, the image directory is the current directory where the program was started.
  2. You can provide a list of paths, with system-specific path separator.

Warnings:

  1. The path separator must be platform specific, ( : on UNIX and ; on Windows platforms).

Usage:

When the front-end needs to display an image which is specified with a simple file name (not an URL), the front end first looks for local image files on the user workstation. If the image file is not found locally, the front-end sends an image request to the runtime system, which provides the image from the server file-system.

You can define the search path for images with the FGLIMAGEPATH environment variable.

The runtime system searches for image files in the locations described below. The search depends from the name of the image file, the list of directories defined in FGLIMAGEPATH, and the expected file extensions provided by the front-end:

The image file would be searched in the following locations:

  1. ./file
  2. ./file.gif
  3. ./file.png
  4. dir1/file
  5. dir1/file.gif
  6. dir1/file.png
  7. dir2/file
  8. dir2/file.gif
  9. dir2/file.png

Example:

FGLIMAGEPATH="/user/myimages:/user/myicones"
export FGLIMAGEPATH


FGLLDPATH

Purpose:

The FGLLDPATH environment variable defines the search paths to load p-code modules at link and runtime.

Notes:

  1. By default, the current directory is searched for the p-code modules.
  2. You can provide a list of paths, with system-specific path separator.

Warnings:

  1. This variable is used at link time and at run time.
  2. The path separator must be platform specific, ( : on UNIX and ; on Windows platforms).

Example:

FGLLDPATH="/user/modules1:/user/modules2"
export FGLLDPATH


FGLLIBSQL

Purpose:

The FGLLIBSQL environment variable defines the list of database client libraries to be used to create runtime system programs.

Notes:

  1. By default, the fglmkrun tool uses predefined database client libraries, in accordance with the -dcl option.

See also the fglmkrun tool for runtime system program creation.


FGLLIBSYS

Purpose:

The FGLLIBSYS environment variable defines the list of system libraries to be used to create runtime system programs.

Notes:

  1. By default, the fglmkrun tool uses predefined system libraries.

See also the fglmkrun tool for runtime system program creation.


FGLGUI

Purpose:

The FGLGUI environment variable indicates whether the applications are run in character or graphical mode.

Notes:

  1. When set to 0 (zero), the application executes in character terminal mode.
  2. When set to 1 (one), the application executes in graphical mode.

FGLRUN

Purpose:

The FGLRUN environment variable defines the name of the runtime system program (DVM) to be used by BDL tools.

Notes:

  1. The default runtime system program name is fglrun.
  2. This variable is used by tools like fglmkrun, fgldbsch or fgl2p determine the runtime system program that should be used.

Warnings:

  1. It is mandatory to set the FGLRUN environment variable if you have created your own runtime system program with a name other than fglrun.

See also the fglmkrun tool for runtime system program creation.


FGLSERVER

Purpose:

The FGLSERVER environment variable defines the hostname and port of the graphical front end to be used by the runtime system to display the application windows.

Syntax:

{hostname|ipaddress}[:servnum]

Notes:

  1. hostname is the name of a machine on the network.
  2. ipaddress is the IP V4 address ( Ex: 10:0:0:105 ).
  3. servnum identifies the front end. This number also implicitly defines the TCP port number the front end is listening to, as an offset for the base port 6400.

Warnings:

  1. The servnum parameter defines the front end server number (first is 0, second is 1, and so on) and implicitly the TCP port. The port number base is 6400. For example, when using 1, the runtime system connects to the TCP port 6401.

Example:

FGLSERVER="mars:0"
export FGLSERVER


FGLSOURCEPATH

Purpose:

The FGLSOURCEPATH environment variable defines the path to source files for the debugger.

Notes:

  1. By default, source files are searched in the current directory and in the directories defined by FGLLDPATH.
  2. You can provide a list of paths, with a system specific separator.

Warnings:

  1. The path separator must be platform specific, ( : on UNIX and ; on Windows platforms).

FGLDBPATH

Purpose:

The FGLDBPATH environment variable contains the path to database schema files.

Notes:

  1. If this variable is not defined, the default path to schema files is the current directory.
  2. You can provide a list of paths, with a system specific separator.
  3. This variable is only used in development.

Warnings:

  1. The path separator must be platform specific, ( : on UNIX and ; on Windows platforms).

FGLSQLDEBUG

Purpose:

The FGLSQLDEBUG environment variable defines the debug level for tracing SQL instructions.

Notes:

  1. If this variable is set to a value greater than zero, you get a debug trace in the standard error channel.
  2. This variable is only used in development.

FGLPROFILE

Purpose:

The FGLPROFILE environment variable defines the current configuration file to be used by the runtime system.

Notes:

  1. If this variable is not set, the runtime system reads entries from the default configuration file located in FGLDIR/etc/fglprofile, or from the program specific configuration file.
  2. For more details, see the FGLPROFILE page.

CC

Purpose:

The CC environment variable defines the default C compiler to be used.

Warnings:

  1. This variable is only used on UNIX platforms.