Environment Variables


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

Win9x variables are usually configured in the AutoExec.bat. Care should be taken that the environment area does not become overwritten on Win9x as it is initially quite small, approximately 512 bytes. Subsequent .bat commands should increase the required environment space. The environment space can be explicitly increased by setting it in the config.sys file:
shell=c:\command.com /e:2048 /p

 

UNIX

variable=value
export variable
echo $variable

This works for all shells, although one can do "export variable=value" in ksh,etc.

Variables are usually configured in the .profile of the user login directory. Although 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:

IF PUTENV(envar=x) THEN ELSE NULL
IF GETENV(envar) THEN ELSE NULL

 

 

jBASE INITIALIZATION

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

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 by either the jPML demon on Unix or the jPML files on Windows. 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.

 

Unix

jBASE initialization on Unix is usually performed in the .profile, via the script commands:

JBCCONNECT="jbcconnect"
export JBCCONNECT

This produces a connect string which is used to reference the port state information. If process executes an "OFF" then either "jbcconnect" needs to be re-executed via the command line or .profile on Unix or execute a jBASE program or jsh on Windows.

 

Windows

jBASE initialization on Windows usually occurs when the first jBASE program executes. e.g. jsh. This produces a JBCWINCONNECT variable which points to the allocated port state file.

It is important to create environment variables prior to jBASE initialization as some variables cannot be imported again after jBASE initialization.

 

 

INITIAL ENVIRONMENT VARIABLES

PATH pathnames of executables
HOME pathname of user home directory
LD_LIBRARY_PATH pathnames of system libraries (Unix only: Linux, Solaris, SCO)
LIBPATH pathnames of system libraries (AIX only )
SHLIB_PATH pathnames of system libraries (HPUX only)
LANG language type (Unix only)
TERM specifies terminal type as per terminfo database
JBC_BASENAME specifies the license to use when multiple jBASE licenses are installed
JBC_RESERVE_PORTNO set automatically for background sessions on Unix
JBCPORTNO forced Port number for use by user. ( Usually allocated )
JBCLOGNAME user name to use in-place of login id
JBCGLOBALDIR pathname of jBASE global configuration directory
JBCRELEASEDIR pathname of jBASE release directory
JBCEMULATE emulation to be used for this user
JEDIFILEPATH directory Paths of application files location
JEDIFILENAME_MD pathname of file to be used for MD entries
JEDIFILENAME_SYSTEM pathname of file to be used for SYSTEM entries

 

 

ADDITIONAL jBASE ENVIRONMENT VARIABLES.

 

EXECUTION

JBASE_WARNLEVEL Controls the behavior of jBC programs when run time errors occur
JBCNOINTERNAL set to force external command execution
JBCNOINTERNAL_RUN forces external execution of the RUN command
JBCBACKGROUND set to 1 to run "PORT" as background task
JBCRUNDIR set to executable directory for RUN command
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 files
Level 1. No flush
Level 2. Flush on link modification
Level 3. Flush after update, default. ( Network failure )
Level 4. Strategic Flush on update. ( O/S failure )
JEDI_INDEX_MMAP_ON set to force use of memory mapping on indexes when updating memory mapped files
JEDI_AIX_FILE_MMAP_ON set to force use of memory mapping of j4 files on AIX multi-processor machines
JEDI_AIX_OBJECT_MMAP_ON set to force use of memory mapping of .el files on AIX multi-processor machines
JEDI_OBJECT_MMAP_OFF turn off memory mapping of .el 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 execute 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
JBCDEBUGGER set to 1 to force entry into debugger.
JBCPROFILE set to 1 to force profiler on.
JBC_COMPILER_COUNT limits the number of concurrent executions of cc on Unix platforms
JBCTTYNAME specify alternate tty name for output. (Unix only)
LIB specify additional paths for linking with libraries. ( NT only)
INCLUDE specify additional paths for header files
JPQDEBUG set to 1 for PROC to enter "DEBUG" at IP input

 

MISCELLANEOUS

JBCBASETMP specify alternate jBASE work file
JBC_BELLCTRLCHR set to 1 to prevent INPUT of control characters
JBCLKFILE specify alternate lock 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_CRREQ controls linefeeds, formfeeds and carriage returns in print 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
JBCSCREEN_WIDTH specify alternate terminal width
JBCPRINTER_DEPTH specify alternate printer depth
JBCPRINTER_WIDTH specify alternate printer width
JBCFLUSH_STDOUT set to 1 to force flushing output
JBCPRISM set hard coded prism sequences (NT 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. (NT 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
JBCIDLEN specify alternate default record id display length
JBC_JQLPRIORITY set the priority at which jQL statements run

 

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 "jbackup" tape to J4 files set the following environment variable be 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_CHK_REMOTE set to 1 to allow SELECT to be executed remotely
JRFS_SERVERNAME allows the jRFS client to override the service port
JRFS_HOSTNAME allows the jRFS client to override the target host

Porting