Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

Introduction to Environment Variables



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.


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.


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



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.


PATHpathnames of executables
HOMEpathname of user home directory. Many defaults rely on this environment variable
LD_LIBRARY_PATHpathnames of system libraries (Linux, Solaris only)
LIBPATHpathnames of system libraries (AIX only)
LANGlanguage type (UNIX only)
JBASE_LOCALEsetting to determine collation sequences for internationalization and secondary indexes (jBASE 5.2 and above)
JBASE_TIMEZONEsetting to determine the timezone to use for UTF8 timestamp conversion into local time for display (jBASE 5.2 and above)
JBASE_DATE_FORMATspecifies the format of how dates are converted to/from internal and external date representations
TZtimezone (UNIX only)
LC_ALLwill override a specified list of locale settings (UNIX only)
TERMspecifies terminal type as per terminfo database
TERMINFOspecifies directory for terminal settings
JBCPORTNOforced Port number for use by user; automatically allocated unless this is set
JBCLOGNAMEuser name to use in-place of login id
JBCGLOBALDIRpathname of jBASE global configuration directory
JBCRELEASEDIRpathname of jBASE release directory
JBCDATADIRpathname of any configured databases and default directory for the jBASE spooler
JBCEMULATEemulation to be used for this user
JEDIFILEPATHdirectory Paths of application files location
JEDIFILENAME_MDpathname of file to be used for Master Dictionary entries
JEDIFILENAME_SYSTEMpathname of file to be used for SYSTEM entries





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

JBASE_ERRMSG_ZERO_USEDcontrols the behavior of jBC programs when an uninitialized variable is encountered
JBASE_ERRMSG_NON_NUMERICcontrols the behavior of jBC programs when a numeric operation on a non-numeric variable is encountered
JBASE_ERRMSG_DIVIDE_ZEROcontrols the behavior of jBC programs when the divisor of an arithmetic division is zero
JBCBACKGROUNDset to 1 to run "PORT" as background task
JEDIENABLEQ2Qset to 1 to force detection of Qptr to Qptr
JEDI_DISTRIB_DEFOPENset to 1 to defer OPENs of distributed file parts
JEDI_SECURE_LEVELset 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_ONset to force use of memory mapping on indexes when updating memory mapped files
JBC_TCLRESTARTset to command to execute instead of shell
JBC_ENDRESTARTset to command to execute after end from debugger
JBCRESTARTPROGset to command to be executed after off (UNIX/Linux only)
JBCOBJECTLISTset to alternate path(s) for user subroutine libraries
Windows - %home%\lib
UNIX - $HOME/lib
JBC_BLOCK_SYSTEM14set to 1 to force a 100 millisecond delay on SYSTEM(14) calls.



JBCDEV_BINset to alternate path to catalog executables.
Windows - %home%\bin
UNIX - $HOME/bin
JBCDEV_LIBset to alternate path to catalog libraries.
Windows - %home%\lib
UNIX - $HOME/bin
JDIAGprovides a variable amount of trace information
LIBspecify additional paths for linking with libraries. (Windows only)
INCLUDEspecify additional paths for header files



JBASEUNIQUEspecify alternate jBASE work file
JBCERRFILEspecify alternate error message file
JBCSPOOLERDIRspecify alternate spooler directory
JBCSPOOLER_JOBRESETcontrols how the print job counter is reset
JBC_DESPOOLSLEEPspecify the interval for despoolers to check for queued jobs
JBC_INVERT_ALPHA_CHARSset to 1 to invert the case of alphabetic characters entered with INPUT.
JBC_OLD_SP_EDITspecifies the alternative SP-EDIT format
JBCLISTFILEspecify alternate select list file
JBCLISTIDforce user account name to be part stored list ids.



JBCECHOset to 1 to force echo on
JBCSCREEN_DEPTHspecify alternate terminal depth (valid only on jBASE 3.x)
JBCSCREEN_WIDTHspecify alternate terminal width (valid only on jBASE 3.x)
JBCPRINTER_DEPTHspecify alternate printer depth (valid only on jBASE 3.x)
JBCPRINTER_WIDTHspecify alternate printer width (valid only on jBASE 3.x)
JBCPRISMset hard coded prism sequences (Windows only)
JBC_STDERRset to 1 to redirect standard error to standard out. Useful for CAPTUREing output that would normally be sent to the screen.
JBCCREATEFLAGSset 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



JBC_SQLLIBSset alternate SQL libraries for embedded SQL
JBC_SQLPREPROCset alternate SQL pre-compiler command
JBC_SQLFIXEDLENset to use fixed length types for char input strings



JBCDEFDICTSspecify alternate default dictionary files



JEDI_PREFILEOPparameters take precedence before command line
JEDI_POSTFILEOPparameters 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



JBCNETACCESSspecify the location of the jRFS security access file
JBCNETDIRspecify the location of the jRFS configuration files
JRFS_REMOTE_JQLset to 1 to allow jQL to be executed remotely
JRFS_LOCALPATH_JQLset to 1 to allow remote pointer to have a different name than the remote file
JRFS_SERVERNAMEallows the jRFS client to override the service port
JRFS_HOSTNAMEallows the jRFS client to override the target host

Was this article helpful?