Previous Topic: OUTPUT Keyword OrderNext Topic: Global Editing


Global String Replacement

JCLNeat provides a global string replacement feature for any character string in the JCL.

Specify this type of string replacement in the GSRCNTL DD data set in the following format:

             Column Number 1
                           |from-string|verb|{JCL-type}
                           |to-string|

In the preceding example, the vertical bar (|) is the delimiter for the GSRCNTL parameters. The vertical bar allows you to change any text of a JCL statement, including a slash (/).

You can use the following verbs:

REPL

Replaces from-data with to-data

DELT

Deletes the JCL STATEMENT when JCLNeat finds from-data

REMV

Deletes the line where JCLNeat finds from-data

COMM

Comments the JCL STATEMENT when JCLNeat finds from-data

Important! When the string is found in the FIRST DD of a concatenated list, the entire concatenation list is commented or deleted.

When the string is found in the SECOND or subsequent DD of a concatenated list, only the current DD statement is commented or deleted.

INSA

Inserts to-data after the from-data line

INSB

Inserts to-data before the from-data line

JCLNeat compares the from-data of each record and if it finds a match, executes the verb using to-data (if applicable).

Note: The from-data can be up to 63 characters in length. The to-data can be up to 71 characters in length.

You can use the following JCL statement identifier:

JCL-type

JCL-type is an optional JCL statement identifier that limits the search for the from-string to the type of JCL specified. You can use the following JCL-types: CNTL, COMMAND, DD, DPROC, ELSE, ENDCNTL, ENDIF, EXEC, IF, INCLUDE, JCLLIB, JOB, NJB, OUTPUT, PEND, PRINTDEV, PROC, and SET.

Important! JCLNeat does not ensure the accuracy of your global string changes. We recommend that you also use CA JCLCheck to verify the accuracy of the changes. Misplaced or erroneous control cards can produce unexpected results.

Example: Change All the JCL in a PDS

This example shows how to change all the JCL in a PDS from MSGCLASS=A to MSGCLASS=X, and how to comment out old ddnames:

//GSRCNTL DD *
|MSGCLASS=A|REPL|
|MSGCLASS=X|
|DSN=SOME.BOGUS.DATASET|COMMENT|
|DSN=OTHER.BOGUS.DATASET|DELT|

The result is as follows:

INPUT JCL:

//JOBNAME JOB (ACCT),programmer,CLASS=X,
//   MSGCLASS=A
//STEP01 EXEC PGM=IEFBR14
//DD1 DD DSN=SOME.BOGUS.DATASET,DISP=SHR
//DD2 DD DSN=OTHER.BOGUS.DATASET,DISP=SHR
REFORMATTED JCL:  (JOBF=Y,FORMAT=Y)

//JOBNAME JOB (ACCT),
//            programmer,
//            CLASS=X
//            MSGCLASS=X
//STEP01 EXEC PGM=IEFBR14
//*DD1 DD DSN=SOME.BOGUS.DATASET,DISP=SHR

           OR (Optionally)

NON-REFORMATTED JCL:  (JOBF=N,FORMAT=N specified)

//JOBNAME JOB (ACCT),programmer,CLASS=X,
//   MSGCLASS=X
//STEP01 EXEC PGM=IEFBR14
//*DD1 DD DSN=SOME.BOGUS.DATASET,DISP=SHR

Example: Change All OUTPUT Statements

This example shows how to change CLASS=A to CLASS=B for OUTPUT statements only:

//GSRCNTL DD *
|CLASS=A|REPL|OUTPUT
|CLASS=B|

The result is as follows:

INPUT JCL:
//JOBNAME JOB (ACCT),programmer,CLASS=A,MSGCLASS=A
//STEP01 EXEC PGM=IEFBR14
//OUT001   OUTPUT CLASS=A
REFORMATTED JCL: (JOBF=Y,FORMAT=Y)

//JOBNAME  JOB (ACCT),
//             programmer,
//             CLASS=A,
//             MSGCLASS=A
//STEP01   EXEC PGM=IEFBR14
//OUT001   OUTPUT CLASS=B

           OR (Optionally)

NON-REFORMATTED JCL: (JOBF=N,FORMAT=N specified)

//JOBNAME JOB (ACCT),programmer,CLASS=A,MSGCLASS=A
//STEP01 EXEC PGM=IEFBR14
//OUT001   OUTPUT CLASS=B