CRE Programmer's Guide
Using the Common Language Utility (CLU) Library
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
5-9
Using the environ Array
Deleting Environment Information
You can use the Delete subset of SMU functions to delete entire ASSIGN, PARAM,
and startup messages. You can also delete parts of ASSIGN and PARAM messages.
You cannot, however, delete parts of the startup message. Instead, you can use
SMU_Startup_PutText_ to assign null values to startup message parts, thereby
achieving the same effect as deleting the parts.
Using the environ Array
In the OSS environment, a process can access information in an array called
environ. Such information is provided by the OSS file system.
In both the OSS and Guardian environments, C programs use the
getenv() and
putenv() functions to access the environ array. TAL and pTAL programs can use
the CRE_Getenv_ and CRE_Putenv_ routines to access the
environ array. COBOL
saves messages only if you use the compiler SAVE directive. To access saved images
of messages generated by TACL in the Guardian environment, use the Saved
Message Utility (SMU).
In the Guardian environment, the CRE stores information in an array called
environ if
either of the following conditions are true:
•
The value of the SAVE-ENVIRONMENT PARAM is ON when the process starts
•
The process’s main routine is written in C and the value of the
SAVE-ENVIRONMENT PARAM is ON or the SAVE-ENVIRONMENT PARAM is not
specified
If the value of the SAVE-ENVIRONMENT PARAM is OFF when the process starts, the
CRE does not store environment information in the
environ array.
To access information in the
environ array from a program whose main routine is not
written in C, you must enter the following TACL command before you run your
program:
PARAM SAVE-ENVIRONMENT ON
The first four entries in the environ array are:
In addition to these four entries, the
environ array contains the names and values of
all parameters (PARAMs) in your environment when your process starts.
"STDIN" Gives the file name of the standard input file, stdin.
"STDOUT" Gives the file name of the standard output file, stdout.
"STDERR" Gives the file name of the standard error file, stderr.
“DEFAULTS" Gives the default volume and subvolume names used to qualify
partial file names.