Previous Topic

Next Topic

Book Contents

Book Index

Solution – Details

The rule consists of the following four ON blocks:

Opening the Rule

  1. From the IOA Primary Option Menu, enter the Rule Definition facility by typing BR in the COMMAND field and pressing Enter. The Rule Definition entry panel is displayed:

    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

  2. If the library name in the LIBRARY field in this example is different from your Control-M/Analyzer RULES library name, change it to appear as shown in this example.
  3. Leave the RULE field blank. Press Enter. The Rule List screen is displayed.
  4. From the list of rules defined, select ARWARN02 for browsing as follows:
    1. Place the cursor in the OPT field, to the left of the rule named ARWARN02.
    2. Type B and press Enter. The Rule Definition screen for ARWARN02 is displayed.

    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

  5. The first ON block in this rule is called INIT, as defined in the line that begins "EXECUTE INIT." This block is defined as an ON DATA block, set to ALWAYS perform the DO actions that follow it in the ON DATA block definition.

    The purpose of this ON block is to initialize the values of variables that are used later in the rule. These variables are

    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:

  6. Examine the SCROLL field in the upper right area of the screen. If this field does not contain the value CRSR, place the cursor in the SCROLL field and type CRSR.
  7. To bring the first line of the INPUT block to the top of the screen, place the cursor on the line beginning with the words EXECUTE INPUT and press PF08/PF20, or enter the DOWN command. The first line of the block is now displayed at the top of the screen, and its entire contents are now visible.

    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:

  8. Now see how this ON block structure is implemented in the INPUT ON block.

    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.

  9. Using PF08/PF20, or entering the DOWN command, scroll forward until you see the ON block called EXECUTE CHECK.
  10. Place the cursor on the line beginning with EXECUTE CHECK and press PF08/PF20 or enter the DOWN command.

    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:

    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.

  11. Position the cursor on the line beginning with the string "IF DIFFERENCE > 0" and press PF08/PF20, or enter the DOWN command.

    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

  12. All that is left is for the rule definition to terminate it after the entire report has been examined. This is done with the ON block called ENDJOB.
    1. Press PF07/PF19 or enter the UP command, to scroll backward until you see the ON block ENDJOB.
    2. Place the cursor on the line beginning with the string "EXECUTE ENDJOB" and press PF08/PF20 or enter the DOWN command.

    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:

Parent Topic

Problem 2: Check Payroll Totals