Customizing PxPlus

Environment Variables

 

PxPlus maintains a set of OS-level environment variables that can be used to define and control various aspects of its current working environment. If your application requires changes from the default values, you can initialize the required environment variables (using OS-specific mechanisms) prior to launching PxPlus.

Note:
Only set environment variables if you absolutely need them. It is better programming practice to control these actions from inside the PxPlus environment than from outside (where possible).

The following environment variables can be manipulated and accessed for use in your PxPlus applications:

Variable

Description

LANG

Default language code. The PxPlus default is en (English).

Note:
The PVXLANG environment variable takes precedence over the LANG environment variable and is less likely to be used by the operating system or other applications.

PVX_CERTIFICATES

(Applicable to Client Connections Only)

Defines the default setting (IGNORE | VALIDATE | TRUSTREQD) for certificate validation.

IGNORE

Performs no validation of the certificate(s) presented by the server. (Default)

VALIDATE

Indicates that you want the certificate validated (expiry dates, etc.) but is not required to have been issued by a trusted supplier (i.e. it could be self-signed).

TRUSTREQD

Validates that the certificate came from a trusted vendor and that the certificate host name must match.

(PVX_CERTIFICATES functionality was added in PxPlus 2017.)

PVX_CERTSTORE

Defines the default certificate store. The default certificate store is the ca-bundle.crt file in the PxPlus install directory. The latest version of this file is downloaded from the following location: https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt.

(PVX_CERTSTORE functionality was added in PxPlus 2017.)

PVX_JOURNAL

During system start_up, the system checks to determine if this environment variable is defined. If it is defined, PxPlus will internally perform a SYSTEM_JRNL OPEN on the value in the environment variable and enable journalization on all files.

If the environment variable includes the ;LOCK suffix, journalization is enabled but the user is not allowed to close the journal file or to disable journalization either system wide or on specific files.

(PVX_JOURNAL functionality was added in PxPlus 2017.)

PVXEDIT

Name of editor used to maintain online program help information. (Defaults to vi for UNIX.)

PVXFID0

Value for FID(0). Many PxPlus applications use the logical device name of the terminal; i.e. file 0 (zero) as a unique identifier. Under Windows, the value for FID(0) defaults to T0 (T-zero) unless you override it by setting this environment variable.

To avoid the problem of duplicate FID(0) values in a Windows multi-user environment or network, this value must be different for each PC user. One of the simplest ways to uniquely identify each PC is to place a different SET PVXFID0=xx command in each AUTOEXEC.BAT. xx is the value for FID(0).

On systems that support NetBIOS, another solution is to use the system variable NID (which contains the network station name) or UID (user ID) as a key to a file that contains one record for each station. The record in the file contains the FID(0) value that your START_UP passes to the SETFID directive.

In the following example, START_UP using NetBIOS node name for FID(0), terminates if the NID is not on file:

Example:

0010 ! START_UP - xxxxx 
...... 
0100 X=HFN; OPEN (X) "Z:\PVXAPP\DATA\FIDFILE"
0110 READ (X,KEY=NID,DOM=0190) F$
0120 SETFID F$
0130 CLOSE (X)
......
0190 PRINT 'CS','RB',"System restricted!!"
0200 WAIT 2; CLOSE(X)
0210 QUIT

Note:
PxPlus does not require unique FID(0) values. Only applications that were originally designed to have unique FID(0) values need change or control the FID(0).

PVXFLMAP

File name change map. Use this when migrating files from one host environment to another, to translate invalid filename characters to valid ones for the new environment.

To create a map, use one or more two-character codes as values. The first is the filename character as it appears in your program; the second is the character PxPlus will pass to the OS as a substitute. For example, in UNIX, the file name \\AB\\ is valid, but to Windows, the backslash is a directory delimiter.

To translate the file name to a valid Windows file name:

SET PVXFLMAP=\_
1000 OPEN(1)"\\AB\\" REM would open "AB"

PVXINI

(Windows Only)

Location of the PxPlus INI file.

PVXKEY

Location of the PxPlus KEYS directory.

PVXLANG

Similar to the LANG environment variable except that the PVXLANG environment variable takes precedence over the LANG environment variable and is less likely to be used by the operating system or other applications.

PVXLIB

