Skip to content

Environment Variables

Thoroughbred Basic under UNIX or TS Environment for Windows enables you to specify environment variables in the IPL file. Environment variables are appropriately changed or expanded when Thoroughbred Basic or TS Environment starts.

Specify an environment variable by placing a $ in front of the name of the variable defined in the operating system. Environment variables names are case sensitive. For example, the Microsoft Windows windir environment variable is usually specified as windir=C:\WINDOWS. To specify the environment variable in the IPL file, type $windir.

An invalid environment variable name specification in the IPL file will be removed. For example, if $WIN2DOOR is specified in the IPL file but WIN2DOOR is not an environment variable, the $WIN2DOOR specification will be removed when Thoroughbred Basic or TS Environment starts.

To display active environment variables under UNIX or Microsoft Windows, use the set command. Under Microsoft Windows, you can issue this command in the Command Prompt or Terminal window.

Examples of environment variable specification

Section titled “Examples of environment variable specification”

Example of valid environment variable specification:

Given the following environment variable:

STARTPRG=INITWORK

And the following statement in an IPL file:

IPL 1,2,T0,$STARTPRG

The statement is changed to the following when Thoroughbred Basic or TS Environment starts:

IPL 1,2,T0,INITWORK

Example of invalid variable specification:

Given the following statement in an IPL file:

IPL 1,2,T0,$STARTPRG

If the STARTPRG environment variable name is invalid, the statement is changed to the following when Thoroughbred Basic or TS Environment starts:

IPL 1,2,T0,

Example for TS Environment:

Given the following environment variable:

windir=C:\WINDOWS

And the following statement in an IPL file:

DEV D0,1,,,,,,$windir

The statement is changed to the following when Thoroughbred Basic or TS Environment starts:

DEV D0,1,,,,,,C:\WINDOWS

Example for UNIX:

A UNIX $ variable is a portion of a line to the left of the = sign, from the UNIX env command, followed by a $.

For example, given the following env:

=bin/env
HOME=/user/scott
PWD=/usr/lib/basic
SHELL=/bin/ksh
MAIL=/usr/mail/scott
EDITOR=vi
LOGNAME=scott
LPDEST=local
PS2=<continued>
PS1=! hp840 $PWD $
TERM=wy60
PATH=:/usr/lbin:/bin:/usr/bin:/user/scott:.
TZ=EST5EDT

Diagram: NOTE: The UNIX Time Zone information will be used if there is no TZ environment variable.

And the following IPL file:

CNF 1,8,1,45
PTN 1,200000
PRM LONGVAR
PRMIF47
PRM UPPER
PRM SYSTEM=$SHELL
DEV D0,1,,,,,,$PWD/UTILS
IPL 1,2,T0
END

The IPL file expands to the following when Thoroughbred Basic starts:

CNF 1,8,1,45
PTN 1,200000
PRM LONGVAR
PRM IF47
PRM UPPER
PRM SYSTEM=/bin/ksh
DEV D0,1,,,,,,/usr/lib/basic/UTILS
IPL 1,2,T0
END

From the Customization and Tuning Guide: System Files, version 8.9.1. Open this page in the PDF