You can specify environment variables to define the local environment where the script, command, or the batch file runs. You can modify existing environment variables or create your own.
Note: When passing multiple environment variables to an agent, the maximum size allowed is 4 KB.
Follow these steps:
The Application appears in the workspace.
The Basic page of the job definition dialog opens.
The Environment Variables page opens in the right pane.
A new row is added to the Environment variables table.
Defines the name of a new environment variable or specifies the name of an existing environment variable.
Note: The agent does not support spaces in environment variable names.
Specifies a value for the environment variable.
Note: If the value contains spaces, commas, quotes, double quotes, equal signs, open brackets, or close brackets, enclose the value in double quotes. To specify a double quote in a value, precede the double quote with another double quote.
The server passes the name and value of each environment variable to the script, command, or batch file when the job runs.
Example: Specify Alternative Input and Output Sources
The following table lists the input and output streams that all UNIX programs run by a shell are connected to:
|
Stream |
Default Source |
Environment Variable |
|---|---|---|
|
Standard input stream |
Keyboard |
STDIN |
|
Standard output stream |
Screen |
STDOUT |
|
Standard error output stream |
Screen |
STDERR |
To specify alternative input and output sources
A new row is added to the Environment variables table.
A new row is added to the Environment variables table.
A new row is added to the Environment variables table.
The alternative input and output sources are specified.
Example: Specify Environment Variables as Part of the Variable Value
Suppose that the output of a job is written to a file named JOB_OUTPUT located in the path specified by the MY_FILES environment variable.
For this example, enter STDOUT in the Name field and $MY_FILES/JOB_OUTPUT in the Value field.
Example: Set an Environment Variable to an Empty Value
To set an environment variable to an empty value, you can enter two quotes without spaces (““) in the Value field.
Suppose that a job runs a script under the user ID jdoe. The script uses an environment variable named VAR1, which is set in the profile file for jdoe. The server passes VAR1 and its empty value to the script.
For this example, enter VAR1 in the Name field and ““ in the Value field.
Example: Set Environment Variables in a PeopleSoft Job
Suppose that you want to set environment variables in a PeopleSoft job. In this example, the location of the PeopleSoft PeopleTools executables (TOOLBIN) and path to the database drivers (DBBIN) are set.
Note: To specify the PeopleSoft home directory (%PS_HOME%), you must escape the percent signs (%) by doubling them. Otherwise, the value is treated as a symbolic variable.
The environment variables are specified for the PeopleSoft job.
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|