The rule consists of the following four ON blocks:
Opening the Rule
Figure 60 Control-M/Analyzer Rule Definition Entry Panel
-------------- CONTROL-M/ANLAYZER RULE DEFINITION - ENTRY PANEL ------------(BR)
COMMAND ===>
SPECIFY LIBRARY, RULE
LIBRARY ===> CTB.PROD.RULES
RULE ===> (Blank for rule selection list)
USE THE COMMAND "SHPF" TO SEE PFK ASSIGNMENT 13.41.48
Figure 61 Rule Definition Screen for Rule ARWARN02
LIBRARY : CTB.PROD.RULES RULE : ARWARN02
COMMAND ===> SCROLL===> CRSR
+---------------------------------- BROWSE -----------------------------------+
| OWNER M66 GROUP INTRAC |
| UPDATED 03/04/99 - 15:30:05 BY M66 |
| DESC SUMMARIZE AND CHECK PAYROLL TOTALS |
| OPTIONS |
| =========================================================================== |
| EXECUTE INIT UPON C |
| ON DATA |
| ALWAYS |
| DO SET = ERRORCOUNT=0 C |
| DO SET = SLSNO=0 C |
| DO SET = BLANK=' ' C |
| DO PRINT = ******** PAYROLL CONTROL TOTALS ********* F C |
| =========================================================================== |
| EXECUTE INPUT UPON C |
| ON SYSOUT PROCST PGMST STEP01 DDNAME SYSUT2 JOBNM |
| MODE PG LINECT 0000 DATASTAMP |
| WHEN LINE 001 - 060 COL 001 - 025 STOP AND/OR |
| STRING = 'YTD COMMISSIONS PAID' |
| DO EXTRACT = YTDPAID |
| LEVEL 0 LINE +000 COL 0068 - 0078 PROCESS TYP |
PLEASE FILL IN RULE DEFINITION. 14.46.10
Defining ON Blocks for this Rule
The purpose of this ON block is to initialize the values of variables that are used later in the rule. These variables are
This count will be used, after examining the entire report, to determine if the rule should terminate OK or NOTOK.
Because the report you are producing is distributed to various employees, and because the individual salesperson earnings printed on the report are confidential, the rule uses a salesperson number rather than a name. This number will be a sequential number assigned by you.
Alternatively, you may use an AutoEdit variable named %%BLANK in your print line.
Many rules have ON blocks such as this one to initialize variables and perform other setup functions.
You can now look at the next ON block, called INPUT. To get a better look at this entire ON block, do the following to move its first line to the top of the screen:
Figure 62 INPUT Block
LIBRARY : CTB.PROD.RULES RULE : ARWARN02
COMMAND ===> SCROLL===> CRSR
+---------------------------------- BROWSE -----------------------------------+
| EXECUTE INPUT UPON C |
| ON SYSOUT PROCST PGMST STEP01 DDNAME SYSUT2 JOBNM |
| MODE PG LINECT 0000 DATASTAMP |
| WHEN LINE 001 - 060 COL 001 - 025 STOP AND/OR |
| STRING = 'YTD COMMISSIONS PAID' |
| DO EXTRACT = YTDPAID |
| LEVEL 0 LINE +000 COL 0068 - 0078 PROCESS TYP |
| DO EXTRACT = YTDOWED |
| LEVEL 0 LINE +001 COL 0068 - 0078 PROCESS TYP |
| DO EXTRACT = CURRENT |
| LEVEL 0 LINE +002 COL 0068 - 0078 PROCESS TYP |
| DO BLOCK = CHECK ARG C |
| =========================================================================== |
| EXECUTE ENDJOB UPON C |
| ON DATA |
| IF ERRORCOUNT>0 C |
| DO PRINT = %%BLANK F C |
| DO PRINT = ****** ERRORS IN COMMISSIONS ABOVE ****** F C |
| DO TERMINAT = NOTOK COD 0999 |
| ELSE |
PLEASE FILL IN RULE DEFINITION. 15.00.48
Before examining this screen in detail, you need to first understand how a "data source" related ON block is structured.
Figure 63 ON Block Structure
When you need to extract data from a report or file, you use an ON block structure as shown in Figure 63. An ON block consists of the following parameters:
If you are not familiar with Job Control Language (JCL), the details for this part of the Control-M/Analyzer rule can be provided by your system administrator. The ON SYSOUT parameter instructs Control-M/Analyzer to look in the JCL in the first job step (STEP01). There, Control-M/Analyzer will find a data definition (DD) JCL statement labeled SYSUT2. This is the statement that gives Control-M/Analyzer the information it needs, in order to describe the characteristics of the report file.
As defined in this block, when the rule finds the data string "YTD COMMISSIONS PAID" anywhere between columns 1 through 25, in lines 1 through 60, meaning, on any line of the report, Control-M/Analyzer is instructed to DO the balancing actions. The following DO EXTRACT and DO BLOCK instructions are performed repetitively, every time the WHEN search criteria are satisfied:
Figure 64 Extract from the Sales Commission Detail Report
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9---
INTRAC INC. SALES OPERATIONS DEPARTMENT DATE 10/10/01 TIME 23:45 PAGE 4
S A L E S C O M M I S S I O N S D E T A I L FROM 10/10/01 TO 10/10 01
|SALESPERSON HARVEY J. JONES (197) | INVOICE # | INVOICE DATE | AMOUNT | STATUS
| | CJ39394 | 02/02/00 | 2040.00| COLLECTION|
| | CJ98443 | 03/03/00 | 245.00| |
| | MJ24545 | 04/04/00 | 10344.40| |
| | RJ10030 | 01/02/00 | 5329.39| |
| | RJ12233 | 02/02/00 | 5000.00 | |
| | RJ30021 | 03/02/00 | 16670.10 | |
| | RJ32991 | 02/03/00 | 30300.44 | |
| | RJ33939 | 03/03/00 | 900.25 | |
| | RJ38001 | 04/04/00 | 1000.23 | |
| | RJ93043 | 04/04/00 | 415.89 | |
+--------------------------------------------------------------------------------------------
|TOTAL SALES - THIS MONTH 72245.70 (PAID IN FULL
|ADJUSTMENTS -5800.70
|YTD SALES (INCLUDING THIS MONTH) -127879.00
|YTD COMMISSIONS PAID 0.00
|YTD COMMISSIONS OWED -5115.00
|COMMISSION PAYROLL AMOUNT 5115.00
---------------------------------------------------------------------------------------------
Now that the information has been extracted, the rule performs balancing actions on the data. Therefore, a separate ON DATA block is defined in to perform the balancing actions.
Figure 65 The EXECUTE CHECK ON Block
LIBRARY : CTB.PROD.RULES RULE : ARWARN02
COMMAND ===> SCROLL===> CRSR
+---------------------------------- BROWSE -----------------------------------+
| =========================================================================== |
| EXECUTE CHECK UPON C |
| ON DATA |
| ALWAYS |
| DO SET = CALCAMT=YTDPAID+CURRENT C |
| DO SET = DIFFERENCE=ABS(CALCAMT-YTDOWED) C |
| DO SET = SLSNO=INT(SLSNO+1) C |
| DO PRINT = SALESPERSON #%%SLSNO F C |
| DO PRINT = YTD COMM. PAID %%YTDPAID F C |
| DO PRINT = CURRENT AMOUNT %%CURRENT F C |
| DO PRINT = ----------------------------------------- F C |
| DO PRINT = CALCULATED TOTAL %%CALCAMT F C |
| DO PRINT = REPORTED TOTAL %%YTDOWED F C |
| DO PRINT = ----------------------------------------- F C |
| DO PRINT = DIFFERENCE ***** %%DIFFERENCE ***** F C |
| DO PRINT = %%BLANK F C |
| IF DIFFERENCE>0 C |
| DO PRINT = ***** SERIOUS PAYROLL ERROR - SEE ABOVE ***** F C |
| DO PRINT = %%BLANK F C |
| DO SET = ERRORCOUNT=ERRORCOUNT+1 C |
PLEASE FILL IN RULE DEFINITION. 15.06.39
The ON block called CHECK performs calculations and prints information to the balancing report. Generally, calculations are performed using DO SET parameters. DO SET assigns a value to a variable. Output to the report is performed with DO PRINT parameters.
The ON block CHECK performs the following actions:
The ABS function is one of the many functions available in Control-M/Analyzer to assist the balancing effort. The ABS function is used because the difference should always print as a positive number. When there is a difference, you do not know which amount is the correct amount (CALCAMT or YTDOWED). All you are concerned with in this instance is that there is a difference.
You can compare these instructions to the actual SYSUSER report, as shown in Figure 68.
The last part of this ON block contains an IF and ELSE combination of parameters.
Figure 66 IF and ELSE Parameters
LIBRARY : CTB.PROD.RULES RULE : ARWARN02
COMMAND ===> SCROLL===> CRSR
+---------------------------------- BROWSE -----------------------------------+
| IF DIFFERENCE>0 C |
| DO PRINT = ***** SERIOUS PAYROLL ERROR - SEE ABOVE ***** F C |
| DO PRINT = %%BLANK F C |
| DO SET = ERRORCOUNT=ERRORCOUNT+1 C |
| ELSE |
| DO PRINT = COMMISSIONS OK F C |
| DO PRINT = %%BLANK F C |
| =========================================================================== |
| EXECUTE UPON C |
| ON |
======= >>>>>>>>>>>>>>> END OF RULE DEFINITION PARAMETERS <<<<<<<<<<<<<<< =====
PLEASE FILL IN RULE DEFINITION. 15.07.59
This IF and ELSE definition determines for each salesperson if there is a problem in the balancing report, as follows:
Terminating the Rule
Figure 67 ON Block ENDJOB
LIBRARY : CTB.PROD.RULES RULE : ARWARN02
COMMAND ===> SCROLL===> CRSR
+---------------------------------- BROWSE -----------------------------------+
| EXECUTE ENDJOB UPON C |
| ON DATA |
| IF ERRORCOUNT>0 C |
| DO PRINT = %%BLANK F C |
| DO PRINT = ****** ERRORS IN COMMISSIONS ABOVE ****** F C |
| DO TERMINAT = NOTOK COD 0999 |
| ELSE |
| DO PRINT = %%BLANK F C |
| DO PRINT = --------- COMMISSIONS ARE PERFECT --------- F C |
| DO TERMINAT = OK COD 0000 |
| =========================================================================== |
| EXECUTE CHECK UPON C |
| ON DATA |
| ALWAYS |
| DO SET = CALCAMT=YTDPAID+CURRENT C |
| DO SET = DIFFERENCE=ABS(CALCAMT-YTDOWED) C |
| DO SET = SLSNO=INT(SLSNO+1) C |
| DO PRINT = SALESPERSON #%%SLSNO F C |
| DO PRINT = YTD COMM. PAID %%YTDPAID F C |
| DO PRINT = CURRENT AMOUNT %%CURRENT F C |
PLEASE FILL IN RULE DEFINITION. 15.08.50
Because ON block ENDJOB is the block that sequentially follows ON block INPUT, it is executed right after Control-M/Analyzer has finished executing ON block INPUT—that is, after the rule has scanned the entire report and found and processed all of the lines it was searching for.
ON block ENDJOB performs one of the following two actions, depending on whether there were any errors found when the data was checked:
Note: You can create your own rules, and you can choose your own codes to signify various errors.
Parent Topic |