:JCL_SUBSTITUTE

Use the :JCL_SUBSTITUTE script statement to replace any string in the Job Control Language (JCL) during the generation of a job. The number of characters in the Old String and the New String can vary. You can also replace a single character. :JCL_SUBSTITUTE replaces the specified strings starting with the line that includes the script statement. The strings are replaced until the line of the script is reached, where the script statement is called again. It does not matter if it is called with or without parameters.

Important! (z/OS only) This script statement is used, for example, to handle specific requirements of the z/OS JCL, which require the ampersand (&) character to be used. Therefore, problems may occur because this character is used for definitions of script variables in AE.

Syntax

:JCL_SUBSTITUTE [Old String, New String]

Parameters

  • :JCL_SUBSTITUTE
    Replaces a string with another one
  • Old String
    String to be replaced
    Format: script literal or script variable
  • New String
    String that should replace the Old String
    Format: script literal or script variable

Example

The following example replaces the "$" character with the "&" character.

:JCL_SUBSTITUTE "$", "&" 
REPORTS=($REP)
SORT=TIME

:
JCL_SUBSTITUTE 
RANGE=$RAN

The generated job now contains the following lines:

REPORTS=(&REP)
SORT=TIME
RANGE=$RAN

See also: