Editing Master JCL and Natural Sources

This section provides information on editing JCL and Natural source objects.

By editing the master JCL, you change the master definition that affects each future executed active job.

Before writing the file back, the editor creates a backup copy of the edited file.

This document covers the following topics:

Related Topics:


General Editing Considerations

This section covers the following topics:

Automatic Logon to the Operating System Server

Before JCL is edited, Entire Operations checks whether the user may access the JCL file. If it is an operating system file, then an automatic logon with the defined JCL user ID (BS2000 and UNIX and Windows) is performed, if required. If this automatic logon fails (e.g., if a password is required), an appropriate message is displayed. In this case, the user must first logon to the corresponding operating system server.

Logon to a Node

While editing the master JCL, an implicit logon is triggered to establish the connection to the required node. The logon is not prompted if you have already logged on to this node within this session.

For further information, see the logon function described in the section Using Entire Operations GUI Client.

Windows: File Names

File names in Windows can be written in an alternative notation if the backslash character (\) is not available, like in mainframe environments. See File Names in Job Control for Jobs under Windows in the section System Overview.

UNIX and Windows: Text Files

If a file to be edited or loaded as JCL is not a text file, the error message EOR0325 - No Text File is returned. For JCL loading, this is treated as a permanent error.

UNIX: Usage of Profile Scripts

Entire Operations determines usage of profiles in non-login UNIX scripts (as they are submitted by Entire Operations) during submission of the shell script as described in the following section:

  • The Entire Operations Monitor checks whether the symbol ETC-PROFILE exists in the symbol table of the active job, or in another symbol table in the standard symbol search hierarchy, up to SYSDBA/A.

    • If the symbol ETC-PROFILE is found and if it contains the value Y, the frame script (job.current.sh) sources the profile script(s) executed in the currently running shell (other scripts are not sourced). These scripts are retrieved from /etc/profile and /etc/profile.local.

    • The user script (job.current.frame.sh) locates the environment variables of the profile script being set.

  • The Entire Operations Monitor checks whether the symbol ENV exists in the symbol table of the active job, or in another symbol table in the standard symbol search hierarchy, up to SYSDBA/A.

    • If the symbol ENV is found and contains a value, its content is assumed to be a profile script like $HOME/.profile.

    • If a profile script exists, its name is assigned to the environment variables ENV and BASH_ENV by the frame script (job.current.sh).

    • The frame script (job.current.frame.sh) sources the profile script.

    • The user script (job.current.sh) locates the environment variables of the profile script being set.

For more information on ETC-PROFILE and ENV, see the section Reserved Symbols for Profile Scripts (UNIX).

Notes:

  1. Several profile scripts can be sourced sequentially if the symbol ETC-PROFILE contains the value Y and if the symbol ENV contains the name of a profile script.
  2. The user is responsible to make the used profile scripts proof against multiple execution, e.g., by using the PROFILEREAD variable like in Linux.

z/OS: JES2 /* ROUTE Statement

If a z/OS JES2 JCL contains a statement

/* ROUTE XEQ target

the job executes on the target target machine.

As long as the SYSOUT is passed back to the submission machine, the running job is not accessible. Entire Operations detects a rerouting, and behaves differently for such jobs.

For rerouted z/OS jobs, some features do not work, for example:

  • Direct execution tracking.

  • Browsing of SYSOUT while the job is executing.

  • Cancelling.

However, if SYSOUT is available again, all End-of-Job checking and End-of-Job actions can be performed.

UNIX and Windows: Handling of Tab Characters (H'09') within JCL Lines

  • If a master or active JCL is edited, each tab character is converted to a single blank before the editing. This prevents strange effects during editing. The JCL is written back without tab characters in any case.

  • Extended logging, JCL logging: for the extended logging of JCL tab characters are also converted to blanks.

  • If Entire Operations is running on a mainframe, the middleware translation tables convert tab characters to blanks anyway. This means that each UNIX and Windows JCL is submitted without tab characters.

  • If Entire Operations is running on UNIX or Windows, tab characters remain in master and active JCL, as long as the master or active JCL is not edited from within Entire Operations.

Starting an Edit Session

This section describes how to edit JCL and Natural sources including user exits.

Start of instruction set To edit JCL of a standard operating system job or a Natural source

  1. In the object workspace, select a Job Master instance and choose Edit Master JCL or Edit Active JCL from the context menu.

    Or:
    On the JCL Definition page in the Maintenance Job Master or Maintenance Job Active window, choose Edit (see also Functions: Master JCL Definition).

    An Edit window similar to the following examples opens.

    (If the source of the specified JCL member does not yet exist, the Edit window is empty.)

  2. Edit the source as required.

    You can use the editor functions provided in the context menu of the Edit window (or the toolbar of the main application window) to find and change text, navigate in the source or perform special functions for macro sources. See Available Functions: Edit Window and Handling Macro Sources for Dynamic JCL Generation.

  3. When you are finished, choose Save from the toolbar or Object menu to save any changes.

Start of instruction set To edit the source of a user exit

  1. In the object workspace, select a Job Master instance and open the Input Conditions page.

    Select an input condition of the type Exit.

    Choose Edit.

    Or:
    In the object workspace, select a Job Master instance and open the EOJ Checking page.

    Select an action user exit (indicated by an X in the Action column) or a checking user exit and choose Edit Action Exit or Edit User Exit, respectively.

    An Edit window similar to the following opens:

    graphics/edit_user_exit.png

    (If the source of the selected user exit has not yet been created and cataloged, the Edit window only contains an incomplete DEFINE sample statement.)

  2. Edit the source as required.

    In order to use a user exit, it must be saved and cataloged as a Natural object in a Natural library.

    For information on coding action user exits, see also User Exits for End-of-Job Checking and Actions in the section User Exits.

    You can use the editor functions provided in the context menu of the Edit window (or the toolbar of the main application window) to find and change text, navigate in the source or perform special functions for macro sources. See Available Functions: Edit Window.

This section covers the following topics:

Available Functions: Edit Window

The following functions are provided from the context menu in an Edit window or the toolbar in the main application window:

Function Shortcut Description
Undo CTRL+Z Undo the last action.
Redo CTRL+Y Redo the last action.
Cut CTRL+X Cut the selected text string to the clipboard.
Copy CTRL+C Copy the selected text string to the clipboard.
Paste CTRL+V Paste the text string previously cut or copied to the clipboard.
Delete DELETE Delete the selected text string.
Select All CTRL+A Select the whole text contained in the Edit window.
Upper CTRL+SHIFT+U Convert the selected text string to uppercase letters.
Lower CTRL+SHIFT+L Convert the selected text string to lowercase letters.
Find CTRL+F Open the Find dialog to enter a search string and specify search options (case-sensitive and/or whole word only) and the search direction backward (scrolls up in the source) or forward (scrolls down in the source).

By default, the currently selected text string is entered in the Find dialog.

Find Next F3 Find the next occurrence of the search string specified in the Find dialog.
Replace CTRL+H Open the Replace dialog to enter a Find search string and a Replace text string and specify search options and the search directory as described for the Find dialog.

By default, the currently selected text string is entered in the Find dialog.

Replace Next CTRL+F3 Replace the next occurrence of the search string specified in the Replace dialog.
Go To CTRL+G Open the Go To dialog to place the cursor on the source line entered in the dialog.
Toggle ruler CTRL+R Show or hide a vertical ruler at the top of the editor window as shown in a previous example.

If you want to switch on the ruler display by default, set the corresponding option in your user profile: see GUI General in the Administration documentation.

Print CTRL+P Output the text on a printer.
Check --- Applies to Natural sources only.

Check the syntax of the source.

Catalog --- Applies to Natural sources only.

Catalog the source.

Stow --- Applies to Natural sources only.

Check the syntax and catalog the source.

Macro --- Applies to macro sources only.

See Special Editor Functions for Macro Sources.

Test --- Applies to macro sources only.

See Special Editor Functions for Macro Sources.

Handling Macro Sources for Dynamic JCL Generation

Jobs with the JCL location Macro Natural source (MAC) use the edit macro function of Entire Operations, which allows the use of variables anywhere in the JCL. Dynamic generation of JCL refers to the automatic substitution of these variables with their current values either when the job network is activated or when the job is submitted. The same job can thus have different JCL for different activation.

The Macro editor function must be used to generate the final JCL. The Test editor function can be used to test the generated JCL.

This section covers the following topics:

Special Editor Functions for Macro Sources

The following special editor functions are available for a macro source:

Function Description
Macro Compile the macro JCL into an executable Natural object. This object is executed by Entire Operations during JCL load. It generates the executable active JCL. (This command is similar to the STOW command used for standard Natural programs.)

Note:
The Macro function can be executed in batch mode, e.g., for whole networks.

See also Bulk Execution of MACRO Commands.

Test Generate JCL for testing purposes. The generated JCL is displayed in a new window.

Notes:

  1. The macro source is not saved during execution of the Macro function.
  2. The generated object is not compiled with the Natural STOW command during execution of the Test function. Since no changes are made to the original macro source and the existing generated object, the TEST command can also be performed by users who have read access only for the macro source.
Run Number used for the Test Function

The reserved run number used during the Test function is -3. During Test, a temporary active symbol table with this run number is used. This avoids any influence on the defined master symbol table. In the log display, this reserved run number is not displayed.

Escape Character for Natural Source Lines

Natural source lines must be preceded by the activation escape character of the job (see Symbol Escape Characters in the section Symbol Table and Symbol Maintenance).

The activation escape character at the beginning of a line distinguishes the line as a Natural statement from the JCL. The use of Natural statements provides full Natural functionality in dynamic JCL, including access to Adabas and Entire System Server. This means you do not need to learn any special control statements. All Natural statements used in dynamic JCL must be coded in structured mode.

Variables are user-defined and can be used in any part of the JCL. Variables are distinguished in the JCL by preceding them with an escape character: the activation escape character denotes variables to be substituted at activation time; the submission escape character denotes variables to be substituted at job submission time (see Symbol Escape Characters in the section Symbol Table and Symbol Maintenance).

Note:
These escape characters can be changed by the system administrator. However, this should only be done if absolutely necessary, for example for countries with a different alphabet. It is not advisable to use escape characters which have a defined meaning in a particular operating system or which are already defined as escape characters, e.g., $ in BS2000 or UNIX.

Parameter List

Each JCL for a job with the JCL location Macro Natural source (MAC) must start with the declaration of the common user exit parameter list NOPXPL-A:

§ DEFINE DATA PARAMETER USING NOPXPL-A

where the first character (here: §) is the activation escape character of the job.

The P-CALL-PLACE parameter in NOPXPL-A contains the value MAC.

See also Common User Exit Parameter Data Area NOPXPL-A and User Exit Types, P-CALL-PLACE in the section User Exits.

Variables in Dynamically Generated JCL

You can use four types of variables:

  • A variable from the symbol table specified for the job;

  • A variable from the parameter section (P-...);

  • A local variable defined in this Natural program, which can be computed in your program (L-...);

  • A Natural system variable (TIME, DATE, etc.) which is distinguished by an asterisk (*), for example, *TIME and *DATE.

Note:
All variables with prefixes other than P-, L- or * are assumed to be found in the symbol table. Symbol replacement itself (without embedding Natural statements) is also available for standard JCL (JOB (Standard Job) type jobs). See Symbol Replacement in the section Symbol Table and Symbol Maintenance.

This section covers the following topics:

Sample JCL

The following sample JCL illustrates the use of variables in the dynamically generated JCL of a job with JCL location Macro Natural source (MAC):

§ DEFINE DATA PARAMETER USING NOPXPL-A
§ LOCAL    /* ... ALL LOCALS SHOULD START WITH 'L-'
§ 1 L-01    (A30)
§ 1 CLASS   (A01)     /* FROM SYMBOL TABLE, FOR #GET-SYMBOL
§ END-DEFINE
§ * ------------------------------------
#GET-SYMBOL CLASS
§ COMPRESS P-NETWORK P-JOB INTO L-01
//SNNOPEX  JOB  ,§P-OWNER,MSGCLASS=§MSGCLASS,CLASS=§CLASS
//STEP01   EXEC PGM=NOPCONTI,PARM='C=0004'
//STEPLIB  DD   DISP=SHR,DSN=§STEPLIB
//* DEVICE: §*DEVICE, INIT-USER: §*INIT-USER, TIME: §*TIME
//* L-01  : §L-01
§ IF CLASS = 'K'      /* SYMBOL USED IN STATEMENT -> #GET-SYMBOL
//* THE CLASS IS §CLASS
§ ELSE
//* ANOTHER MSGCLASS FOUND
§ END-IF
//*

The variables used in the JCL are assumed to have the following current values:

Symbol Table Variables
STEPLIB NOP.SYSF.DEV.LOAD
CLASS K
MSGCLASS X
Natural System Variables
*DEVICE BATCH
*INIT-USER  EORMON
Variables from the Parameter Section
P-NETWORK EX131A
P-JOB  EX-1-24
P-OWNER  SN

When the job is activated, Entire Operations substitutes the variables with their current values. The following JCL is generated as a result:

//SNNOPEX  JOB  ,SN,MSGCLASS=X,CLASS=K
//STEP01   EXEC PGM=NOPCONTI,PARM='C0004'
//STEPLIB  DD   DISP=SHR,DSN=NOP.SYSF.DEV.LOAD
//* DEVICE: BATCH, INIT-USER: EORMON
//* L-01  : EX131-A EX-1-24
//* THE CLASS IS K
//*

#GET-SYMBOL

#GET-SYMBOL can be used within macro JCL to put an active symbol value into a local variable.

The symbol is taken from where it is found first in the symbol search path.

The syntax is as follows:

#GET-SYMBOL variable [value]

value is optional. If it is not specified, the variable is filled with the contents of a symbol with the same name.

value must be of the format A (alphanumeric). To convert value to a numeric field, use the Natural VAL system function.

#GET-SYMBOL variable(index)

With this syntax, an instance of a multiple value symbol can be obtained. The variable must be defined as a local array with a sufficient array size.

Example:

#GET-SYMBOL L-SYMBOL(L-IND)

See also Examples of Using #GET-SYMBOL, #SET-SYMBOL and #SET-SYMBOL-M.

#SET-SYMBOL

#SET-SYMBOL can be used within macro JCL to set an active symbol and its value from a local variable or string.

The symbol is set in the active symbol table which belongs to the active job.

For #SET-SYMBOL, a job must have a locally defined symbol table.

The syntax is as follows:

#SET-SYMBOL symbol [value]

value is optional and can contain one of the following values:

Value Meaning Example
none Set the value of the symbol symbol to the content of a local variable with the name symbol.
#SET-SYMBOL S1
'text' Set the value of the symbol symbol to 'text'.
#SET-SYMBOL S2 'v002'
variable Set the value of the symbol symbol to the content of the local variable with name variable.
#SET-SYMBOL S3 S30

See also Examples of Using #GET-SYMBOL, #SET-SYMBOL and #SET-SYMBOL-M.

#SET-SYMBOL-M

#SET-SYMBOL can be used within macro JCL to set a master symbol and its value from a local variable or string.

The symbol is set in the master symbol table which belongs to the active job.

For #SET-SYMBOL-M, a job must have a locally defined symbol table.

The syntax is as follows:

#SET-SYMBOL-M symbol [value]

value is optional and can contain the same values as described for #SET-SYMBOL.

See also Examples of Using #GET-SYMBOL, #SET-SYMBOL and #SET-SYMBOL-M.

General Notes

Text strings must not contain blanks.

Blanks are used as separators for the parameters of #GET-SYMBOL and #SET-SYMBOL.

Examples of Using #GET-SYMBOL, #SET-SYMBOL and #SET-SYMBOL-M

The activation escape character used in the examples is the paragraph sign (§).

Statement Description
#GET-SYMBOL J Move the contents of symbol J to the local variable J.
#GET-SYMBOL #J §BB Move the contents of symbol BB to the local variable #J.
#GET-SYMBOL #J '§BB'  Move the contents of symbol BB to the local variable #J.
#GET-SYMBOL L-MULT '§?MV<M1,§I>' Move the result of a symbol function call into the local variable L-MULT.
#SET-SYMBOL J Set the active symbol J to the contents of the local variable J.
#SET-SYMBOL I #A  Set the active symbol I to the contents of the local variable #A.
#SET-SYMBOL AA 'text' Set the active symbol AA to the value text.
#SET-SYMBOL BB §I Set the active symbol BB to the contents of symbol I.
#SET-SYMBOL BB '§I' Set the active symbol BB to the contents of symbol I.
#SET-SYMBOL CC '§D.§E'  Concatenate symbol values of D and E, and put the result into the active symbol CC.
#SET-SYMBOL-M DD 'value' Set the master symbol DD to the value value.
#SET-SYMBOL-M TAGYYMMDD '&!D<T,YYMMDD>' Sets the result of the symbol function &!D<T,YYMMDD> (e.g. 150211) into the master symbol TAGYYMMDD.

Usage of Text Objects in JCL

You can include text objects in JCL. The text objects can have their own local parameters. Text objects can invoke other text objects, i.e., nesting is possible.

This feature is not limited to jobs with JCL location MAC (macro Natural source), but can also be used from within standard JCL.

This section covers the following topics:

Inserting Text Objects into JCL

You can insert Natural text objects anywhere in your JCL.

The meta commands described here are stripped from the active JCL and the submitted JCL.

The syntax is as follows:

#EOR-INCL LOC=NAT LIB=library MEM=text-object
Parameters of the #EOR-INCL Statement
Parameter Description
LOC  Location

NAT

Natural text object.

This is the only location which is currently allowed for text objects.

LIB  Library of the text object.
MEM  Name of the text object.

If the text object cannot be read, the JCL generation is aborted with an error message.

Symbol replacement is possible within the #EOR-INCL statement.

Parameters for Included Text Objects

You may invoke included text objects with specific parameters.

For each parameter you want to pass to the text which is included by a #EOR-INCL statement, you must code a #EOR-PARM line in front of the #EOR-INCL statement.

These parameters are in effect only for the text included (and all nested inclusions) in the following #EOR-INCL statement.

The syntax is as follows:

#EOR-PARM parameter = value [parameter = value]...

Multiple parameters can be passed on the #EOR-PARM line. This is limited by the line size.

Parameter values implicitly have the format A (alphanumeric).

Parameter values may contain blanks. In this case, they must be included in apostrophes (' ') or double quotes (" ").

Nested (Recursive) #EOR-INCL Statements

You may use nested #EOR-INCL statements inside text objects which have already been included. These nested inclusions may have their own parameter lists.

Note:
Be aware that the total number of inclusions for JCL is limited by the Natural editor buffer size for the Natural task executing.

Replacement of Parameters within the Text Object

Parameters for text objects can be used within the included text object like any other symbol. They have precedence over the symbols of the current symbol table of the job (and the other symbol tables in the search hierarchy).

Therefore, parameters for included text objects can temporarily override symbols with the same name. The scope of a parameter is only the included text object, and the text objects which are invoked from within this text object by nested calls.

The lifetime of parameters defined via #EOR-PARM is JCL load time only. Normal symbol replacement can be used within included text objects like everywhere else in the JCL.

Examples of #EOR Statements

Example 1:
...
#EOR-INCL LOC=NAT LIB=JCLLIB MEM=§OBJECT
...

Include the Natural text object the name of which is in the symbol OBJECT from the library JCLLIB.

Example 2:
...
#EOR-PARM DBID = 9
#EOR-PARM TEXT-1 = "a string with blanks"
#EOR-INCL LOC=NAT LIB=USERLIB MEMBER=BLOCK1
//* JCL statement
#EOR-PARM DBID = 10
#EOR-PARM TEXT-1 = "another string"
#EOR-INCL LOC=NAT LIB=USERLIB MEMBER=BLOCK1
...

Include the Natural text object BLOCK1 from the library USERLIB. The parameters DBID and TEXT-1 are passed to the text object with different values for the two invocations.

Locking of Natural Sources

If you start Natural with the profile parameter SLOCK set to PRE, a lock avoids that two or more users can concurrently edit a Natural source object from an Entire Operations, an Entire Operations GUI Client or within a native Natural environment.

If SLOCK is set to POST or OFF, no locking is performed but the Entire Operations editor detects that several users edit a source at the same time.

You can use the Natural system command UNLOCK to check or unlock locked Natural source objects.

For detailed information on SLOCK and UNLOCK, refer to the relevant sections in the Natural Parameter Reference documentation.

Additional Prerequisites for Source Locking

  • In a UNIX or Windows environment, the Natural Development Server must be installed in the current Natural FNAT system file.

  • If you want to avoid concurrent source editing among users in a local Entire Operations GUI Client environment, in addition to Natural, you also have to start the Natural RPC server with SLOCK set to PRE.