Controlm User Guide
Controlm User Guide
SETOLOC
%%var = value
%%var = expression
%%autoedit - control - statement
Lname ;
NnMm ;
Mm ;
logonid - TSO
KSL Commands and Variables
Chapter 8 KeyStroke Language (KSL) 877
KSL variables are only accessible by the KSL script in which they are defined. A
reference to the same variable in another command member (or in another invocation
of the same command member) is totally independent and has no effect on the
current member environment.
When an expression contains both KSL and special AutoEdit variables and functions,
KSL variables are resolved first.
For more information about syntax and KSL variables, see Language Syntax on
page 864.
Special KSL Variables
Some KSL variables are reserved by, and have a special meaning for, KSL:
NOTE
The second character in a KSL variable name must not be a percent sign. KSL assumes
that a variable beginning with %% is an AutoEdit variable.
If a KSL script is to search for a prerequisite condition whose name begins with a
single percent sign (%), KSL assumes it is a KSL user-defined variable and does not
recognize the searched-for condition.
Table 266 Special KSL Variables (Part 1 of 2)
Variable Description
%A1-%A9 Passes the specified arguments to a called script. The number
corresponds to the position of the argument in command
CALLMEM. The argument is replaced throughout the called
script member at invocation time.
%CALLRC Contains the return code specified in the RETURN command
when returning from command CALLMEM. Also contains the
return code from programs called by the CALL or EXEC
commands.
%FINDRC Provides the return code of the result of the last FIND. If the
last FIND was successful, has a value of 0. If the last FIND was
unsuccessful, %FINDRC has a value of 4.
%MSG Specifies text assigned at script termination, which appears as
a message in the jobs SYSLOG and the script execution listing.
Only the value of variable %MSG at the script member issuing
command END is displayed.
%RC Supplies the return code of the script. The value at successful
script termination is the condition code of the step. Valid
values are: 0 through 4095.
Sample KeyStroke Reports and Utilities
878 CONTROL-M for OS/390 and z/OS User Guide
Sample KeyStroke Reports and Utilities
The IOA KSL and IOA SAMPLE libraries contain sample scripts for a variety of
reports and utilities.
The following report scripts in the IOA KSL library are supported. The jobs to run
them are found in the CTM.JCL or IOA.JCL libraries (as indicated in the third column
of Table 8-14 and Table 8-15).
Scripts for the following utilities are in the IOA KSL library:
%SCRCOL Current column position of the cursor.
%SCRLINE Current line position of the cursor.
NOTE
If you choose to modify an existing sample report or utility, it is recommended that
you save the changed report under a different name and keep the original report
unchanged. This precaution can help in error detection if the altered KSL script does
not run as expected.
Table 267 Report Scripts in the IOA KSL Library
Script Description JCL Library
REP3GRUP Status of all the jobs of specified groups. CTM
REP3LEFT All jobs still in the Active Job File that did
not run during the previous night (wait
schedule, ended NOT OK, executing) and
the reasons for the problems.
CTM
REP3STAT Statistical summary of what must be done
tonight, or job status in the morning.
CTM
REP3TAPE Status of all jobs using tapes. CTM
REP3WHY All jobs in the Active Jobs file having a
WAIT SCHEDULE status.
CTM
REP5ABND All abends in a given period. IOA
REP5ALL All IOA Log file messages of a specified
period.
IOA
REP5MSGD All IOA Log file messages of specified
message codes for a specific period.
IOA
Table 266 Special KSL Variables (Part 2 of 2)
Variable Description
Sample KeyStroke Reports and Utilities
Chapter 8 KeyStroke Language (KSL) 879
You can use the above examples to design scripts for your own reports utilities.
In addition to the scripts in the IOA KSL library, the IOA SAMPLE library contains
many useful scripts. However, the scripts in the IOA SAMPLE library have been
developed and supplied by users. They have been placed in the IOA SAMPLE library
as examples. They have not been tested and they are not supported.
Table 268 Utility Scripts in the IOA KSL Library
Script Description JCL Library
ADDMNCND Add manual conditions based on prefix. IOA
HOLDGRUP Hold a group of jobs. CTM
MAYBEJOB Add prerequisite conditions for maybe jobs. CTM
RERUNJOB Rerun a job. CTM
Sample KeyStroke Reports and Utilities
880 CONTROL-M for OS/390 and z/OS User Guide
Sample KSL Report Outputs
The following sample outputs are the result of running job REPJBDEF (in the
CONTROL-M JCL library), which invokes sample KSLREPSCHED (in the IOA KSL
library).
Output #1 from the sample KSL Script:
Figure 354 Output from KSL Library Sample KSLREPSCHED
Output #2 from the sample KSL Script:
KEYSTROKE REPORTI NG LANGUAGE ( REL PROD. ) DATE 06/ 06/ 01 TI ME 10. 08 PAGE 000001
LI ST OF JOBS TABLE: PRODYH LI B: CTM. PROD. SCHEDULE
=============================================================================
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PRODYI DK UPDATE # 1
PRODYHST UPDATE # 2
PRODYJCL CREATE I NPUT FI LES # 2
PRODYBTL REPORTS FOR BRANCHES
PRODYHTK PROCESS I NPUT DATA FOR PRODYHST
PRODYHC2 CREATE I NPUT FI LE # 2
PRODYBCK PROCESS I NPUT DATA FOR PRODYI DK
PRODYI ZN REPORTS FOR BRANCH MANAGERS
PRODYEND REPORTS FOR MAI N OFFI CE
PROJYFOT BEGI N OF EVENI NG PROCESS
PROJYMRG EVENI NG UPDATE PROCEDURE
PROJYMTI VERI FI CATI ON PROCESS OF EVENI NG UPDATE
PROJYHO1 SPECI AL CALCULATI ONS FOR ACCOUNTI NG DEPARTMENT
PROJYHO2 REPORTS FOR ACCOUTI NG DEPARTMENT
PROJYDPY UPDATE OF ON- LI NE FI LES
PROJYDTK REPORTS OF ON- LI NE FI LES
PROJYDLI CREATE DUAL ON- LI NE FI LE
PROYH11 YH APPLI CATI ON UPDATE
PROJYFI N CLEAN- UP FOR YH APPLI CATI ON
PROJYBNK VERI FI CATI ON OF BRANCH BALANCES
PROJEND FI NAL YH APPLI CATI ON PROCEDURE
PROLYPAR NI GHT I NPUT COLLECTI ON # 1
PROLYDOC BACKUP FI LES STATUS REPORTS
PROLYFMZ REPORTS FOR MAI N OFFI CE
PROLYDEL DELETE TEMPORARY " REPORT" FI LES
PROLYBME CREATE EXTERNAL TAPE
PROLYDM2 ARCHI VE YH APPLI CATI ON DATA SETS #2
PROLYDM1 ARCHI VE YH APPLI CATI ON DATA SETS #1
======= >>>>>>>>>>>>>>>>>>> NO MORE JOBS I N TABLE <<<<<<<<<<<<<<<< =======
BMC SOFTWARE, I NC. I OA KEY- STROKE REPORTI NG LANGUAGE ( REL PROD. ) DATE 06/ 06/ 01 TI ME 10. 12
PAGE 000001
SCHEDULE DEFI NI TI ON OF MEMBER PRODYBCK I N TABLE PRODYH LI BRARY CTM. PROD. SCHEDULE
======================================
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
| MEMNAME PRODYBCK MEMLI B CTM. PROD. SCHEDULE |
| OWNER M44 TASKTYPE JOB PREVENT- NCT2 Y DFLT N |
| APPL APPL- L GROUP BKP- PROD- L |
| DESC DAI LY BACKUP OF SPECI AL FI LES FROM APPL- L |
| OVERLI B CTM. OVER. JOBLI B |
Sample KeyStroke Reports and Utilities
Chapter 8 KeyStroke Language (KSL) 881
| SET VAR |
| . CTB STEP AT NAME TYPE |
| DOCMEM BACKPL02 DOCLI B CTM. PROD. DOC |
| =========================================================================== |
| DAYS DCAL |
| AND/ OR |
| WDAYS WCAL |
| MONTHS 1- Y 2- Y 3- Y 4- Y 5- Y 6- Y 7- Y 8- Y 9- Y 10- Y 11- Y 12- Y |
| DATES |
| CONFCAL WORKDAYS SHI FT RETRO N MAXWAI T 04 D- CAT |
| MI NI MUM PDS |
| =========================================================================== |
| I N START- DAI LY- BACKUP ODAT |
| CONTROL |
| RESOURCE I NI T 0001 CART 0001 |
| PI PE |
| TI ME: FROM UNTI L PRI ORI TY DUE OUT SAC CONFI RM |
| =========================================================================== |
| OUT BAKCKPL02- ENDED- OK ODAT + |
| AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS |
| RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP |
| SYSOUT OP ( C, D, F, N, R) FROM |
| MAXRERUN RERUNMEM I NTERVAL FROM |
| STEP RANGE FR ( PGM. PROC) . TO . |
| ON PGMST PROCST CODES A/ O |
| DO |
| SHOUT WHEN TO URGN |
| MS |
======= >>>>>>>>>>>>>>>>>>> END OF SCHEDULI NG PARAMETERS <<<<<<<<<<<<<<<< =====
Sample KeyStroke Reports and Utilities
882 CONTROL-M for OS/390 and z/OS User Guide
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 883
Appendi x
A
A The CONTROL-M Application
Program Interface (CTMAPI)
This appendix discusses the CONTROL-M Application Program Interface (CTMAPI),
including the following topics:
s Overview, on page A-884
s Environment and Allocations, on page A-885
s Functions, on page 886, including
1. Order or Force Existing Jobs, on page 887
2. Create, Order, or Force New Tables, on page 890
3. AJF Actions, on page 892
4. Search, on page 896
5. Global Variables, on page 899
s Conditional Requests and Selection Criteria, on page 900
s Return Codes, on page 902
s Conversational Mode using Program, on page 904
s Input and Output Registers, on page 904
s CTMBAPI DSECT, on page 905
s Status Extension, on page 909
s Order Extension, on page 914
s AJF Action Extension, on page 917
s Global Variable Extension, on page 920
s Quantitative Resource Extension, on page 921
s Create And/ Or Order or Force a Table (BLT), on page 922
s Replies, on page 924
s CTMBAPO, on page 924
Overview
884 CONTROL-M for OS/390 and z/OS User Guide
Overview
The CONTROL-M Application Program Interface (CTMAPI) is an open interface
between the application environment and CONTROL-M. CTMAPI enables your
application program to interface with CONTROL-M so that you can access services
and extract data from CONTROL-M into your own programs.
CTMAPI is open to all application environments. It can be called from the following
programs or environments:
s High Level Language or Assembler programs, running under various
environments, such as CICS, IMS, or the like
s a batch job or step
s REXX or CLIST
However, not all functions of the API are applicable to all environments.
The API can call the CTMAPI module and pass it requests through either of the
following:
s a function (command line) passed to CTMAPI, as
a parameter from within a program
a parameter using PARM=variable in a JCL Batch step
an explicit command coded in a dedicated sequential file pointed to by the
DAAPI special DD statement
s conversational mode (CTMBAPI mode), using an area mapped by CTMBAPI
DSECT. It passes the request from an application program to CTMAPI, and the
results are returned to the calling program
These methods, functions and conversational mode, are explained in more detail in
this appendix.
NOTE
All examples in this Appendix are in Assembler language.
Environment and Allocations
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 885
Environment and Allocations
CTMAPI is a callable Load module that resides in the IOA LOAD library. It is located
below the line (RMODE=24), works in 31 bit addressing mode (AMODE=31), and can
be called by programs running in any AMODE.
The following requirements must be satisfied before CTMAPI can be called:
s The calling application must have access to the IOA LOAD library, either using
STEPLIB or using Linklist.
s The standard IOA DD statement DAPARM must be allocated to the calling
address space before calling CTMAPI, and must correctly point to the IOA PARM
and IOA IOAENV libraries. This allocation is essential for the correct loading of
CTMPARM, IOAPARM and other required parameter members, and to provide
the ability to issue messages, dynamically allocate files, and so on.
In addition to the above allocations, each service requires specific data sets to be
allocated for successful execution of the service. For example, to successfully order
jobs to CONTROL-M, the Active Jobs file (AJF) must be allocated.
CTMAPI relies on IOA dynamic allocation services to allocate the files appropriate to
the function, using an ALC member. This means that your program, REXX or batch
requires no knowledge of dynamic allocation.
For more information about IOA dynamic allocation and ALC members, see the
INCONTROL for OS/390 and z/OS Administrator Guide.
You can tailor CTMAPI to allocate the appropriate files in either of the following
ways:
s Let the function itself dynamically allocate the default data sets based on the site
standard naming convention (using the default ALC member). Under each
function, you can find which ALC member is used to dynamically allocate the
necessary files. If you do not require any unusual allocations, this is the
recommended method.
s If you want to use other allocations, you can prepare your own ALC member and
pass it to CTMAPI using the standard DAALOCIN DD statement pointing to your
own ALC member. If this method is chosen, it is recommended that you use the
default ALC member specified in the function as a basis for your own ALC
member.
If the caller is not allocated to DAALOCIN DD at the time CTMAPI is called, it is
assumed that the default allocations are to be performed. In this case, CTMAPI will
dynamically allocate files using the default ALC member.
Functions
886 CONTROL-M for OS/390 and z/OS User Guide
If CTMAPI is called under the IOA environment, none of the above is applicable. It is
assumed that all the necessary files are already correctly allocated, so no dynamic
allocation is performed by CTMAPI.
Functions
CTMAPI supports various types of services, but not all of them are supported under
all environments. Some of the functions can be executed using existing IOA or
CONTROL-M utilities. For example, CTMJOB can be used to order jobs. Other
functions, such as the Status request or the Action request, cannot be processed by
means of any existing program or utility.
Future enhancements will be provided first to the API rather than to the appropriate
utility. BMC Software therefore recommends that you use CTMAPI for all requests,
even functions that are supported using other utilities.
The following CTMAPI functions are available:
s order or force existing jobs into CONTROL-M
This function can currently also be performed using CTMJOB.
s create and/ or order or force a new table into CONTROL-M
This function can currently also be performed using CTMBLT.
s perform AJF actions equivalent to the following options of the Active Environment
screen (Screen 3):
Hold
Free
Delete
Undelete
Confirm
Rerun
Restart
React
Force OK
s search and query the status and other details of jobs in CONTROL-M
s resolve, set, and checkpoint variables in the IOA Variables Database
The above-listed functions are described in greater detail in this appendix.
Differences in calling the service from different environments are also discussed.
1. Order or Force Existing Jobs
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 887
IOAAPI, which is described in the INCONTROL for OS/390 and z/OS Administrator
Guide, can be used to perform the following functions:
s CHECK, ADD, or DELETE conditions
s send e-mail messages
s extract records from the IOA Log file
1. Order or Force Existing Jobs
The Order function can be used to order or force an existing scheduling table, or
selected jobs from an existing table, to CONTROL-M.
This service can be called from any environment, with few differences between
environments. The syntax for this service is as follows:
For a full description of each parameter, see the description of the CTMJOB utility in
the INCONTROL for OS/390 and z/OS Utilities Guide. The only change from the utility
is the syntax of the Ignore or Select Tags statement. In CTMJOB, it is coded separately
from the Order statements. Under CTMAPI, it should be coded as part of the Order
statement, substituting SELTAG for the keyword SELECT and IGNTAG for the
keyword IGNORE.
The if_statement part of the command is described under Conditional Requests and
Selection Criteria on page 900.
An appropriate message, JOB511I, is issued to the IOA LOG file for each job that is
ordered.
Order or Force under Batch, REXX or CLIST
When called from a batch job or step or from a REXX or CLIST, the Order statement is
specified as one of the following:
ORDER { DSN=schedl i b| DDNAME| DD=dd} , { MEMBER| MEM=t abl e}
[ JOB=j obnm] [ ODATE| DATE=dat e] [ ODATEOPT=VAL| RUN] [ FORCE]
[ I NTOGRP=gr p_r ba [ DUP| NODUP] ]
[ SELTAG=t ag] [ I GNTAG=t ag] [ I F i f _st at ement ]
NOTE
In this syntax, NODUP is the default in the expression
INTOGRP=grp_rba [DUP| NODUP].
1. Order or Force Existing Jobs
888 CONTROL-M for OS/390 and z/OS User Guide
s a statement in the format
s in a sequential file pointed to by the DAAPI DD statement
In this type of call, the SYSPRINT DD statement must be pre-allocated to the step,
and the output of CTMAPI written to this file.
A return code is returned in register R15. For a full list of valid return codes, see
Order or Force Return Codes on page 889.
Order or Force Using Program
When called from a program, the simplest method of requesting a job order is to pass
the Order statement to CTMAPI as a standard parameter. Alternatively, you can use
the conversational mode of interface, where the CTMBAPI area is passed as the
parameter, and fields in it identify the request. This mode, which is described in
Conversational Mode using Program on page 904, is most useful when the calling
program requires a reply to be returned to it, for example, to keep track of the Order
ID of ordered jobs.
The standard method of calling CTMAPI and passing it the Order request in an
Assembler program is
EXEC CTMAPI PARM= ORDER var i abl e
MVC CMORDDSN, DSNAME
MVC CMORDTBL, TBLNAME
MVC CMORDJOB, JOBNAME
MVC CMORDDAT, DATE
CALL CTMAPI , ( PARMAREA) , VL
.
.
.
PARMAREA DC Y( PARMLEN)
DC C' ORDER DSN='
CMORDDSN DS CL44
DC C' MEM='
CMORDTBL DS CL8
DC C' JOB='
CMORDJOB DS CL8
DC C' ODATE='
CMORDDAT DS CL6
PARMLEN EQU * - PARMAREA
DSNAME DC CL44' CTM. PROD. SCHEDULE'
TBLNAME DC CL8' DEFSCHD1'
JOBNAME DC CL8' JOBA'
DATE DC CL6' 090600'
1. Order or Force Existing Jobs
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 889
In the above sample, just one job is ordered from an existing table, and the calling
program receives only the return code indicating whether the call was successful or
unsuccessful.
Order or Force Allocations
The default ALC member used by the Order service is ALCMJOBP, which allocates
the AJF, calendars, CONTROL-M Statistics file and the UNITDEF member. If you
choose to prepare your own ALC member, you must allocate at least all the above
files.
The DATEREC file is ignored when you use CTMAPI to order jobs.
Order or Force Return Codes
Table 269 shows the return codes that can be returned to the caller (in register R15).
NOTE
The VL parameter of the CALL macro must be coded, in order to turn on the high order bit of
the parameter list.
Table 269 Order or Force Return Codes
Return Code Explanation
0 The operation was successfully performed.
4 At least one job was not ordered, due to one of the following:
s missing calendar
s a problem was encountered in the scheduling table
s a PREV or NEXT date condition was missing
s CTMX001 cancelled the order
8 An error occurred, and the order stopped while being processed.
12 Syntax error in the command.
16 or more Severe error in CTMAPI. The order stopped while being processed.
2. Create, Order, or Force New Tables
890 CONTROL-M for OS/390 and z/OS User Guide
Order or Force Performance Considerations
There are no specific performance considerations with regard to the Order itself.
However, using an IF statement can affect the overall performance. For information
regarding the impact of an IF statement on performance, see Performance
Considerations for Selection Criteria on page 901.
Order or Force Security Considerations
The exit called during the Order process is CTMSE01. The files that are accessed, and
the type of access, are summarized in Table 270.
2. Create, Order, or Force New Tables
CTMAPI enables the user to create job scheduling tables, then order or force those
tables. You can order or force a job scheduling table to the Active Jobs File (AJF) even
if that table is not in a scheduling library.
This service is similar to that provided by the CTMBLT utility. It is activated by
means of appropriate CTMBLT input control statements.
Invoking Create, Order or Force New Tables Using Program
The CTMBLT control statements can be specified in a sequential file pointed to by the
DAAPI DD statement, or in an in-core table containing the control statements as
80-byte card images. The first control statement must be the character string 'BLT',
beginning in column 1, to indicate that the statements that follow are input for
CTMBLT. The rest of the control statements must conform to the usual CTMBLT
syntax.
Table 270 Files Accessed during the Order or Force Process
File Name Type of Access
Active Jobs File Read and Write
Calendar Read
Statistics File Read
Unit Definition Read
2. Create, Order, or Force New Tables
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 891
For a full description of the CTMBLT parameters and how to specify whether the
scheduling tables should be optionally ordered or forced, see the description of the
CTMBLT utility in the INCONTROL for OS/390 and z/OS Utilities Guide.
The SYSPRINT DD statement must be pre-allocated to the step. The output of
CTMAPI is written to this file. A return code is returned in register R15. A full list of
valid return codes is provided in Order or Force Return Codes on page 889. When
M is specified in the CTMBLT control parameter OPTION, appropriate messages
(BLT89AI) are issued to the job log for each scheduling table that is created.
Create, Order or Force Allocations
The default ALC member used by the CTMBLT service is ALCMBLT. This allocates
the CONTROL-M AJF, IOA LOG, IOA calendars, CONTROL-M Statistics file, and
UNITDEF member. These files are required only if the user requests the ordering or
forcing of the scheduling tables that are built.
Create, Order or Force Return Codes
Table 271 shows the return codes that can be returned to the caller (in register R15).
Create, Order or Force Performance Considerations
There are no specific performance considerations with regard to CTMBLT itself.
Create, Order or Force Security Considerations
When using the CTMBLT service to create, order, or force a new table, the security
considerations are the same as those described in Order or Force Security
Considerations on page 890.
Table 271 Create and/or Order or Force New Tables Return Codes
Return Code Explanation
0 The operation was successfully performed.
8 An error occurred. The table was not built, or not ordered.
12 Syntax error in the command.
16 or more Severe error in CTMAPI.
3. AJF Actions
892 CONTROL-M for OS/390 and z/OS User Guide
Table 272 shows the files that are accessed when Order or Force is requested, and the
type of access.
3. AJF Actions
Using this type of call to CTMAPI, various actions can be performed against jobs
residing in the Active Jobs file (AJF). This service can be called from any environment,
with few differences between environments. The full syntax for this service is as
follows:
The if_statement part of the command is described in Conditional Requests and
Selection Criteria on page 900, and the selection criteria are detailed in Table 277 on
page 900.
You must ensure that the selection criteria that you specify are sufficiently detailed to
return only one job. If the criteria can fit more than one job, the action is not
performed.
An appropriate message (CTM65AI) is issued to the IOA Log file for each action that
is executed.
AJF Action under Batch, REXX or CLIST
When called from a batch job or step or from a REXX or CLIST, the AJF statement is
specified as one of the following:
s a statement in the format
Table 272 Files Accessed during the Create, Order or Force Process
File Name Type of Access
Active Jobs File Read and Write
Calendar File Read
Statistics File Read
Unit Definition File Read
AJF{ HOLD| FREE| DELETE| UNDELET| CONFI RM| RERUN| REACT| FORCEOK}
{ sel ect i on_cr i t er i a} [ sel ect i on_cr i t er i a]
[ I F i f _st at ement ]
EXEC CTMAPI PARM= AJF var i abl e
3. AJF Actions
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 893
s in a sequential file pointed to by a DAAPI DD statement
In this type of call, only a return code is returned in register R15. A full list of valid
return codes is provided in AJF Action Return Codes on page 895.
If multiple commands are entered in a DAAPI DD statement, the final return code is
the highest return code from any of the commands. For example, if three different
commands were entered to DAAPI, and only the second command failed, the final
return code will be the return code for the failing command. However, there is no
way of knowing which of the commands failed. BMC Software therefore
recommends that you use one command at a time, rather than multiple commands.
AJF Action using Program
When called from a program, the simplest method of requesting the appropriate
action against a job is to pass the above statement to CTMAPI as a standard
parameter. Alternatively, you can use the conversational mode of the interface, where
CTMBAPI area is passed as the parameter, and fields in it identify the request. This
mode is described in Conversational Mode using Program on page 904.
3. AJF Actions
894 CONTROL-M for OS/390 and z/OS User Guide
The standard method of calling CTMAPI and passing the Hold request to it in an
Assembler program is:
In this example of a Hold job, the MEMNAME is DEFSCHD1, its job name is JOBA,
the OrderID is 0AS45, and the ODATE is 090601. The HOLD command for the job is
issued only if its prior STATE was FREE. The calling program receives only the return
code that indicates whether the call was successful or unsuccessful.
AJF Action Allocations
The default ALC member used by the AJF Action service is ALCMAJF, which
dynamically allocates the AJF only. If you choose to prepare your own ALC member,
you must ensure that you allocate at least the above file.
MVC CMACTMEM, MEMNAME
MVC CMACTJOB, JOBNAME
MVC CMACTOI D, ORDERI D
MVC CMACTDAT, DATE
MVC CMACTFRE, FREE
MVC CMACTI F, CMACTSEL
CALL CTMAPI , ( PARMAREA) , VL
.
.
.
PARMAREA DC Y( PARMLEN)
DC C' HOLD'
CMACTSEL DC C' MEM='
CMACTMEM DS CL8
DC C' JOB='
CMACTJOB DS CL8
DC C' OI D='
CMACTOI D DS CL5
DC C' ODATE='
CMACTDAT DS CL6
CMACTLEN EQU * - CMACTSEL
DC C' I F STATE='
CMACTFRE DS CL4
DC CL1' '
CMACTI F DS CL( CMACTLEN)
PARMLEN EQU * - PARMAREA
MEMNAME DC CL8' DEFSCHD1'
JOBNAME DC CL8' JOBA'
ORDERI D DC CL5' 0AS45'
DATE DC CL6' 090600'
FREE DC CL4' FREE'
NOTE
The VL parameter of the CALL macro must be coded in order to turn on the high order bit of
the parameter list.
3. AJF Actions
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 895
AJF Action Return Codes
Table 273 shows the return codes that can be returned to the caller (in register R15).
AJF Action Performance Considerations
There are no specific performance considerations with regard to the Action itself.
However, the Selection Criteria or IF statement can significantly affect the overall
performance. For information regarding the impact of Selection Criteria and/ or IF
statements on performance, see Performance Considerations for Selection Criteria
on page 901.
AJF Action Security Considerations
The exit that is called during execution of the action is CTMSE08.
Table 274 shows the files that are accessed, and the type of access.
Table 273 AJF Action Return Codes
Return Code Explanation
0 The operation was successfully performed.
4 The operation was not performed. The selection criteria or IF
statement were not matched, or more than one job conformed to the
selection criteria.
8 The operation could not be performed.
12 Syntax error in the command.
16 or higher Severe error in CTMAPI.
Table 274 Files Accessed during the AJF Action Process
File Name Type of Access
Active Jobs File Read and write.
4. Search
896 CONTROL-M for OS/390 and z/OS User Guide
4. Search
The Search function can be used to check the existence of a job in the AJF. It can be
called from any environment. However, the AJF entry of the job can only be returned
to the caller by using the CTMBAPI mode. Under all other environments, only the
return code is returned to the caller, indicating whether or not the job exists in the
AJF.
This function should only be used when you want to execute your own process based
on the result of this search. If you want to execute one of the other CTMAPI functions
based on the Search result, it is recommended that you use the conditional form of
that function instead.
The full syntax for the Search call is as follows:
The various valid selection_criteria are described in Conditional Requests and
Selection Criteria on page 900 and Table 277 on page 900.
You must ensure that the selection criteria that you specify are sufficiently detailed to
return only one job. If the criteria can fit more than one job, the action is not
performed.
Search under Batch, REXX or CLIST
When called from a batch job or step or from a REXX or CLIST, the Order statement is
specified as one of the following:
s a statement in the format
s in a sequential file pointed to by DD statement DAAPI
In this type of call, only a return code is returned in register R15. A full list of valid
return codes is provided below.
If multiple commands are entered in DAAPI, the final return code is the highest
return code from any of the specified commands. For example, if three different
commands were entered to DAAPI, and only the second command failed, the final
return code will be the return code for the failing command. However, there is no
way to know which of the multiple commands failed. BMC Software therefore
recommends that you use one command at a time, rather than multiple commands.
SEARCH sel ect i on_cr i t er i a [ sel ect i on_cr i t er i a]
EXEC CTMAPI PARM= SEARCH var i abl e
4. Search
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 897
Invoking Search from a Program
When called from a program, the simplest method of searching for a job is to pass the
Search call statement to CTMAPI as a standard parameter. Alternatively, you can use
the conversational mode of the interface, where the CTMBAPI area is passed as the
parameter, and fields in it identify the requested job. This mode is described in
Conversational Mode using Program on page 904. As mentioned earlier, the
advantage of using the CTMBAPI mode is that your program gets back from
CTMAPI the entry of the job, mapped by CTMBJSE DSECT, as described in The
Status Reply DSECT (CTMBJSE) on page 910.
The standard method of calling CTMAPI and passing it the Search request in an
Assembler program is
In this sample SEARCH, the job has a MEMNAME of DEFSCHD1, with a job name of
JOBA, an OrderID of 0AS45, and an ODATE of 090601. The calling program receives
only the return code indicating whether the call was successful or unsuccessful.
MVC CMACTMEM, MEMNAME
MVC CMACTJOB, JOBNAME
MVC CMACTOI D, ORDERI D
MVC CMACTDAT, DATE
CALL CTMAPI , ( PARMAREA) , VL
.
.
.
PARMAREA DC Y( PARMLEN)
DC C' SEARCH'
DC C' MEM='
CMACTMEM DS CL8
DC C' JOB='
CMACTJOB DS CL8
DC C' OI D='
CMACTOI D DS CL5
DC C' ODATE='
CMACTDAT DS CL6
PARMLEN EQU * - PARMAREA
MEMNAME DC CL8' DEFSCHD1'
JOBNAME DC CL8' JOBA'
ORDERI D DC CL5' 0AS45'
DATE DC CL6' 090600'
NOTE
The VL parameter of the CALL macro must be coded in order to turn on the high order bit of
the parameter list.
4. Search
898 CONTROL-M for OS/390 and z/OS User Guide
Search Allocations
The default ALC member used by the Search service is ALCMAJF, which
dynamically allocates the AJF only. If you choose to prepare your own ALC member,
you must ensure that you allocate at least the above file.
Search Return Codes
Table 275 shows the return codes that can be returned to the caller (in register R15).
Search Performance Considerations
There are no specific performance considerations with regard to the Search itself.
However, the Selection Criteria can significantly affect the overall performance. For
information regarding the impact of Selection Criteria on performance, see
Performance Considerations for Selection Criteria on page 901.
Search Security Considerations
This function does not call any security exit during the Search process.
Table 275 shows the files that are accessed, and the type of access.
Table 275 Search Action Return Codes
Return Code Explanation
0 The job exists.
4 The job was not found, or more than one job conforming to the
selection criteria was found.
8 The operation could not be performed.
12 Syntax error in the command.
16 and higher Severe error in CTMAPI.
Table 276 Files Accessed during the AJF Action Process
File Name Type of Access
Active Jobs File Read
5. Global Variables
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 899
5. Global Variables
You can use CTMAPI to Set and Checkpoint variables in the IOA Variable Database.
The resolve option is available only when CTMAPI is called in Conversation mode.
The full syntax for this CTMAPI service is
The SET, SETCKP, CHECKPOINT and CKP options define the action to be
performed on the database. If the action to be performed is SET or SETCKP, the name
of the variable must be supplied. The keyword parameters are used to define the
variable name.
For more information on the actions and components of the variable name, see the
IOA administration chapter in the INCONTROL for OS/390 and z/OS Administrator
Guide.
Global Variables under Batch REXX or CLIST
If you are calling this function from a batch job, REXX, or CLIST, the GLOBAL
statement can be specified in one of the following:
s a statement with the following syntax
EXEC CTMAPI PARM=' GLOBAL act i on | var name'
where:
action has one of the following values:
s SET
s SETCKP
s CHECKPOINT
s CKP
varname is the name of a global variable
s a sequential file pointed to by the DAAPI DD statement
If you use a DAAPI file, you can insert multiple commands.
GLOBAL { SET | SETCKP | CHECKPOI NT | CKP}
{ I OA=xxxx, PRODUCT=x, APPL=xxxx, GROUP=xxxx, MEMBER=xxxx,
VAR=%%\ xxxxxx, VALUE=xxxx}
Conditional Requests and Selection Criteria
900 CONTROL-M for OS/390 and z/OS User Guide
Conditional Requests and Selection Criteria
Many services can be conditionally executed based on various terms and conditions.
This topic describes in more detail the various criteria that can be used.
Poor usage of selection criteria can dramatically impact the overall performance.
Before using such selection criteria, read Performance Considerations for Selection
Criteria on page 901.
Character fields marked with an * (Asterisk) to the right of the field are used as a
prefix for the specified selection criteria. No masking is allowed in any other field.
For example, if you specify MEM=ABC*, all jobs with the MEMNAME prefix "ABC"
will be selected.
The full syntax for the selection criteria is as follows:
Table 277 shows the meanings of the parameters in that statement.
I F { [ MEM=memname* ] | [ GROUP| GRP=gr oup_name* ] |
[ JOB=j ob_name* ] | [ JOBI D=j es_j ob_number ] |
[ OWNER=owner * ] | [ OI D=or der i d] | [ ODATE={ ODAT| dat e} ] |
[ STATUS={ WAI T_SCH
WAI T_CONF
WAI T_PI PE
WAI T_ORD
EXEC_ERR
EXEC_WSUB
EXEC_I NQ
END_OK
END_OK_FOK
END_NOK_ABND
END_NOK_JCLE
END_NOK_UNKW
END_NOK_CC
END_NOK_NSUB
END_NOK_DI SA
EXI ST
NOTEXI ST
DEL} ]
| [ STATE={ HOLD| FREE} ] }
[ { AND| OR} sel ect i on2 } ] . . .
Table 277 Selection Criteria Parameters (Part 1 of 2)
Parameter Description
MEM Member name of the job
GROUP (or GRP) Group name of the job
JOB Job name of the job (valid only after the job was submitted)
JOBID JES job number (valid only after the job was submitted)
OWNER Owner of the job
OID The CONTROL-M Order ID of the job
Conditional Requests and Selection Criteria
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 901
Multiple IF statements can be specified, connected to each other using regular
Boolean logic, including expressions inside parentheses.
Performance Considerations for Selection Criteria
The overall performance of each call to CTMAPI is largely dependent on the selection
criteria. These must be carefully considered.
An important factor affecting overall performance is the uniqueness of the selection
criteria. If very few jobs in the Active Jobs file conform to your selection criteria, then
very few job records will have to be handled. For example, if you search for a specific
Order ID, the result will be the reading of only a few index records and only one job
record. On the other hand, if you search for all jobs with a member name starting with
ABC, the API must read many job records as well as the index records.
You can greatly improve overall performance by using indexed fields in the selection
criteria. This results in a faster and more efficient search. The use of non-indexed
fields causes a sequential search through the Active Jobs file, which is very slow and
inefficient.
Table 278 shows the attributes of each selection criteria parameter.
ODATE The ODATE of the job. Valid values are:
s ODAT The current CONTROL-M ODATE
s date The full date, in the format YYMMDD, MMDDYY, or
DDMMYY, depending on your site format
STATUS For an explanation of these statuses, see Table 283 on page 911.
STATE Whether the job is held or free. Valid values are:
s HOLD The job is held.
s FREE The job is free.
selection2 Any of the above parameters.
Table 278 Selection Criteria Parameter Attributes (Part 1 of 2)
Parameter Indexed Unique Notes
MEM Yes No
GROUP Yes No
JOB Yes No Valid only after job submission
JOBID No No Valid only after job submission
OWNER Yes No
OID Yes Yes
Table 277 Selection Criteria Parameters (Part 2 of 2)
Parameter Description
Return Codes
902 CONTROL-M for OS/390 and z/OS User Guide
As Table 278 shows, OID is the best choice for selection criteria, since it is both
indexed and unique. On the other hand, ODATE and JOBID are the worst choices for
selection criteria, since they are neither indexed nor unique. If you must use one of
the non-indexed search criteria, BMC Software recommends using it in a combination
with other indexed criteria.
Another factor affecting overall performance is the complexity of any AND or OR
statements that qualify the selection criteria. Statements included in an AND or OR
section of the selection criteria are each handled separately, one by one, as if each is a
fully qualified selection criteria, and the whole Boolean sentence is verified only after
each such statement is checked.
Search Security Considerations
This function does not call any security exit during the Search process.
Table 279 shows the files that are accessed, and the type of access.
Return Codes
CTMAPI return codes are returned in register R15. They are also returned in the
following fields:
s BAPIRC
s BAPIRSN
s BAPIURC
The following are the types of failure of CTMAPI:
ODATE No No
STATUS Yes No EXIST and NONEXIST statuses are not
indexed.
STATE Yes No
Table 279 Files Accessed during the AJF Action Process
File Name Type of Access
Active Jobs File Read
Table 278 Selection Criteria Parameter Attributes (Part 2 of 2)
Parameter Indexed Unique Notes
Return Codes
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 903
s CTMAPI itself encountered a problem that prevented it from calling a service.
In this case
register R15 has a value higher than 8
the reason code is returned in the BAPIRSN field
s The service was activated, but failed to perform the desired action.
In this case
register R15 has a value of 8
the return code from the service is returned in the BAPIURC field
Conversational Mode using Program
904 CONTROL-M for OS/390 and z/OS User Guide
Conversational Mode using Program
This type of call is intended for use by programs. It enables the program to pass
requests, accept replies, respond on the basis of the reply, and maintain
communication between the program and the API.
The basic communication area, which is passed back and forth between the calling
program and the API, is mapped by the Assembler DSECT CTMBAPI, which can be
found in the IOA MAC library. Different fields in this DSECT identify the request,
specify the selection criteria, and pass the address of the area in which replies to the
caller are to be returned.
Input and Output Registers
On input to any CTMAPI service, the contents of the general-purpose registers
should be as shown in Table 280.
On return, all registers are restored by CTMAPI, and a return code is returned in
register R15. In this appendix, the return codes and their meanings are explained
under each service.
Table 280 Contents of Registers on Input to CTMAPI
Register Contents
R0 Irrelevant
R1 Address of parameter list, where the first (and only) parameter
points to CTMAPI DSECT, with its high-order bit turned on (the VL
parameter of the CALL macro)
R2 through R12 Irrelevant
R13 SAVE AREA address of caller
R14 Return address
R15 CTMAPI entry point address
CTMBAPI DSECT
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 905
CTMBAPI DSECT
This section describes in more detail
s how to use the CTMBAPI DSECT
s what fields the caller should set
s what fields are used to return the result
The explanation assumes the use of Assembler language. However, you can use other
high level languages to implement most of the services, provided the language you
use conforms to the standard calling conventions in Table 280.
The type of service is identified in one or both of the following ways
s as a command within a buffer
The start address of the buffer is passed to the API using the BAPICMDA field. The
command length is passed using the BAPICMDL field.
s using the BAPICMD field, which identifies the type of service
If both are specified, the command takes precedence.
CTMBAPI is composed of
s a fixed part
This is used to identify the requested service, together with other necessary fields.
s a variable (extension) part
This is in variable format, where each service uses a different extension.
For each service, the format of each extension is documented in the following sections
of this appendix, for example in Status Extension on page 909, Order Extension
on page 914,AJF Action Extension on page 917, and so on.
The fields in the fixed (header) part are summarized in Table 281. The values in the
columns in Table 281 have the following significance:
s In the column headed Optional or Mandatory
M means mandatory
O means Optional
s In the column headed In or Out
I means Input
O means Output
CTMBAPI DSECT
906 CONTROL-M for OS/390 and z/OS User Guide
s In the column headed Type
CLnn means a character field nn characters in length, padded with blanks to the
right.
If omitted, it must be set to blanks.
an *(Asterisk) to the right of the CLnn entry means that the characters in the
field are used as a prefix for the specified selection criteria.
For example, if you specify MEMNAME ABC*, all jobs with a MEMNAME
prefix of "ABC" will be selected.
A means Address, a 4-byte fullword field pointing to an area.
If omitted, it must be set to binary zero.
F means Fullword, a 4-byte fullword field containing a binary number.
If omitted, it must be set to binary zero.
H means Halfword, a 2-byte halfword field containing a binary number.
If omitted, it must be set to binary zero.
Flag means a Flag Byte, where each bit has a separate significance.
Table 281 Fixed Part Values (Part 1 of 3)
Field Name
Optional or
Mandatory
In or
Out Type Usage
BAPICMD O I CL1 One byte identifier of the requested
service
Note: If the BAPICMDA field is set
to a value other than zero, it takes
precedence over the BAPICMD field.
BAPICMDA O I A Address of command buffer. The
command syntax should be identical
with the syntax of the individual
CTMAPI functions described in this
appendix. If set to zero, the
requested service must be specified
in the BAPICMD field.
BAPICMDL O I F Length of the command in the
command buffer. Ignored if the
value in BAPICMDA is zero.
CTMBAPI DSECT
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 907
BAPIFLG1 O I Flag General purpose flag.
BAPIF1CN (X80) Do not release
the working area on return.
Applicable for programs that call the
API several times. It is the
responsibility of the caller to call the
API with the function BAPI_TERM
to allow the API to free storage, close
files, and so on. Failure to do so may
cause unpredictable results, such as
storage accumulation.
BAPIMCT M I or O A Address of IOA MCT used by the
API. The caller must set this field to
zero on the first call, and leave it
untouched between multiple calls.
BAPIRC Not applicable O H Return code returned to the caller.
Identical with register R15.
BAPIRPL# O O F Number of reply slots returned by
the API. The size of each slot
depends on the service requested.
BAPIRPLC O O F Address of the first free byte in the
reply area. Serves to indicate the end
of that area.
BAPIRPLE O I A End address of the reply buffer.
If BAPIRPLS (in this Table) is set to
zero, this field is ignored.
This field informs API of the size of
the reply buffer. In some services,
such as STATUS, if the reply buffer
space is exhausted, a special return
code indicating this is returned to the
caller. The caller can then again call
the API to obtain the rest of the
reply.
BAPIRPLS O I A Start address of the reply buffer.
s If set to zero, no reply is
returned.
s If set to a value other than zero,
the API returns its replies into
this buffer.
The reply that the API can return is
explained in relation to each service.
Table 281 Fixed Part Values (Part 2 of 3)
Field Name
Optional or
Mandatory
In or
Out Type Usage
CTMBAPI DSECT
908 CONTROL-M for OS/390 and z/OS User Guide
BAPIRSN Not applicable O H Reason code returned to the caller.
Valid reason codes are documented
internally in the CTMBAPI macro.
BAPISIGN M I CL4 DSECT eye-catcher BAPI
BAPIURC Not applicable O H Return code returned to CTMAPI
from the invoked utility if that utility
failed. This return code is set only if
CTMAPI ended with return code 8.
Otherwise, the CTMAPI return code
itself identifies the problem.
BAPIVERS M I CL1 DSECT Version. The current version
is 1.
BAPIWORK M I or O A Address of the API work area. This
field is used by the API to hold
information between calls when
more replies must be returned. The
caller must set this field to zero and
leave it untouched between multiple
calls.
Table 281 Fixed Part Values (Part 3 of 3)
Field Name
Optional or
Mandatory
In or
Out Type Usage
Status Extension
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 909
Status Extension
The value of 2 (BAPI_M_STATUS) should be set in the BAPICMD field for the Status
function.
The Status function can be used to retrieve information about jobs in the Active Jobs
file. This service can be called from any environment, but only by using the
CTMBAPI mode, that is, using a program, and not by means of a batch statement,
REXX or CLIST.
On return, the status of and other information about the job is returned to the caller.
If you only requested one job, for example, Status using OID, the result is returned in
the Status extension itself. If more than one job may conform to the selection criteria,
for example, the status of MEMNAME ABC, a reply buffer must be supplied into
which the API can return a result for each and every job that conforms. If no such
buffer is supplied, no reply other than an appropriate return code is returned.
The Status extension fields are summarized in Table 282. If the caller filled in a field, it
is used as Search argument, and only jobs that conform to that field are returned. On
return from the API, if no reply area has been supplied, and if only one job conforms
to the selection criteria, the API will fill in all these fields with actual information
about this job. For example, if you specify ABC in BAPISMEM, and there is only one
job in the AJF with a matching MEMNAME, such as ABCXYZ, on return from the
API this field will hold the value ABCXYZ.
The values in the columns in Table 282 have the same significance as those in
Table 281.
Table 282 Status Extension Fields (Part 1 of 2)
Field Name Optional
In or
Out Type Usage
BAPISGRN O I or O CL20* Group name.
BAPISHLD O I or O CL1 Hold state. Valid values are:
s H (Hold)
s F (Free)
BAPISJID O I or O CL5 JES job ID (job number).
BAPISJNM O I or O CL8* Job name. Valid only after job
submission.
BAPISLIB O I or O CL44* Scheduling library from which the job
was ordered.
BAPISMEM O I or O CL8* MEMNAME.
BAPISODT O I or O CL6 ODATE of the job. This must be fully
specified. Prefixing is not supported.
Status Extension
910 CONTROL-M for OS/390 and z/OS User Guide
The Status Reply DSECT (CTMBJSE)
The DSECT that formats reply area entries is CTMBJSE. Each entry is 240 bytes long.
For REXX parsing, fields in this DSECT are separated by a blank.
You must always allocate an area of 12,000 bytes and code its address in the
BAPIRPLS field.
BAPISOID O I or O CL5 Order ID. If a value is entered, it must
include all five characters of the Order
ID.
Prefixing is not supported.
BAPISOWN O I or O CL8* Owner of the job.
BAPISRBA Not
applicable
O CL6 RBA of the job, in hexadecimal
format.
BAPISRBB Not
applicable
O CL3 RBA of the job, in binary format.
BAPISSTT O I or O CL15* Status of job. For a list of valid values,
see Table 283 on page 911.
The masking character * can be
used in any status value which
includes an underscore character _.
However, the * must follow
immediately after the _.
BAPISTAB O I or O CL8* Scheduling table from which the job
was ordered.
BAPISTYP O I or O CL3 Task type. Valid values are:
s JOB
s GRP
s STC
s CYC
s EMR
s CST
s ECJ
s EST
s ECS
s WRN
Except for GRP, each of these is
explained in TASKTYPE: General
Job Parameter on page 643. GRP is
explained in Table 54 on page 170.
Table 282 Status Extension Fields (Part 2 of 2)
Field Name Optional
In or
Out Type Usage
Status Extension
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 911
The search criteria can fit multiple jobs on the AJF, up to a maximum of 50 jobs. For
example, if you want to process 25 jobs, prepare an area of 12,000 bytes and code its
address in the BAPIRPLS field. After returning from the API, the area will contain the
details of the 25 jobs. Each job line is detailed in the CTMBJSE DSECT and contains
relevant information about the located job.
The number of lines is returned in the BAPIRPL# field. When this field points to the
maximum, 50, it is possible that there are more lines that can be returned. In that case,
the value of the Utility Return Code field BAPIURC will be 4, and the Reason Code
field BAPIRSN will have the value "BAPI_HAVE_MORE_LINES." In such a case, the
user program can set bit BAPISPF8 in byte BAPISF1 and call CTMAPI again. This call
will retrieve the next 50 lines of output that match the search criteria. When multiple
lines are returned, the lines are in the order from the end (the most recent job) to the
beginning. There is an option for the calling program to receive only one line of
output, by specifying as the value in the BAPISF1 flag byte either BAPIS1ST (first
line) or BAPISLST (last line).
Except for field JSESTAT, the meanings of the fields are as described (internally) in
the macro CTMBJSE, which is in the IOA MAC library. The JSESTAT field returns the
status of the job in the AJF. The CTMAPI status function does not return all the
statuses detailed in the CONTROL-M for OS/390 and z/OS User Guide. A list of the
statuses that can be returned appears in Table 283.
Table 283 Statuses Returnable under the Status Function (Part 1 of 2)
Status Description
DEL Job was deleted.
END_NOK_ABND The job ended NOTOK because of an abend.
END_NOK_CC The job ended NOTOK because of the Condition Code of the job.
END_NOK_DISA The job ended NOTOK. It disappeared.
END_NOK_JCLE The job ended NOTOK because of a JCL error.
END_NOK_NSUB The job ended NOTOK. It was not submitted by JES.
END_NOK_UNKW The job ended NOTOK for an unknown reason.
END_OK The job ended OK.
END_OK_FOK The job was ForcedOK.
EXEC Job is executing.
EXEC_ERR Relevant only to group entities. Several of the jobs in the group are
still executing, but at least one of them has ended NOTOK.
EXEC_INQ The job was submitted to JES, but is not yet processing.
EXEC_WSUB Wait submission. The job was selected, but it is still waiting for
CONTROL-M to submit it to JES.
WAIT_CONF Wait for confirmation.
WAIT_ORD The ordering of a group is not yet complete. The group is still in the
order process.
WAIT_PIPE Waiting for all members of the pipe to be ready for submission.
Status Extension
912 CONTROL-M for OS/390 and z/OS User Guide
Status Allocations
The ALC member used by the Status service as the default is ALCMAJF, which
dynamically allocates the AJF only. If you choose to prepare your own ALC member,
you must ensure that you allocate at least the above file.
Status Return Codes
Table 284 shows the return codes that can be returned to the caller (in register R15).
Status Performance Considerations
The Status function searches the AJF for the requested jobs. More than one job may
conform to the selection criteria specified in the CTMBAPI DSECT. In that case, a Job
Status Element (JSE) entry is returned to the caller for each job.
The Selection Criteria can significantly affect overall performance.
WAIT_SCH Wait Schedule.
EXIST The job exists on the Active Jobs file.
NONEXIST The job does not exist on the Active Jobs file.
Table 284 Status Return Codes
Return Code Explanation
0 The operation was completed OK.
If a reply buffer was supplied, but was exhausted, meaning that not
all the statuses could be returned into the supplied buffer, a special
reason code, 286, is returned in the BAPIRSN field to indicate that
there are more replies.
4 The job was not found.
8 The operation could not be performed.
12 Syntax error in the command.
16 and higher Severe error in CTMAPI.
Table 283 Statuses Returnable under the Status Function (Part 2 of 2)
Status Description
Status Extension
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 913
s The more specific the request, the fewer the jobs that must be read and returned to
the caller. For example, if you request status information for all jobs starting with
the letter A, the function must read a large part of the AJF, degrading its
performance.
s Pay special attention to whether your search criteria are indexed. If you ask for
status information about jobs with a selection criteria that is not indexed, for
example, from a specific ODATE, without any indexed selection criteria, the whole
AJF must probably be read.
The impact of Selection Criteria on overall performance is described in Performance
Considerations for Selection Criteria on page 901.
Status Security Considerations
This function does not call any security exit during the Status process.
The files that are accessed, and the type of access are summarized in the following
table:
Table 285 Files Accessed during the AJF Action Process
File Name Type of Access
Active Jobs File Read
Order Extension
914 CONTROL-M for OS/390 and z/OS User Guide
Order Extension
The value that should be set in the BAPICMD field for this function is 1
(BAPI_M_ORDER).
You can use the Order function to order jobs to the AJF. You can call this function
from any environment, but only by using the CTMBAPI mode. The function uses the
usual CONTROL-M order process to put the requested job on the AJF. The return
code will appear in the BAPIURC (Utility Return Code) field.
If CTMAPI fails to invoke the order process, register R15 will contain a value of 8 or
higher, and the reason code will appear in the BAPIRSN field.
You can request a detailed reply from the order process, using the following
procedure:
1 Prepare a memory area.
2 Pass the start address in the BAPIRPLS field.
3 Pass the address of the last byte of this area in the BAPIRPLE field.
After returning from the order process, the BAPIRPLC field will point to the last
byte replied. The BAPIRPL# field will contain the number of reply lines. For each
job processed by the order process, a reply line will be returned detailing the job
identifiers and the RC of the order for this specific job. This is in contrast to the
usual output lines of the order process that are issued only for jobs that have
actually been ordered. Details of the reply line are specified in the CTMBAPO
DSECT.
Table 286 contains a summary of the CTMBAPI Order input fields. You must
ensure that all fields whose type is CL are initialized with BLANKS, and those with
type X are initialized to binary zeros.
Table 286 Order Fields (Part 1 of 2)
Field Name Optional
In or
Out Type Usage
BAPIODSN N I CL44 Scheduling table DS name. Mutually
exclusive with BAPIODD.
BAPIOMEM N I CL8 Member name
BAPIODD O I CL8 Scheduling table DD name. Mutually
exclusive with BAPIODSN.
BAPIOJOB O I CL8 Job name. Enter (Blank) to order all
jobs in the table.
BAPIODAT O I CL6 ODATE. Default is the current Odate.
Order Extension
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 915
Order Return Codes
Table 287 shows the return codes that can be returned to the caller (in register R15).
BAPIORBA O I CL6 RBA of the group entity when a
Dynamic Group Insert is performed.
BAPIOF1 O I XL1 Flags byte. Valid values are:
s X80 Force the table
s X40 Insert the job into a group
entity that already exists on the
AJF
s X20 Allow duplicate jobs in the
group when dynamically
inserting a job into the group
s From X10 through X01 These
bits are reserved for internal use
BAPITAG# O I XL2 Number of tag statements that follow
this field.
This field is for users who want to
implement the IGNORE and/ or
SELECT TAG logic that is discussed
on connection with the utility
CTMJOB in the CONTROL-M chapter
of the INCONTROL for OS/390 and
z/OS Utilities Guide.
After this field, you should code the
matching number of BAPITGNM
statements that define the tags
themselves.
BAPITGIN O I CL1 Ignore or Select indicator. Valid
values are:
s I Ignore
s S Select
BAPITGNM O I CL20 Tag name
Table 287 Order Return Codes (Part 1 of 2)
Return Code Explanation
0 Order completed OK. If a reply buffer is specified in the BAPIRPLS
field, a reply line is returned for each job.
4 Order completed OK, but the order process issued a warning. This
usually occurs when one of the specified calendars was not found.
Table 286 Order Fields (Part 2 of 2)
Field Name Optional
In or
Out Type Usage
Order Extension
916 CONTROL-M for OS/390 and z/OS User Guide
Order Reply
The conversational mode (BAPI) order process can return a reply line for each job
processed. The reply line is mapped by DSECT CTMBAPO, which is described in
more detail in CTMBAPO on page 924.
Order or Force Allocations
For full information, see 1. Order or Force Existing Jobs on page 887.
Order or Force Security Consideration
For full information, see 1. Order or Force Existing Jobs on page 887.
8 The operation could not be performed. The Order process
encountered a severe error.
12 Syntax error.
16 Severe error in CTMAPI, such as a failure to get memory or a failure
to open a file.
Table 287 Order Return Codes (Part 2 of 2)
Return Code Explanation
AJF Action Extension
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 917
AJF Action Extension
The AJF Action function can be used to perform basic Active Environment screen
(Screen 3) actions upon jobs in the AJF. Using the BAPI interface, a user program is
able to perform actions such as holding, freeing, deleting jobs in the AJF in much the
same manner as the user can from Screen 3.
For this function, set the value in the BAPICMD field to 3 (BAPI_M_ACT).
The Action function can be called from any environment. The input contains the
following types of input:
s to identify the job
s to define the Action upon the job
s special input parameters for use when RERUN is required
These are described in the following sections.
Identifying the Job
The first type of input identifies the job, using the field names in Table 288.
CTMAPI uses this variable to find the job in the same way it does a search. For
information concerning performance and security, see Create, Order or Force
Performance Considerations on page 891.
Table 288 AJF Action Parameters
Field Name Optional
In or
Out Type Usage
BAPIAMEM O I CL8 Member name in table.
BAPIAJNM O I CL8 Job name, in JCL.
BAPIAOWN O I CL8 Owner ID of the job.
BAPIAJID O I CL5 JOBID as returned by JES.
BAPIAOID O I CL5 CONTROL-M ORDERID.
BAPIAGRN O I CL20 Group name.
BAPIRBAN O I XL3 RBA in binary format.
BAPIRBAC O I CL6 RBA of the job in characters, with
each character representing a
hexadecimal digit.
AJF Action Extension
918 CONTROL-M for OS/390 and z/OS User Guide
Defining the Action
To define the Action, you must set a 1-byte field called BAPIAACT with one of the
values in Table 289
Action Return Codes
The CTMAPI Action return code is returned in register R15. There are basically two
types of failure:
s The CTMAPI program itself encountered a problem which prevented it from
calling the service. In this case
register R15 has a value higher than 8
the reason code is returned in the BAPIRSN field
s The service was activated but failed to perform the desired action. In this case
register R15 has a value of 8
the return code from the service is returned in the BAPIURC field
Table 290 shows in more detail the return codes that can be returned to the caller (in
register R15).
Table 289 AJF Action BAPIAACT Field Values
Value Explanation
BAPIAHLD Hold
BAPIAFRE Free
BAPIADEL Delete
BAPIAUND Undelete
BAPIARER Rerun
BAPIARCT React
BAPIAFOK Force OK
BAPIACON Confirm
Table 290 CTMAPI Action Return Codes (Part 1 of 2)
Return Code Explanation
0 The action was successfully performed.
8 The action was not successfully performed.
The field BAPIURC contains a return code indicating the fault.
AJF Action Extension
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 919
Action AJF Allocations
For information on AJF Actions, see 3. AJF Actions on page 892.
Action Security Considerations
For information on AJF Action security considerations, see 3. AJF Actions on
page 892.
12 Syntax error.
16 Severe error, such as failure to get memory, or failure to open a file.
Table 290 CTMAPI Action Return Codes (Part 2 of 2)
Return Code Explanation
Global Variable Extension
920 CONTROL-M for OS/390 and z/OS User Guide
Global Variable Extension
The Global Variable Extension is used to resolve, set, or checkpoint variables in the
IOA Variable Database. For more information on this facility, see the IOA
administration chapter in the INCONTROL for OS/390 and z/OS Administrator Guide.
The value for this function in the BAPICMD field is 6. For more information on the
BAPICMD field, see BAPICMD on page 906.
Table 291 contains a summary of the CTMBAPI Global Variable Extension input
fields. You must ensure that all fields whose type is CL are initialized with BLANKS,
and those with type X are initialized to binary zeros.
Table 291 Global Variable Fields
Field Name Optional In or Out Type Usage
BAPIGOPT N I XL1 Option byte.
Valid values are:
s X'00' Resolve
Obtain the value of a variable
from the database.
s X'80' Set
Set the value of a variable
from the database.
s X'40' Checkpoint
Force all changed variables to
be written to the database.
BAPIGIOA O I CL8 QNAME
Default: MCTQNAME
BAPIGAPL O I CL20 Application name.
Default: NO_APPL
BAPIGGRP O I CL20 Group name.
Default: NO_GROUP
BAPIGMEM O I CL20 Member name.
Default: NO_MEM
BAPIGVAR N I CL256 Variable name.
BAPIGVAL N I/ O CL256 Variable value.
BAPIGPRC O I CL1 INCONTROL product.
Default: 'M'
Quantitative Resource Extension
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 921
Global Variable Return Codes
Table 292 shows in more detail the Global Variable return codes that can be returned
to the caller (in register R15).
Quantitative Resource Extension
The Quantitative Resource Extension function is used to query the status of a
quantitative resource in the CONTROL-M Resources file. It can be called from any
environment by means of the CTMBAPI mode.
Use BAPI_M_RES to set the value for this function in the BAPICMD field to 4.
Table 292 Global Variable Return Codes
Return Code Explanation
0 The action was successfully performed.
8 The action was not successfully performed.
The field BAPIURC contains a return code indicating the fault.
12 Syntax error.
16 Severe error, such as failure to get memory, or failure to open a file.
Table 293 CTMAPI Quantitative Resource Fields
Field Name Optional
In or
Out Type Usage
BAPIRESN N I CL20 Name of the resource. This serves as
the sole key to the search.
BAPIRESX O XL2 Maximum quantity defined for this
resource.
BAPIRESQ O XL2 Quantity currently held by jobs in the
AJF.
BAPIRESP O XL1 If the resource is reserved for a critical
path job, this field will contain the
priority of this job, which will be from
1 through 9.
Create And/Or Order or Force a Table (BLT)
922 CONTROL-M for OS/390 and z/OS User Guide
Quantitative Resource Return Codes
The result is returned directly to the BAPI DSECT as specified below.
Quantitative Resource Security Considerations
The security exit called is IOASE07.
Quantitative Resource Allocations
The files that are accessed, and the type of access, are summarized in Table 295.
Create And/Or Order or Force a Table (BLT)
The BLT function invokes the CTMBLT utility to create, save, and optionally order a
table on the fly.
Unlike the other functions implemented through BAPI extension, this feature does
not contain a separate extension where you define the input parameters. Instead
1 Set the BAPICMD field to the value BAPI_M_BLT.
2 Prepare the input to the API in memory as a regular CTMBLT input stream, as
described in the INCONTROL for OS/390 and z/OS Utilities Guide, pointed to by the
CTMCMDA field.
Table 294 CTMAPI Quantitative Resource Return Codes
Return Code Explanation
0 The operation completed OK. The output fields in the BAPI DSECT
are updated.
4 The resource was not found in the file.
16 Severe error encountered, such as failure to get memory or error in
accessing the file.
Table 295 CTMAPI Quantitative Resource File Allocation
File Name Type of Access
RES Read
Create And/Or Order or Force a Table (BLT)
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 923
3 Set the length of the input, in bytes, in the BAPICMDL field. Each control input
statement must be an 80-byte card image.
4 Set the reply fields.
When requesting reply fields in this function, through the BAPI interface, you
receive reply lines from both the CTMBLT function and CTMJOB. For more
information on the reply input and output fields, see CTMBAPO on page 924.
BLT Action Return Codes
BLT Reply
The conversational mode (BAPI) BLT function can return a reply line for
s each Table that was saved
s each job that was processed
The reply line is mapped by the CTMBAPO DSECT, which is described in more detail
in CTMBAPO on page 924.
BLT Security Considerations
When creating and saving scheduling tables, no IOA security exits are invoked to
check the authority of the user to access the scheduling table. If the table must also be
ordered, CTMSE01 will be called to verify that the user has the authority to order the
table.
Table 296 BLT Action Return Codes
Return Code Explanation
0 The action was successfully performed.
8 The utility did not perform the action.
The field BAPIURC contains a return code indicating the fault.
12 Syntax error.
Replies
924 CONTROL-M for OS/390 and z/OS User Guide
BLT Resource Allocations
Table 297 shows the files that are accessed, and the type of access.
Replies
The BAPI feature returns output to the customer in the following ways:
s a return code
s setting output fields in the BAPI DSECT
These fields were individually described in CTMBAPI DSECT on page 905.
s an output buffer returned by the Status service and described by the CTMBJSE
DSECT
s the replies returned by the Order and BLT functions, as described in CTMBAPO
on page 924
CTMBAPO
When in CTMBAPI mode, CTMAPI serves as an interface between a user program
and a CONTROL-M service. Some CTMAPI services have been modified to enable
them to return lines of replies into customer-supplied memory to detail their activity.
Currently this facility can be provided by
s the BLT process
s the Order process
For example, if the proper instructions are given, the Order process will return a reply
line for each job which it processes. This contrasts with normal processing, where a
line of output is not written until a job is actually placed on the AJF or a severe error
has occurred. You can then act upon and/ or process the reply lines.
Table 297 CTMAPI Quantitative Resource File Allocation
File Name Type of Access
Active Jobs File Read and Write
Calendar File Read
Statistics File Read
Unit Definition File Read
CTMBAPO
Appendix A The CONTROL-M Application Program Interface (CTMAPI) 925
To use this facility, you must supply the API with the pointers required to trigger the
reply mechanism. These are supplied through the calling program. Table 298 shows
the pointers and the fields in which they are supplied.
When BAPI returns, the BAPIRPLC field will point to the last byte actually written to
the reply buffer, and the BAPIRPL# field will contain the number of lines put there.
The API ensures that the value in the BAPIRPLC field never exceeds that set by the
BAPIRPLE field. Each line added to the reply buffer will start with the current
BAPIRPLC and will update it. BMC Software recommends that this field be
initialized to zero. If this field is not zero, API treats the value as the starting address
of the next reply line. This can be used by an application to accumulate reply lines
across several invocations of CTMAPI.
Each line in the buffer is mapped by the CTMBAPO DSECT. Each line starts with a
half-word that contains its length (BAPOLEN), and another two bytes that identify
the service that produced the reply line (BAPOID). The identification of each reply
line is mandatory, since a called service can call other CONTROL-M services which,
in turn, will place their reply lines in the buffer. By using the identification of each
reply line together with the contents of the BAPIRPLC field and the BAPIRPL# field,
you can code a routine to scan and filter reply lines.
Date Format Considerations
The format of all the date fields, both input and output, depends on your site
standard. It follows that when you prepare the input to CTMAPI, you must know
your site standard.
Table 298 CTMAPI Reply Mechanism Trigger Pointers
Field Information Required
BAPIRPLS The starting address of the reply buffer.
BAPIRPLE The address of the last byte in the reply buffer.
CTMBAPO
926 CONTROL-M for OS/390 and z/OS User Guide
Appendix B CONTROL-M for OS/390 and z/OS Unix System Services (USS) 927
Appendi x
B
B CONTROL-M for OS/390 and z/OS
Unix System Services (USS)
This Appendix discusses the implementation of CONTROL-M in the IBM OS/ 390 or
z/ OS Unix Systems Services (USS) environment.
In this appendix, the term MVS includes MVS, S/ 390, OS/ 390, and z/ OS.
Implementation Options
The use of USS with CONTROL-M for OS/ 390 and z/ OS can be implemented in
different ways, depending on your system and the way in which you use it.
Choose one of the following implementation options:
s Use MVS to run USS applications.
s Have MVS support USS in the same manner as it supports other Unix platforms,
such as CONTROL-M/ Enterprise Manager, CONTROL-M/ Server, and
CONTROL-M/ Agent.
s Integrate the architecture of SAP R/ 3 running on USS with the MVS platform.
These options are discussed individually in this Appendix.
OS/390-Oriented Implementation
928 CONTROL-M for OS/390 and z/OS User Guide
OS/390-Oriented Implementation
CONTROL-M for OS/ 390 and z/ OS fully supports the USS environment without any
need for modifications.
CONTROL-M for OS/ 390 and z/ OS manages all USS batch processes and integrates
them with batch activities on
s the local MVS system
s all other platforms across the network
For CONTROL-M to submit and control all USS executions, all that is required is the
definition of a single JCL member. This member contains a USS shell activation
program that is supported by the MVS operating system. AutoEdit variables are used
to define all elements of the USS task, such as the name of the script, the script
parameters, the job name and the script location. When CONTROL-M submits the
JCL, all the AutoEdit values are resolved and the JCL is submitted with its
corresponding values. The JCL then submits the appropriate script under USS.
CONTROL-M reads the return code of the script execution from the JCL sysout, and
proceeds accordingly.
A sample JCL member is shown in Figure 355.
In the CONTROL-M job definition that submits the JCL, use the SET VAR parameter
to assign a value to the %%MYSCRPT AutoEdit variable, as follows:
SET VAR %%MYSCRI PT=uss_scr i pt _name
Unix Oriented Implementation
To enable Unix operators to use their expert skills, CONTROL-M provides a
Unix-oriented MVS implementation for USS jobs.
Figure 355 JCL for USS Execution
/ / j obname JOB ( account _i nf o) , REGI ON=5000K
/ / STEPNAME EXEC PGM=BPXBATCH
/ / PARM=' sh / u/ usr _i d/ %%MYSCRPT'
/ / STDOUT DD PATH=' / u/ usr _i d/ st dout . f ' , PATHOPTS=( OWRONLY, OCREAT, OTRUNC) ,
/ / PATHMODE=SI RWXU
/ / STDERR DD PATH=' / u/ usr _i d/ st der r . f ' , PATHOPTS=( OWRONLY, OCREAT, OTRUNC) ,
/ / PATHMODE=SI RWXU
Unix Oriented Implementation
Appendix B CONTROL-M for OS/390 and z/OS Unix System Services (USS) 929
CONTROL-M incorporates 3-tier architecture that includes CONTROL-M/ Enterprise
Manager, CONTROL-M/ Server, and CONTROL-M/ Agent platforms. CONTROL-M
treats USS as an additional supported platform, just like any other supported Unix
platform.
This architecture is illustrated in Figure 356.
Figure 356 CONTROL-M Architecture for Unix-Oriented MVS Implementation
If you have a CONTROL-M/ Agent installed on several Unix computers, you can also
install it on a USS computer, using the same architecture. You can then implement
CONTROL-M in USS through a CONTROL-M/ Agent that allows Unix operators to
use the tools with which they are familiar.
Integrating SAP R/3 running on USS
930 CONTROL-M for OS/390 and z/OS User Guide
Integrating SAP R/3 running on USS
In many data centers, the heaviest batch application running on USS is SAP R/ 3.
The architecture of SAP is shown in Figure 357.
Figure 357 Architecture of SAP R/3
You can integrate this 3-tier architecture with the CONTROL-M MVS platform in the
following ways:
s You can use DB/ 2 as the SAP database, with MVS running the entire SAP database
layer. Many users of SAP employ this configuration.
Integrating SAP R/3 running on USS
Appendix B CONTROL-M for OS/390 and z/OS Unix System Services (USS) 931
s You can install both of the following in USS:
the database layer, using DB/ 2 running under MVS
the application layer
This configuration is popular among organizations that require the stability,
scalability, and security of the MVS platform.
CONTROL-M Support for SAP in the USS Environment
CONTROL-M support for the USS environment ensures complete automation and
integration of business processes both inside and outside the SAP application
environment.
CONTROL-M/ Enterprise Management for distributed systems supports SAP R/ 3 by
means of the CONTROL-M Option for SAP R/ 3. This product is certified by SAP in
accordance with the SAP Complementary Software Program.
The combination of CONTROL-M with the CONTROL-M Option for SAP R/ 3
enables all jobs and tasks to be managed in the same way, regardless of whether the
task is
s MVS JCL
s a Unix script
s an SAP task
The SAP R/ 3 standard Business Application Program Interface (BAPI) enables you to
define jobs through either the R/ 3 or CONTROL-M job definition process.
Once installed on a Windows NT or Unix platform, CONTROL-M Option for R/ 3
communicates with the R/ 3 Application layer. The database location is totally
transparent to CONTROL-M.
The Application layer can be in either
s SAP R/ 3
s USS
SAP R/3 Application Layer
If the Application layer is in SAP R/ 3 in a Unix computer, the communication process
between CONTROL-M Option for SAP R/ 3 and the R/ 3 Application layer is as
shown in Figure 358. In this figure, the database is an MVS (DB/ 2) database.
Integrating SAP R/3 running on USS
932 CONTROL-M for OS/390 and z/OS User Guide
Figure 358 Communication with the R/3 Application Layer - DB/2 Database
USS Application Layer
If the Application layer is in USS, use the same Windows NT or Unix CONTROL-M
Option for SAP R/ 3.
CONTROL-M Option for SAP R/ 3 communicates with the R/ 3 Application layer in
the same way that the product communicates with other platforms. The
communication process is shown in Figure 359.
Integrating SAP R/3 running on USS
Appendix B CONTROL-M for OS/390 and z/OS Unix System Services (USS) 933
Figure 359 Communication with the R/3 Application - SAP/R3 Database
Integrating SAP R/3 running on USS
934 CONTROL-M for OS/390 and z/OS User Guide
Appendix C Editing Job Scheduling Definitions in the Edit Environment 935
Appendi x
C
C Editing Job Scheduling Definitions in
the Edit Environment
Job scheduling definition parameters can be edited, moved, copied, deleted, or
repeated, by performing IOA Line Editing commands, similar to standard ISPF line
commands, from within the Edit environment.
The Edit environment in the Job Scheduling Definition screen is accessed by typing
EDIT in the COMMAND field and pressing Enter.
Figure 360 The Edit Environment in The Job Scheduling Definition Screen
A 2-character Line Editing command field, marked by underscores, is displayed for
each line on the screen.
Editing commands are typed directly onto these underscores.
JOB: BACKP02 LI B CTM. PROD. SCHEDULE TABLE: BACKUP
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ MEMNAME BACKP02 MEMLI B CTM. PROD. JOBLI B
__ OWNER M44 TASKTYPE JOB PREVENT- NCT2 Y DFLT N
__ APPL APPL- L GROUP BKP- PROD- L
__ DESC DAI LY BACKUP OF SPECI AL FI LES FROM APPL- L
__ OVERLI B CTM. OVER. JOBLI B
__ SCHENV SYSTEM I D NJE NODE
__ SET VAR
__ CTB STEP AT NAME TYPE
__ DOCMEM BACKP02 DOCLI B CTM. PROD. DOC
__ ===========================================================================
__ DAYS DCAL
__ AND/ OR
__ WDAYS WCAL
__ MONTHS 1- Y 2- Y 3- Y 4- Y 5- Y 6- Y 7- Y 8- Y 9- Y 10- Y 11- Y 12- Y
__ DATES
__ CONFCAL WORKDAYS SHI FT RETRO N MAXWAI T 00 D- CAT
__ MI NI MUM PDS
__ DEFI NI TI ON ACTI VE FROM UNTI L
__ ===========================================================================
__ I N START- DAI LY- BACKUP ODAT
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 16. 44. 31
936 CONTROL-M for OS/390 and z/OS User Guide
Incorrectly specified Line Editing commands can be corrected by typing over them
correctly. Line Editing commands can be deleted by blanking them out or by
specifying the RESET command in the COMMAND field.
The Line Editing commands you enter are processed when Enter is pressed.
CONTROL-M performs Automatic Syntax Checking to ensure that the job scheduling
definition is still syntactically correct after editing. If an edit may invalidate the job
scheduling definition, a message is displayed at the top of the screen and the edit is
not performed. For recommendations for editing job scheduling definitions, see
Maintaining Valid Job Scheduling Definitions on page 939.
All operations available in the Job Scheduling Definition screen can be performed
while in the Edit environment. For example, parameter values can be changed, and
the job scheduling definition can be saved and exited.
To exit the Edit environment, retype EDIT in the COMMAND field and press Enter.
Line Editing command fields are removed from the display.
Line Editing commands can be performed on the following:
NOTE
Edit commands cannot be applied to the first line of an IN block or an OUT block.
Table 299 Subjects of Line Editing Commands (Part 1 of 2)
Subject Description
Single Lines One single line on the screen.
Examples:
s Additional lines of the IN parameter.
s Single-lined DO statement (such as DO COND).
Logical Lines All parameter lines for a specific parameter, including its
subparameters.
Examples:
s A DO SHOUT statement, whose subparameters are
distributed over more than one line.
s A single-lined DO statement, such as DO COND.
Line Editing Commands
Appendix C Editing Job Scheduling Definitions in the Edit Environment 937
Line Editing Commands
The following types of line editing commands exist in the Edit environment.
Logical Blocks Functional group of parameter lines. Job scheduling
definitions consist of at least one logical block an ON block.
Example:
ON block, which consists of its respective parameter lines and
the DO statement lines.
Multiple Lines User-specified group of parameter lines.
Example:
A series of DO statements.
Table 300 Line Editing Commands - Delete Commands
Command Description
DS Delete a single line.
DL Delete a logical line.
DB Delete a logical block or sub-block.
DD Delete lines between two DD specifications.
D Delete a line. CONTROL-M determines whether to delete a single
or logical line based on the line type.
Table 301 Line Editing Commands - Copy Commands
Command Description
CS Copy a single line.
CL Copy a logical line.
CB Copy a logical block or sub-block.
CC Copy lines between two CC specifications.
C Copy a line. CONTROL-M determines whether to copy a single or
logical line based on the line type.
Copy commands are used in conjunction with Location commands. The lines and
blocks are placed at the position indicated by Location command A or B (described
below).
Table 299 Subjects of Line Editing Commands (Part 2 of 2)
Subject Description
Line Editing Commands
938 CONTROL-M for OS/390 and z/OS User Guide
Table 302 Line Editing Commands - Move Commands
Command Description
MS Move a single line.
ML Move a logical line.
MB Move a logical block or sub-block.
MM Move lines between two MM specifications.
M Moves a line. CONTROL-M determines whether to move a single
or logical line based on line type.
Move commands are used in conjunction with Location commands. The lines and
blocks are placed at the position indicated by Location command A or B, which are
described in Table 305 on page 938.
Table 303 Line Editing Commands - Repeat Commands
Command Description
RS Repeat a single line.
RL Repeat a logical line.
RB Repeat a logical block or sub-block.
RR Repeat lines between two RR specifications.
R Repeat a line. CONTROL-M determines whether to repeat a single
or logical line based on line type.
The repeated lines and blocks are placed immediately after the lines and blocks
marked with the command.
Table 304 Line Editing Commands - Insert Command
Command Description
I Inserts a new logical line or block after the logical line or block
marked with an I.
Table 305 Line Editing Commands - Location Commands
Command Description
Indication of the position where lines or blocks must be placed.
A (After) Indicates that lines or blocks must be placed after the line marked
with an A.
B (Before) Indicates that lines or blocks must be placed before the line
marked with a B.
Location commands A and B are used in conjunction with Copy (C, CS, CL, CC, CB),
and Move (M, MS, ML, MM, MB) commands.
Maintaining Valid Job Scheduling Definitions
Appendix C Editing Job Scheduling Definitions in the Edit Environment 939
Maintaining Valid Job Scheduling Definitions
Since job scheduling definitions must be syntactically correct at all times, the user
must consider the following issues when specifying Line Editing commands:
s The result of a Line Editing command is dependent on the line on which the
command is specified. For example, command D deletes either a single or a logical
line based on the line type.
s Logical lines form a unit and cannot be separated.
When a logical command is specified within a logical line, that is, on a
subparameter line or an additional parameter line, the specified operation is
performed on the entire logical line.
s Block commands must be specified on the main lines of the block. For example, to
delete an ON block, specify command DB (Delete Block) on the ON line.
s Blank parameter lines are added automatically by CONTROL-M, to allow the user
to specify additional parameters, and cannot be deleted.
s BMC Software recommends that, wherever possible, you use commands D, C, R,
and M for editing, instead of DS, DL, CS, CL, RS, RL, MS, and ML, because these
commands automatically retain the logical structure of the job scheduling
definition.
Maintaining Valid Job Scheduling Definitions
940 CONTROL-M for OS/390 and z/OS User Guide
Example 1
Before: Insert additional DO statements within a DO block using command I (Insert).
Figure 361 Example - Inserting A DO Statement - Before
After
Figure 362 Example - Inserting A DO Statement - After
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ SYSOUT OP ( C, D, F, N, R) FROM
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ MAXRERUN 3 RERUNMEM I NTERVAL FROM
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 * * * * * A/ O
__ CODES
I _ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO RERUN
__ DO
__ ON PGMST PROCST CODES A/ O
__ DO
__ SHOUT WHEN TO URGN
__ MS
======= >>>>>>>>>>>>>>>>>>> END OF SCHEDULI NG PARAMETERS <<<<<<<<<<<<<<<< =====
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 16. 44. 31
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ SYSOUT OP ( C, D, F, N, R) FROM
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ MAXRERUN 3 RERUNMEM I NTERVAL FROM
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 * * * * * A/ O
__ CODES
__ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO
__ DO RERUN
__ DO
__ ON PGMST PROCST CODES A/ O
__ DO
__ SHOUT WHEN TO URGN
__ MS
======= >>>>>>>>>>>>>>>>>>> END OF SCHEDULI NG PARAMETERS <<<<<<<<<<<<<<<< =====
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 14. 49. 42
Maintaining Valid Job Scheduling Definitions
Appendix C Editing Job Scheduling Definitions in the Edit Environment 941
Example 2
Before: Delete an ON PGMST block. Use of the DB (Delete Block) command is the
preferred method. The DB command removes all parameters, comments,
continuation lines, and separator lines of the specified block. DB must be specified on
a main line of the block, that is, ON PGMST. In this example, the ON PGMST block is
deleted.
Figure 363 Example - Deleting A Block - Before
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ ==========================================================================
__ OUT
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ SYSOUT OP ( C, D, F, N, R) FROM
__ MAXRERUN 3 RERUNMEM I NTERVAL. FROM
__ STEP RANGE FR ( PGM. PROC) . TO
DB ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 * * * * * A/ O
__ CODES
__ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO RERUN
__ DO
__ ON PGMST PROCST CODES A/ O
__ DO
__ SHOUT WHEN TO URGN
__ MS
======= >>>>>>>>>>>>>>>>>>> END OF SCHEDULI NG PARAMETERS <<<<<<<<<<<<<<<< =====
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 14. 52. 02
Maintaining Valid Job Scheduling Definitions
942 CONTROL-M for OS/390 and z/OS User Guide
After: The ON PGMST ANYSTEP block has been deleted.
Figure 364 Example - Deleting A Block - After
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ ==========================================================================
__ OUT
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ SYSOUT OP ( C, D, F, N, R) FROM
__ MAXRERUN 3 RERUNMEM I NTERVAL. FROM
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST PROCST CODES A/ O
__ DO
__ SHOUT WHEN TO URGN
__ MS
======= >>>>>>>>>>>>>>>>>>> END OF SCHEDULI NG PARAMETERS <<<<<<<<<<<<<<<< =====
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 14. 53. 58
Maintaining Valid Job Scheduling Definitions
Appendix C Editing Job Scheduling Definitions in the Edit Environment 943
Example 3
Before: Move multiple DO statements from one sub-block to another. Command MM
(Multiple Move) is specified at the beginning and end of the DO statements that are
moved. Command A (After) specifies the location after which these lines are placed.
Figure 365 Example - Moving Statements - Before
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ OUT
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ SYSOUT OP ( C, D, F, N, R) FROM
__ MAXRERUN 3 RERUNMEM I NTERVAL. FROM
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 * * * * * A/ O
__ CODES
__ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO RERUN
MM DO COND STEP5_DONE ODAT +
__ DO SHOUT TO TSO- M22 URGENCY R
MM = STEP STEP05 PROCESSED
__ DO
__ ON PGMST STEP05 PROCST CODES S* * * A/ O
A_ DO I FRERUN FROM $ABEND . TO . CONFI RM N
__ DO
__ ON PGMST PROCST CODES A/ O
__ DO
__ SHOUT WHEN TO URGN
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 15. 03. 25
Maintaining Valid Job Scheduling Definitions
944 CONTROL-M for OS/390 and z/OS User Guide
After: The two specified DO statements have been moved to the specified location.
Figure 366 Example - Moving Statements - After
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ OUT
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ SYSOUT OP ( C, D, F, N, R) FROM
__ MAXRERUN 3 RERUNMEM I NTERVAL. FROM
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 * * * * * A/ O
__ CODES
__ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO RERUN
__ DO
__ ON PGMST STEP05 PROCST CODES S* * * A/ O
__ DO I FRERUN FROM $ABEND . TO . CONFI RM N
__ DO COND STEP5_DONE ODAT +
__ DO SHOUT TO TSO- M22 URGENCY R
__ = STEP STEP05 PROCESSED
__ DO
__ ON PGMST PROCST CODES A/ O
__ DO
__ SHOUT WHEN TO URGN
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 5. 06. 09
Maintaining Valid Job Scheduling Definitions
Appendix C Editing Job Scheduling Definitions in the Edit Environment 945
Example 4
Before: Copy ON PGMST and some of its DO statements to another ON PGMST
block. Command CC (Multiple Copy) is specified at the beginning and the end of the
parameters that is copied. Command B (Before) specifies the location before which
these lines are placed.
Figure 367 Example - Copying Statements - Before
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ SYSOUT OP ( C, D, F, N, R) FROM
__ MAXRERUN 3 RERUNMEM I NTERVAL. FROM
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 * * * * * A/ O
__ CODES
__ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO RERUN
__ DO
CC ON PGMST STEP05 PROCST CODES S* * * A/ O
__ DO I FRERUN FROM $ABEND . TO . CONFI RM N
CC DO COND STEP5_DONE ODAT +
__ DO SHOUT TO TSO- M22 URGENCY R
__ = STEP STEP05 PROCESSED
__ DO
B ON PGMST PROCST CODES A/ O
__ DO
__ SHOUT WHEN TO URGN
__ MS
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 14. 32. 29
Maintaining Valid Job Scheduling Definitions
946 CONTROL-M for OS/390 and z/OS User Guide
After: The specified ON PGMST and DO statements have been copied.
Figure 368 Example - Copying Statements - After
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ MAXRERUN 3 RERUNMEM I NTERVAL. FROM
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 * * * * * A/ O
__ CODES
__ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO RERUN
__ DO
__ ON PGMST STEP05 PROCST CODES S* * * A/ O
__ DO I FRERUN FROM $ABEND . TO . CONFI RM N
__ DO COND STEP5_DONE ODAT +
__ DO SHOUT TO TSO- M22 URGENCY R
__ = STEP STEP05 PROCESSED
__ DO
__ ON PGMST STEP05 PROCST CODES S* * * A/ O
__ DO I FRERUN FROM $ABEND . TO . CONFI RM N
__ DO COND STEP5_DONE ODAT +
__ DO
__ ON PGMST PROCST CODES A/ O
__ DO
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 15. 19. 53
Maintaining Valid Job Scheduling Definitions
Appendix C Editing Job Scheduling Definitions in the Edit Environment 947
Example 5
Before: Insert a continuation line between existing continuation lines. It is
recommended that command RS (Repeat Single) or R (Repeat) be used to repeat the
previous line.
Figure 369 Example - Inserting A Line - Before
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ TI ME ZONE:
__ ===========================================================================
__ OUT
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ SYSOUT OP ( C, D, F, N, R) FROM
__ MAXRERUN 3 RERUNMEM I NTERVAL. FROM
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 C3000 A/ O A
RS CODES C4000 C5000 C6000 C7000
__ CODES C1200
__ ON PGMST STEP04 PROCST CODES * * * * * A/ O
__ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO RERUN
__ DO
__ ON PGMST STEP05 PROCST CODES S* * * A/ O
__ DO I FRERUN FROM $ABEND . TO . CONFI RM N
__ DO COND STEP5_DONE ODAT +
__ DO SHOUT TO TSO- M22 URGENCY R
__ = STEP STEP05 PROCESSED
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 15. 22. 46
Maintaining Valid Job Scheduling Definitions
948 CONTROL-M for OS/390 and z/OS User Guide
After: The continuation line has been repeated. The repeated line can be modified as
necessary.
Figure 370 Example - Inserting A Line - After
JOB: PRDKPL01 LI B CTM. PROD. SCHEDULE TABLE: PRODKPL
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ TI ME ZONE:
__ ==========================================================================
__ OUT
__ AUTO- ARCHI VE Y SYSDB Y MAXDAYS MAXRUNS
__ RETENTI ON: # OF DAYS TO KEEP 030 # OF GENERATI ONS TO KEEP
__ SYSOUT OP ( C, D, F, N, R) FROM
__ MAXRERUN 3 RERUNMEM I NTERVAL. FROM
__ STEP RANGE FR ( PGM. PROC) . TO .
__ ON PGMST ANYSTEP PROCST CODES S* * * U* * * * C2000 C3000 A/ O A
__ CODES C4000 C5000 C6000 C7000
__ CODES C4000 C5000 C6000 C7000
__ CODES C1200
__ ON PGMST STEP04 PROCST CODES * * * * * A/ O
__ DO I FRERUN FROM $ABEND . TO . CONFI RM Y
__ DO RERUN
__ DO
__ ON PGMST STEP05 PROCST CODES S* * * A/ O
__ DO I FRERUN FROM $ABEND . TO . CONFI RM N
__ DO COND STEP5_DONE ODAT +
__ DO SHOUT TO TSO- M22 URGENCY R
COMMANDS: EDI T, DOC, PLAN, JOBSTAT 15. 23. 46
Appendix D Editing CMEM Rule Definitions in the Edit Environment 949
Appendi x
D
D Editing CMEM Rule Definitions in the
Edit Environment
CMEM rule definition parameters can be edited (moved, copied, deleted, repeated)
by performing IOA Line Editing commands, similar to standard ISPF line commands,
from within the IOA Edit environment.
The Edit environment in a Rule Definition screen is accessed by typing EDIT in the
COMMAND field and pressing Enter.
Figure 371 The Edit Environment in The Rule Definition Screen
A 2-character Line Editing command field, marked by underscores, is displayed for
each line on the Rule Definition screen.
Editing commands are typed directly onto these underscores.
RL: JOBNAM1 LI B CTM. PROD. RULES TABLE: CMEMRULE
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ ON JOBARRI V = JOBNAM1 JTYPE SMFI D SYSTEM And/ Or / Not
__ OWNER CTMCTLM GROUP MODE PROD RUNTSEC NONE
__ DESCRI PTI ON CONVERSI ON: ON JOB JOBNAM1 ARRI VAL FORCEJOB
__ DESCRI PTI ON
__ ==========================================================================
__ DO FORCEJOB = TABLE TABLE1 JOB DATE ODAT
__ LI BRARY CTM. PROD. SCHEDULE
__ DO
__ ==========================================================================
======= >>>>>>>>>>>>>>> END OF RULE DEFI NI TI ON PARAMETERS <<<<<<<<<<<<<<< =====
FI LL I N RULE DEFI NI TI ON. CMDS: CAPS, EDI T, SHPF, 20. 10. 46
Line Editing Commands
950 CONTROL-M for OS/390 and z/OS User Guide
Incorrectly specified Line Editing commands can be corrected by typing over them
correctly. Line Editing commands can be deleted by blanking them out or by
specifying the RESET command in the COMMAND field.
The Line Editing commands you enter are processed when Enter is pressed.
The CMEM facility performs Automatic Syntax Checking to ensure that the rule
definition is still syntactically correct after editing. If an edit may invalidate the rule
definition, a message is displayed at the top of the screen and the edit is not
performed. For guidelines and recommendations for editing rule definitions, see
Maintaining Valid Rule Definitions on page 953.
All operations available in the Rule Definition screen can be performed while in the
Edit environment. For example, parameter values can be changed, and the Rule
Definition screen can be saved and exited.
To exit the Edit environment, re-type EDIT in the COMMAND field and press Enter.
Line Editing command fields are removed from the display.
Line Editing commands can be performed on any single ON or DO statement or on a
block of ON or DO statements.
All lines of a single statement, for example, the two lines of a DO FORCEJOB
statement, constitute a logical line.
Line Editing Commands
The following types of line editing commands exist in the Edit environment.
Table 306 Line Editing Commands - Delete Commands
Command Description
DS Delete a single line.
DL Delete a logical line.
DD Delete lines between two DD specifications.
D Delete a line. CONTROL-M determines whether to delete a single
or logical line based on the line type.
Table 307 Line Editing Commands - Copy Commands (Part 1 of 2)
Command Description
CS Copy a single line.
CL Copy a logical line.
Line Editing Commands
Appendix D Editing CMEM Rule Definitions in the Edit Environment 951
CC Copy lines between two CC specifications.
C Copy a line. CONTROL-M determines whether to copy a single or
logical line based on the line type.
Copy commands are used in conjunction with Location commands. The lines and
blocks are placed at the position indicated by Location command A or B (described
below).
Table 308 Line Editing Commands - Move Commands
Command Description
MS Move a single line.
ML Move a logical line.
MM Move lines between two MM specifications.
M Moves a line. CONTROL-M determines whether to move a single
or logical line based on line type.
Move commands are used in conjunction with Location commands. The lines and
blocks are placed at the position indicated by Location command A or B, described
in Table 311 on page 952.
Table 309 Line Editing Commands - Repeat Commands
Command Description
RS Repeat a single line.
RL Repeat a logical line.
RR Repeat lines between two RR specifications.
R Repeat a line. CONTROL-M determines whether to repeat a single
or logical line based on line type.
The repeated lines and blocks are placed immediately after the lines and blocks
marked with the command.
Table 310 Line Editing Commands - Insert Command
Command Description
I Inserts a new logical line or block after the logical line or block
marked with an I.
Table 307 Line Editing Commands - Copy Commands (Part 2 of 2)
Command Description
Line Editing Commands
952 CONTROL-M for OS/390 and z/OS User Guide
Table 311 Line Editing Commands - Location Commands
Command Description
Indication of the position where lines or blocks must be placed.
A (After) Indicates that lines or blocks must be placed after the line marked
with an A.
B (Before) Indicates that lines or blocks must be placed before the line
marked with a B.
Location commands A and B are used in conjunction with Copy (C, CS, CL, CC),
and Move (M, MS, ML, MM) commands.
Maintaining Valid Rule Definitions
Appendix D Editing CMEM Rule Definitions in the Edit Environment 953
Maintaining Valid Rule Definitions
Since rule definitions must be syntactically correct at all times, you must consider the
following issues when specifying Line Editing commands:
s The result of a Line Editing command is dependent on the line on which the
command is specified. For example, command D deletes either a single or a logical
line based on the line type.
s Logical lines function as a unit and cannot be separated.
When a logical command is specified within a logical line, that is, on a
subparameter line, or a continuation line, the specified operation is performed on
the entire logical line.
s Blank parameter lines added automatically by CMEM, to allow the user to specify
additional parameters, cannot be deleted.
It is recommended that, wherever possible, commands D, C, R, and M be used for
editing, instead of DS, DL, CS, CL, RS, RL, MS, and ML, because these commands
automatically retain the logical structure of the rule definition.
Example
Before: Repeat a DO block in the Rule Definition screen.
Figure 372 Example - Repeating A DO Block - Before
RL: JOBNAM1 LI B CTM. PROD. RULES TABLE: CMEMRULE
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ ON JOBARRI V = JOBNAM1 JTYPE SMFI D SYSTEM And/ Or / Not
__ OWNER CTMCTLM GROUP MODE PROD RUNTSEC NONE
__ DESCRI PTI ON CONVERSI ON: ON JOB JOBNAM1 ARRI VAL FORCEJOB
__ DESCRI PTI ON
__ ==========================================================================
R_ DO FORCEJOB = TABLE TABLE1 JOB DATE ODAT
__ LI BRARY CTM. PROD. SCHEDULE
__ DO
__ ==========================================================================
======= >>>>>>>>>>>>>>> END OF RULE DEFI NI TI ON PARAMETERS <<<<<<<<<<<<<<< =====
FI LL I N RULE DEFI NI TI ON. CMDS: CAPS, EDI T, SHPF, 20. 10. 46
Maintaining Valid Rule Definitions
954 CONTROL-M for OS/390 and z/OS User Guide
After: The DO block has been repeated.
Figure 373 Example - Repeating A DO Block - After
RL: JOBNAM1 LI B CTM. PROD. RULES TABLE: CMEMRULE
COMMAND ===> SCROLL===> CRSR
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
__ ON JOBARRI V = JOBNAM1 JTYPE SMFI D SYSTEM And/ Or / Not
__ OWNER CTMCTLM GROUP MODE PROD RUNTSEC NONE
__ DESCRI PTI ON CONVERSI ON: ON JOB JOBNAM1 ARRI VAL FORCEJOB
__ DESCRI PTI ON
__ ==========================================================================
__ DO FORCEJOB = TABLE TABLE1 JOB DATE ODAT
__ LI BRARY CTM. PROD. SCHEDULE
__ DO FORCEJOB = TABLE TABLE1 JOB DATE ODAT
__ LI BRARY CTM. PROD. SCHEDULE
__ DO
__ ==========================================================================
======= >>>>>>>>>>>>>>> END OF RULE DEFI NI TI ON PARAMETERS <<<<<<<<<<<<<<< =====
FI LL I N RULE DEFI NI TI ON. CMDS: CAPS, EDI T, SHPF, 20. 32. 47
Appendix E AutoEdit Facility in KSL 955
Appendi x
E
E AutoEdit Facility in KSL
The AutoEdit facility provides additional data manipulation capabilities. It is
composed of the following types of AutoEdit symbols and instructions:
s system variables
s user-defined variables
s operators
s functions
These components can be used in certain KSL commands, as described in Chapter 8,
KeyStroke Language (KSL), and are resolved according to the AutoEdit rules
described in this appendix.
NOTE
KSL and CONTROL-M use different AutoEdit processors. Therefore, if a KSL script
containing KSL AutoEdit terms is submitted under CONTROL-M, the CONTROL-M
AutoEdit %%RANGE statement must be used in the JCL to ensure that the
CONTROL-M AutoEdit processor skips, that is, that it does not process, the KSL
script.
System Variables
956 CONTROL-M for OS/390 and z/OS User Guide
System Variables
System variables are predefined, commonly used variables whose values are
automatically updated and maintained by the AutoEdit facility.
The System variable format is:
where var represents the name of the System variable.
Each AutoEdit variable begins with %%. Each variable resolves to (is replaced by)
the corresponding system value. AutoEdit System variables are described on the
following pages.
Example
resolves on the 12th of December 2001 to
AutoEdit System Variables:
%%$var
TYPE ' %%$DATE'
TYPE ' 011010'
NOTE
In the following table, the
Concatenation character
%%$BLANK
Substring of variable varname starting at position pos
with length len.
%%$TIME