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 of 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.

Operating System Environment Variables

This section describes a couple of well-known system environment variables that are used by Genero software components.


PATH

Purpose:

This variable defines the list of search path for executables files.

Notes:

  1. On Unix platforms, PATH defines search path list for executable programs.
  2. On Windows platforms, PATH defines search path for programs and DLLs.
  3. The path separator is a colon (:) on UNIX and a semicolon (;) on Windows.

LD_LIBRARY_PATH

Purpose:

This variable defines the list of search path for shared libraries loaded by the dynamic linker on Unix platforms.

Notes:

  1. On some operating systems, the environment variable defining the shared library search path may have a different name. For example, on a system where a 32b and a 64b environment coexist, you may need to set LD_LIBRARY_PATH_64 to execute the 64b programs.

LC_ALL

Purpose:

This variable defines the locale (language, territory and code-set) for Unix programs.

Notes:

  1. This variable is used by the runtime system to handle character strings. It is important to set this variable properly according to the character set used by your application.
  2. If LC_ALL is not defined, LANG is used instead.
  3. Read the Unix manual of the setlocale C function for more details about this variable. See also the Localization page.

Database Client Environment Variables

If your Genero programs connect to a database server, you will probably have to set database vendor specific environment variables (or registry settings on Windows platforms). You must for example set INFORMIXDIR for an Informix client, ORACLE_HOME for Oracle, etc. Read carefully the database client software documentation. You get also some details in the Database Connections page of this documentation.


Genero Environment Variables

This section lists and describes in detail all Genero specific environment variables.


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 DBDELIMITER is not defined, the default delimiter is a (|) pipe.

Warnings:

  1. Do not use backslash or hex digits (0-9, A-F, a-f).

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 value.
  2. back is a character string representing a trailing currency symbol that follows the value.
  3. The currency symbol can be up to seven characters long and can contain any character except a comma or a period.
  4. The currency symbol can be non-ASCII characters if your current locale supports a code set that defines the non-ASCII characters you use.

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 paths to search for program resource files.

Notes:

  1. If DBPATH is not defined, the default is the current directory.
  2. You can provide a list of paths, using system-specific path separators.

Usage:

The DBPATH environment variable contains the search paths for the following type of files:

  1. Form files loaded by OPEN FORM,
  2. Message files used by OPTIONS HELP FILE,
  3. Resource files of Localized strings.

Warnings:

  1. The path separator is platform specific ( ":" on UNIX platforms and ";" on Windows platforms).

Example (UNIX):

DBPATH="/user/forms1:/user/form2:/usr/strings/french"
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, the DBPRINT environment variable typically contains the printer queue command (such as lp).
  2. To have the DVM print to the printer on the client running the Genero Desktop Client (GDC), set DBPRINT=FGLSERVER.

Example (UNIX):

DBPRINT="lpr"
export DBPRINT

Example (Client):

DBPRINT=FGLSERVER
export DBPRINT


FGLDIR

Purpose:

The FGLDIR environment variable defines the Genero BDL software installation directory.

Warnings:

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

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, using system-specific path separators.

Warnings:

  1. The path separator is platform specific ( ":" on UNIX platforms 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 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 C extensions and modules.

Usage:

A Genero program can be composed by several p-code modules (42m) and can use C extensions. When linking and when executing the program, the runtime system must known where to search for these modules. You can use the FGLLDPATH environment variable to define the search paths to load C extensions and p-code modules.

Modules are searched in several implicit directories in the following order:

  1. The directory where the program (42r) file resides.
  2. A path defined in the FGLLDPATH environment variable.
  3. The FGLDIR/lib directory.
  4. The current directory.

Warnings:

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

Example:

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

See also: IMPORT.


FGLGUI

Purpose:

The FGLGUI environment variable indicates whether the applications are run in TUI or GUI mode.

Notes:

  1. When set to 0 (zero), the application executes in TUI mode.
  2. When set to 1 (one), the application executes in GUI mode.

FGLGUIDEBUG

Purpose:

The FGLGUIDEBUG environment variable defines the debug level in GUI mode.

Notes:

  1. When set to 0 (zero), no debug information is generated.

Usage:

By default, the GUI protocol commands are compressed and not easy to read on the client debug log. If you set this variable to a value different from zero, the protocol commands are indented for better read.

If FGLGUIDEBUG is not set to 0, debug information about the compression initialization is generated.


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

See also: Automatic front-end startup.


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, using system-specific path separators.

Warnings:

  1. The path separator is platform specific ( ":" on UNIX platforms and ";" on Windows platforms).

FGLDBPATH

Purpose:

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

Notes:

  1. If FGLDBPATH is not defined, the current directory is the default path for the database schema files.
  2. You can provide a list of paths, separating the paths with a colon (":").
  3. FGLDBPATH is only used in development.

Warnings:

  1. The path separator is platform specific ( ":" on UNIX platforms and ";" on Windows platforms).

FGLSQLDEBUG

Purpose:

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

Notes:

  1. If FGLSQLDEBUG is set to a value greater than zero, you get a debug trace in the standard error channel.
  2. FGLSQLDEBUG 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 FGLPROFILE 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 information, refer to the FGLPROFILE section of this manual.

FGLWRTUMASK

Purpose:

The FGLWRTUMASK environment variable defines the umask for the FGLDIR/lock directory.

Notes:

  1. The FGLWRTUMASK environment variable is used by the license manager fglWrt.
  2. This variable defines the umask to create the FGLDIR/lock directory.
  3. The default is 000, which creates a directory with rwxrwxrwx rights.

For more information, refer to the Installation section of this manual.