ALEXCMDS is a utility program that works on z/OS 2.3 and below, and can perform many system functions, to include:
Issue MVS and Subsystem commands using SVC 34 (MVS command facility)
Issue rollable and non-rollable WTOs
Reply to outstanding WTORs
Query all active address spaces and perform an action whether a task is active or inactive
Issue Waits (STIMER) between commands
Invoke REXX EXECs with arguments passed
Perform simple scheduling using days of the week and JES2 automatic command processing.
Comments can also be included in the input stream to help better understand and document the functions being performed.
This program uses a DD statement, which allows you to specify the input control cards. It keys off of a special character in column one of each control card, and if it is not unique it will just pass the input along to SVC 34 to issue as a command. A description of each special character, and the function it performs when located in the input stream will be listed in this document. Examples are provided.
Function |
Column One |
Description |
Comment |
* |
Used to allow for documentation within job stream |
WTO |
+ |
Issue Write to Operator (WTO) messages |
Noroll WTO |
@ |
Issue highlighted WTOs that will not automatically roll off console |
WAIT |
# |
Followed by WAIT= before column seven, and then a number of seconds you wish to wait (e.g. #WAIT=5 to sleep for five seconds) |
Reply to WTORs |
? |
Followed by M=, followed by the message ID you wish to search for (maximum of 12 characters), followed by a ;, followed by R=, followed by the reply to the message (maximum of 24 character reply). If the reply contains blanks then you must enclose it in single quotes (e.g. ?M=IEF233I;R=NOHOLD) |
Address Space Search |
% |
Followed by either STRT= or STOP=, followed by the taskname (TSO, STC or JOB), followed by ;, then followed by an action. Actions can consist of either issuing commands, following the ; with either a + or @ to issue a WTO, a #WAIT to wait, or / for a REXX EXEC. For STRT= the action will be performed if the task is active and for STOP= the action will be performed if the task is not active. |
REXX EXEC |
/ |
Will process the input as a valid REXX EXEC, passing it to IRXJCL. The name of the EXEC must begin in column two, right after the / in column one, and cannot exceed eight characters. Any arguments that will be passed to the REXX EXEC must be specified as any normal type of REXX argument. |
Scheduling |
= |
Will process JES2 automatic commands for scheduling jobs. Starting in column two you can specify the days of the week when you wish the command to be issued, beginning with Saturday and ending with Friday in column eight. A keyword of EVERY in column two will always execute the command, an H in the respective day column will execute command even on a holiday, and a non-blank in the respective column will work in all other instances. The automatic command is then parsed and if the time has not past the command will be issued to JES2. There is also included a HOLIDAY DD statement that will allow you to specify holiday dates. |
Commands |
|
A blank in column one, or other than the previous six functions in column one, the control card will be passed as an MVS or JES2 (or other valid subsystem) command using SVC 34. |
A sample Started Task will be provided that uses a symbolic parameter to point to a member of a partitioned dataset (PDS). Sample shutdown commands will be provided to assist you in using this utility to automate the shutdown of your system. Procedures should be produced at your installation to inform operations of the verification tasks before beginning shutdown (e.g. all batch jobs have to be completed).
Sample Started Task ALEXCMDS
//COMMANDS PROC N=
//STEP1 EXEC PGM=ALEXCMDS
//STEPLIB DD DSN=your.authlib,DISP=SHR (if not on LNKLST)
//CMDIN DD DSN=your.cntlib(&N),DISP=SHR
//SYSUDUMP DD SYSOUT=A
Sample Control Cards in your.cntlib Member
* Drain all initiators and printers
$PI
$PPRT1,PRT2,PRT3
$IPRT1,PRT2,PRT3
* Stop TSO and CICS Regions
P TSO
F CICSNAME,CEMT PERF SHUT
* Wait for possible TSO message
#WAIT=5
* Reply to TSO shutdown message if one exists. Verify the specific message ID
?M=IKT01D;R=FSTOP
* Wait an extra five seconds and check to see if CICS is down yet
#WAIT=5
* If CICS not down then issue immediate shutdown
%STRT=CICSNAME;F CICSNAME,CEMT PERF SHUT IMM
* Bring down other tasks
P DISPATCH
P NETMSTR
* If DB2 is up make sure that you start command in column 2 or later
+STOP DB2
* Shutdown VTAM
Z NET
#WAIT=30
* If VTAM not down yet then do quick. Stop OMS and display any tasks
%STRT=NET;Z NET,QUICK
P OMS
D A,L
* Have Operations look for ALL AVAILABLE FUNCTIONS COMPLETE, then do $PJES2
An example of a batch job and the control cards are provided here
//JOBCARD (installation dependent)
//STEP1 EXEC PGM=ALEXCMDS
//STEPLIB DD DSN=your.authlib,DISP=SHR (can be in LNKLST)
//* HOLIDAY DD STATEMENT IS OPTIONAL
//HOLIDAY DD DSN=your.cntlib(HOLIDAY),DISP=SHR
//CMDIN DD *
* The control cards, to include this comment, will be provided here. This is a comment.
* The next statement will issue an MVS command
D A,L
* The next statement will issue a rollable message
+ This message will roll off the console
* The next statement will issue a non-rollable message
@ This message will stay highlighted on the console and not roll
* The next statement will reply to an outstanding TMS message if one exists
?M=IEFTMS0;R=U
* The next statement will issue a wait so that this JOB can go to sleep for a period of 30 seconds * of its allotted CPU time
# WAIT=30
* The next statement will check to see if TESTCICS is active and if it is it will try and bring it down
% STRT=TESTCICS;F TESTCICS,CEMT PERF SHUT
* The next statement will check to see if TESTCICS is active and if it is not it will bring it up
% STOP=TESTCICS;S TESTCICS
* The remaining statements will relate to scheduling using JES2
* The next statement will execute if the time has not past
= $TA,T=08.00,'$VS,''S JOB,N=POPUTD10'''
* This statement will only execute on Monday, if not a holiday and
* if it is not past 0800 hrs. Monday is a non-blank in column 4
= M $TA,T=08.00,'$VS,''S JOB,N=POPUTW10'''
* This statement will execute Monday through Friday if before time
* and will execute on Friday even if it is a holiday
= MTWTH$TA,T=08.00,'$VS,''S JOB,N=POPUTD20'''
* The next statement will execute on the first day of the month, if
* if time has not past and even if it is a holiday
=FIRST $TA,T=08.00,'$VS,''S JOB,N=POPUTM10'''
* The next statement will execute on the last day of the month, if
* if time has not past and even if it is a holiday
=LAST $TA,T=08.00,'$VS,''S JOB,N=POPUTM10'''
/*
//
SCHEDULING
There is a facility available in MVS to perform scheduling of batch jobs and commands using JES2 Automatic Command Processing. It is explained in more detail in the JES2 Commands manual (i.e. $SA, $TA, $CA and $ZA) and the JES2 Initialization and Tuning Guide. The ALEXCMDS program uses the services of JES2 Automatic Command Processing to allow you to perform simple scheduling for a Daily, Weekly or Monthly workload of batch jobs and commands. If a Scheduler package is implemented at a later date it can replace the minimal scheduling that can be performed by this utility.
Program ALEXCMDS reads the input control cards searching for JES2 automatic commands (i.e. = in column one). It will only execute the commands relative to that day and time. The program will allow you to specify a day of the week and will perform simple holiday processing when issuing the JES2 automatic commands.
JES2 automatic commands allow you to specify a time of day or an interval of time for executing other JES2 commands. I will provide some examples of JES2 automatic commands and try to explain their function. The following JES2 automatic command would be issued to start JOB POPUTD10 at 08:00:
$TA,T=08.00,'$VS,''S JOB,N=POPUTD30'''
Once this command is issued it is deleted. If this command were issued at 10:00, two hours after 08:00, JES2 would see that the time has past and would start JOB POPUTD30 at that time. The $VS command is used by JES2 to issue MVS commands. The next command is an interval command, and will continue processing throughout the day:
$TA,I=600,'$DU,LNE1'
This command would execute every 10 minutes (600 seconds) and would display the status of the NJE connection between JES2 and another NJE Node. If you wished the above command to begin execution at a specific time of day (e.g. 12:45) and then execute in 10 minute intervals you would enter:
$TA,I=600,T=12.45,'$DU,LNE1'
Utility program ALEXCMDS can be used with JES2 automatic commands so that commands are only issued if the time has not past or if the day of the week is correct (e.g. not run jobs on the weekends).
There are two DD statements available to ALEXCMDS, CMDIN and HOLIDAY. The HOLIDAY DD statement will allow you to specify which days of the year you wish to be considered as holidays. The CMDIN DD statement is where you would specify the JES2 automatic commands that you wish to process. You must place an = in column one for every command in the input stream that you wish processed by program ALEXCMDS as an automatic command. If there is an = in column one then it must be an automatic command ($TA), and it must specify a time value (i.e. T=). If you do not wish ALEXCMDS to process it as an automatic command then leave column one blank and ALEXCMDS will pass the command to MVS or JES2.
SCHEDULING
To provide further control over the execution of the command you would use columns two through eight to specify the day of the week, or whether it should execute even it is a holiday. A nonblank character in column two is for Saturday, column three is for Sunday, ..., column eight is for Friday. If an H is placed in column two through eight then this command would execute on that day even it is a holiday. There are also three special keywords, which if used must begin in column two. The keywords are: EVERY, for execute command every day, FIRST, for the first day of the month (e.g. 12/01/93), and LAST, for the last day of the month (e.g. 11/30/93 or 12/31/93).
A sample of the JCL and the input control cards will be provided:
PROCEDURE JCL
//COMMANDS PROC PARMLIB='SYS2.PARMLIB',MEMBER=
//STEP1 EXEC PGM=ALEXCMDS
//HOLIDAY DD DSN=&PARMLIB(HOLIDAY),DISP=SHR
//CMDIN DD DSN=&PARMLIB(&MEMBER),DISP=SHR
//SYSUDUMP DD SYSOUT=A
HOLIDAY Control Cards
* Asterisk in col 1 for comment; date must begin in col 1
11/25/93
11/26/93
12/24/93
12/25/93
12/31/93
CMDIN Control Cards
* Asterisk in col 1 is comment here also
* Next statement would be executed if the time has not past
= $TA,T=07.00,'$VS,''I SMF'''
* Next statement would will only execute on Monday, if not a
* holiday & if not past 08:00. Monday is non-blank in col 4
= M $TA,T=08.00,'$VS,''S JOB,N=POPUTD30'''
To schedule your daily tasks an automatic command should be timed to execute at midnight. Program ALEXCMDS would then read through the CMDIN input stream and determine which tasks should be scheduled for that day. It would then issue all of the automatic commands with their specific times as well as issuing an automatic command to execute on the next midnight. Automatic commands are deleted if the system is IPL'ed, so scheduling of automatic commands should be included at IPL time.
HOME | TOP | Back | Company History | Areas of Expertise | Project History |