Environment Variables


jBASE uses a number of environment variables to modify jBASE behaviour. Suitable defaults apply to most of them. Although most environment variables can be set any time, the best place to do so is in the .profile script.
 

SETTING/GETTING

Windows

set variable=value
echo %variable%

Variables can be configured in the System environment for all users, and/or on a per user basis via the user environment. Additional variables for jBASE can also be added to the current user configuration in the Windows registry.

Windows variables are usually configured in the System Properties panel.

UNIX

variable=value
export variable
echo $variable

This works for all shells, although some shells (i.e. ksh) allow "export variable=value".

Variables are usually configured in the .profile/.bash_profile of the user login directory.  Global variables can be added to the "/etc/profile" script.
 

jBASE PROGRAMS

The jBC functions PUTENV and GETENV can be used to manipulate environment variables. For example:

SUCCESS = PUTENV(envar=x)
SUCCESS = GETENV(envar)


jBASE INITIALIZATION

Some environment variables can only be set before jBASE initialization. jBASE initialization occurs when the first jBASE program is executed on a particular "PORT number".

The jBASE initialization process reads through the environment entries looking for possible variables required by jBASE. This process provides a substantial performance improvement as the state of these environment variables are saved for subsequent jBASE executions. These states continue to be valid as long as the "PORT" is still attached to a process. Some environment variables can be changed by subsequent program execution. The state of these variables are imported back into the state table after program execution.

Certain jBASE programs expect jBASE initialization to have been previously performed otherwise re-initialization will occur and resources expected by the executing program will have been removed.

For instance:

T-ATT requires a "PORT" against which it saves the tape device assignment.
SP-ASSIGN requires a "PORT" with which to save assignment status for print jobs.
READNEXT in a program after SELECT/GET-LIST.

With jBASE 5.x all programs execute in the same process unless explicitly executed via the CHAR(255):'k' construct.
 

INITIAL ENVIRONMENT VARIABLES

PATH pathnames of executables
HOME pathname of user home directory. Many defaults rely on this environment variable
LD_LIBRARY_PATH pathnames of system libraries (Linux, Solaris only)
LIBPATH pathnames of system libraries (AIX only)
LANG language type (UNIX only)
JBASE_LOCALE setting to determine collation sequences for internationalization and secondary indexes (jBASE 5.2 and above)
JBASE_TIMEZONE setting to determine the timezone to use for UTF8 timestamp conversion into local time for display (jBASE 5.2 and above)
JBASE_DATE_FORMAT specifies the format of how dates are converted to/from internal and external date representations
TZ timezone (UNIX only)
LC_ALL will override a specified list of locale settings (UNIX only)
TERM specifies terminal type as per terminfo database
TERMINFO specifies directory for terminal settings
JBCPORTNO forced Port number for use by user; automatically allocated unless this is set
JBCLOGNAME user name to use in-place of login id
JBCGLOBALDIR pathname of jBASE global configuration directory
JBCRELEASEDIR pathname of jBASE release directory
JBCDATADIR pathname of any configured databases and default directory for the jBASE spooler
JBCEMULATE emulation to be used for this user
JEDIFILEPATH directory Paths of application files location
JEDIFILENAME_MD pathname of file to be used for Master Dictionary entries
JEDIFILENAME_SYSTEM pathname of file to be used for SYSTEM entries

 

ADDITIONAL jBASE ENVIRONMENT VARIABLES.

EXECUTION

JBASE_ERRMSG_TRACE

Controls whether or not to log jBASE messages to the $JBCRELEASEDIR/tmp/jbase_error_trace file.

JBASE_ERRMSG_ZERO_USED controls the behavior of jBC programs when an uninitialized variable is encountered
JBASE_ERRMSG_NON_NUMERIC controls the behavior of jBC programs when a numeric operation on a non-numeric variable is encountered
JBASE_ERRMSG_DIVIDE_ZERO controls the behavior of jBC programs when the divisor of an arithmetic division is zero
JBCBACKGROUND set to 1 to run "PORT" as background task
JEDIENABLEQ2Q set to 1 to force detection of Qptr to Qptr
JEDI_DISTRIB_DEFOPEN set to 1 to defer OPENs of distributed file parts
JEDI_SECURE_LEVEL set security level for j3 and jPLUS files
Level 1. No flush
Level 2. Flush on link modification (default)
Level 3. Flush after update (network failure)
JEDI_INDEX_MMAP_ON set to force use of memory mapping on indexes when updating memory mapped files
JBC_TCLRESTART set to command to execute instead of shell
JBC_ENDRESTART set to command to execute after end from debugger
JBCRESTARTPROG set to command to be executed after off (UNIX/Linux only)
JBCOBJECTLIST set to alternate path(s) for user subroutine libraries
Windows - %home%\lib
UNIX - $HOME/lib
JBC_BLOCK_SYSTEM14 set to 1 to force a 100 millisecond delay on SYSTEM(14) calls.

 

DEVELOPMENT

JBCDEV_BIN set to alternate path to catalog executables.
Windows - %home%\bin
UNIX - $HOME/bin
JBCDEV_LIB set to alternate path to catalog libraries.
Windows - %home%\lib
UNIX - $HOME/bin
JDIAG provides a variable amount of trace information
LIB specify additional paths for linking with libraries. (Windows only)
INCLUDE specify additional paths for header files

 

MISCELLANEOUS

JBASEUNIQUE specify alternate jBASE work file
JBCERRFILE specify alternate error message file
JBCSPOOLERDIR specify alternate spooler directory
JBCSPOOLER_JOBRESET controls how the print job counter is reset
JBC_DESPOOLSLEEP specify the interval for despoolers to check for queued jobs
JBC_INVERT_ALPHA_CHARS set to 1 to invert the case of alphabetic characters entered with INPUT.
JBC_OLD_SP_EDIT specifies the alternative SP-EDIT format
JBCLISTFILE specify alternate select list file
JBCLISTID force user account name to be part stored list ids.

 

TERMINAL

JBCECHO set to 1 to force echo on
JBCSCREEN_DEPTH specify alternate terminal depth (valid only on jBASE 3.x)
JBCSCREEN_WIDTH specify alternate terminal width (valid only on jBASE 3.x)
JBCPRINTER_DEPTH specify alternate printer depth (valid only on jBASE 3.x)
JBCPRINTER_WIDTH specify alternate printer width (valid only on jBASE 3.x)
JBCPRISM set hard coded prism sequences (Windows only)
JBC_STDERR set to 1 to redirect standard error to standard out. Useful for CAPTUREing output that would normally be sent to the screen.
JBCCREATEFLAGS set to 0, 1, 2 for output redirection. (Windows only)
0 Direct to current console (default)
1 Direct to new console
2 Detached for no console

 

EMBEDDED SQL

JBC_SQLLIBS set alternate SQL libraries for embedded SQL
JBC_SQLPREPROC set alternate SQL pre-compiler command
JBC_SQLFIXEDLEN set to use fixed length types for char input strings

 

QUERIES

JBCDEFDICTS specify alternate default dictionary files

 

CREATE-FILE

JEDI_PREFILEOP parameters take precedence before command line
JEDI_POSTFILEOP parameters take precedence after command line

e.g. To convert all files on a "jbackup" tape to J4 files set the following environment variable before using jrestore.
export JEDI_PREFILEOP=TYPE=J4 (UNIX) Can use quotes to surround multiple parameters
set JEDI_PREFILEOP=TYPE=J4 (NT) Don't use quotes

 

JRFS

JBCNETACCESS specify the location of the jRFS security access file
JBCNETDIR specify the location of the jRFS configuration files
JRFS_REMOTE_JQL set to 1 to allow jQL to be executed remotely
JRFS_LOCALPATH_JQL set to 1 to allow remote pointer to have a different name than the remote file
JRFS_SERVERNAME allows the jRFS client to override the service port
JRFS_HOSTNAME allows the jRFS client to override the target host

Porting