Location of PVX Plus library directory. By default, PxPlus searches for its libraries in the directory where the PXPLUS.EXE program is located.

Note:
The library must have the name LIB.

You can override the location of the library by adding the following directive to your AUTOEXEC.BAT or to a PxPlus start-up batch file:

SET PVXLIB=path

Where:

path
is the path to your directory containing the PxPlus library. However, if PxPlus cannot locate the library, it will not start. Instead, it generates Error #100 - No driver for terminal type or library missing.

PVXLS

(UNIX/Linux Only)

ls command. To read a directory under UNIX/Linux, PxPlus internally uses an ls -a command. Output from this OS command is parsed, and a file name list is built from this output.

Only set if your OS does not have an ls -a command in this case, set it to whatever command the operating system has that matches the output of an ls -a command on a typical UNIX/Linux system.

PVXPDFFONTDIR

Path location of the font directory for use with *PDF* in UNIX/Linux versions of PxPlus.

This variable is not required for Windows; however, it may be used to resolve some situations where PxPlus is unable to find the default font directory.

PVXSTART

Path and file name of initialization file to be used in place of the default START_UP. See START_UP Initialization Program.

PVXTMP

Name of the directory where temporary files will be placed. (Default is the current directory.)

PXP_CRYPTO_LIB

Path and file name of an OpenSSL crypto dynamic library (libcrypto-1.1.dll/libcrypto.so). OpenSSL provides SSL and encryption support to PxPlus.

Setting this overrides the default OS library search rules and explicitly sets which library to load.

(PXP_CRYPTO_LIB functionality was added in PxPlus 2020.)

PXP_CS_OPT

This environment variable can be set on the host to define any number of semi-colon separated options that will be added to the option specified on the host Command line.

See PxPlus Simple Client-Server Interface.

(PXP_CS_OPT functionality was added in PxPlus 2016.)

PXP_CS_OPT_CLIENT

This environment variable can be set on the workstation (client) to define any number of semi-colon separated options that will be added to the option specified on the client Command line.

See PxPlus Simple Client-Server Interface.

(PXP_CS_OPT_CLIENT functionality was added in PxPlus 2016.)

PXP_LOGFILE

This environment variable can be set on the workstation (client) to define the path of the log file that will be used by the NOMADS Run-Time Events Logging tool.

(PXP_LOGFILE functionality was added in PxPlus 2017.)

PXP_SSL_LIB

Path and file name of an OpenSSL SSL dynamic library (libssl-1.1.dll/libssl.so). OpenSSL provides SSL and encryption support to PxPlus.

Setting this overrides the default OS library search rules and explicitly sets which library to load.

(PXP_SSL_LIB functionality was added in PxPlus 2020.)

PXPSPAWN_CMD

Can be set to either NOHUP or SETSID to force its use when spawning a UNIX/Linux version of PxPlus.

(PXPSPAWN_CMD functionality was added in PxPlus 2017.)

TERM

(UNIX Only)

Terminal type. This environment variable is normally set automatically by your UNIX/Linux operating system and matches the type of terminal you are using such as Ansi, WYSE60, Linux, and so on.

PxPlus uses the current value of the TERM environment variable to determine which PxPlus device driver is in the *dev directory and which keyboard map to LOAD/RUN during initialization.

USER

(Only if No OS User ID Set)

User ID. To establish a user name to make applications work properly, create and/or modify a .BAT file to include the directive:

SET USER=userID

Where:

userID
is the user's name. The PxPlus system variables UID and WHO return whatever value is in the USER environment variable or an * (asterisk) when this variable is not set.

WDXTRUST

(WindX Only)

This environment variable can be set on the workstation (client) to define any number of trusted servers (semi-colon separated) to which WindX Security will allow full access to the workstation files and programs without requesting user authorization.

The server name or IP address defined in this variable must match the server name or address used in the WindX Connection Manager. Entries in this variable are case insensitive.

If this variable is set and WindX connects to a server not in the list of trusted servers, WindX security will deny that server all access to the workstation files and programs.

Example:

WDXTRUST=server1;192.168.1.34

In this example, when WindX connects to either "server1" or "192.168.1.34", WindX security will allow only these servers full access to the workstation files and programs.

(WDXTRUST functionality was added in PxPlus 2017.)