Example 1 -- Employee Compensation Status Report

This program reads a file that contains employee data and produces a report that lists the employees in alphabetical order, the employee's salary status, and the employee's salary.
idmscu
This program reads a file that contains employee data and produces a report that lists the employees in alphabetical order, the employee's salary status, and the employee's salary.
The first out of the two following figures shows the contents of the input file for the CA Culprit run. The second one is the Sequential Parameter Listing for the CA Culprit run; this listing shows the CA Culprit parameters coded for Report 01. The third figure illustrates the output for Report 01.
Parameters coded for the report are described below:
Input Definition Parameters
The input file contains fixed-length 80-byte records. The input fields required by the CA Culprit run are EMP-NAME, EMP-LNAME, and SALARY. Each field is defined on a REC parameter. The first two fields are alphanumeric; EMP-LNAME redefines bytes 11 through 25 of EMP-NAME. SALARY is a 10-byte packed decimal field with two implied decimal places. An auto-header is specified for EMP-NAME.
Output Definition Parameters
The output for Report 01 is a details-only printed report with 70 characters per line. The detail lines sort in alphabetical order by employee last name. Report 01 contains a title line, column headers, and detail lines; it does not contain total lines because the OUTPUT parameter specifies a details-only report.
The third figure shows a title line printed at the top of the report page. The blank line that follows the title line is specified by header line 1 on the type 4 edit parameter. Header line 2 specifies column headers for relative column numbers 10, 20, and 30. Two blank lines follow the column headers because a spacing code appears in column 10 of the type 4 edit parameter that specifies the literal 'SALARY'.
Report 01 contains three detail lines. Detail line 1 contains the employee's name and salary status. Detail line 2 contains the employee's annual salary if the employee is salaried; detail line 3 contains the employee's hourly wages if the employee is paid on an hourly basis. Detail lines 2 and 3 specify the same output field size, format code, and spacing code; the spacing code overprints on the output line.
Work Field Parameters
Report 01 contains two report-specific work fields. MESSAGE is an alphanumeric work field initialized to eight blanks. Different literal values can be moved to MESSAGE by using process parameter statements.
HR-SALARY is a numeric work field that contains two implied decimal places. The output field size for HR-SALARY is 31 digits because a decimal place is specified. The SZ= keyword expression on the type 5 edit parameter overrides the default output field size for this field.
Process Parameters
The type 7 procedure logic for Report 01 determines whether the employee earns an annual salary of $19,000 or less. If the test is true, the procedure logic branches to sequence number 500 where the employee's hourly salary is computed, the literal 'HOURLY' is moved to the work field MESSAGE, and detail lines 1 and 3 are selected for extracting. If the test is not true, the literal 'SALARIED' is moved to MESSAGE, and detail lines 1 and 2 are selected for extracting.
Input File Layout for the Employee Compensation Status Report:
                     Record   Size:     80 bytes             Block    Size:      80 bytes             Record   Format:   Fixed        Data     Field      Start Position   Length (bytes)   Data Type         Employee     name     1               25              Alphanumeric         Department   name  30               20              Alphanumeric         Job  title        50               20              Alphanumeric         Salary             70               10              Packed decimal
CA Culprit Parameters for the Employee Compensation Status Report:
 mm/dd/yy                      SEQUENTIAL PARAMETER LISTING             Vnn.n  PAGE    1  00 ** SYSIN **                            IN  80    INSTALLATION SECURITY OPTION IS NO                                            REC EMP-NAME    1 25         'EMPLOYEE' 'NAME'                                            REC EMP-LNAME  11 15                                            REC SALARY     70 10 3 DP=2                                            01OUT  70 D                                            01SORT EMP-LNAME                                            010MESSAGE '        '  HR-SALARY DP=2                                            013EMPLOYEE COMPENSATION STATUS                                            01410001 ' '                                            0142*010 'EMPLOYEE'                                            0142*020 'STATUS'                                            0142*0300'SALARY'                                            0151*010 EMP-NAME                                            0151*020 MESSAGE                                            0152*030+SALARY      SZ=8 F$                                            0153*030+HR-SALARY   SZ=8 F$                                            017010   IF SALARY LE 19000 500                                            017      MOVE 'SALARIED' TO MESSAGE                                            017      TAKE (1 2)                                            017500   MOVE 'HOURLY  ' TO MESSAGE                                            017      COMPUTE (SALARY DIVIDE 52) DIVIDE 40  HR-SALARY                                            017      TAKE (1 3)
Employee Compensation Status Output:
 REPORT NO. 01        EMPLOYEE COMPENSATION STATUS mm/dd/yy PAGE     1                 EMPLOYEE               STATUS          SALARY        ROY       ANDALE               SALARIED       $33,500.00        MICHAEL   ANGELO               HOURLY              $8.65        HARRY     ARM                  SALARIED       $46,000.00        MONTE     BANK                 SALARIED       $80,000.00        JUNE      BLOOMER              HOURLY              $7.21        CHARLES   BOWER                SALARIED       $38,000.00        C.        BREEZE               SALARIED       $38,000.00        TERRY     CLOTH                SALARIED       $38,000.00        BETH      CLOUD                SALARIED       $52,750.00        HERBERT   CRANE                SALARIED       $75,000.00        CAROLYN   CROW                 SALARIED       $37,500.00        ALAN      DONOVAN              SALARIED       $33,500.00        JANE      DOUGH                SALARIED       $33,000.00        JANE      FERNDALE             SALARIED       $22,500.00        PHINEAS   FINN                 SALARIED       $45,000.00        TOM       FITZHUGH             HOURLY              $6.25        GEORGE    FONRAD               HOURLY              $7.09        JAMES     GALLWAY              SALARIED       $33,000.00        ROBIN     GARDNER              HOURLY              $6.73        JENNIFER  GARFIELD             SALARIED       $65,000.00        PERCY     GRANGER              SALARIED       $34,500.00        VLADIMIR  HEAROWITZ            SALARIED       $33,000.00        HENRIETTA HENDON               SALARIED      $240,000.00        EDWARD    HUTTON               SALARIED       $44,000.00        JOCK      JACKSON              SALARIED       $34,000.00        JAMES     JACOBI               SALARIED       $55,000.00        JULIE     JENSEN               SALARIED       $37,000.00        RUPERT    JENSON               SALARIED       $82,000.00        CYNTHIA   JOHNSON              HOURLY              $6.49        DOUGLAS   KAHALLY              SALARIED       $20,000.00        JOE       KASPAR               SALARIED       $31,000.00        MARIANNE  KIMBALL              SALARIED       $45,000.00        DORIS     KING                 HOURLY              $6.97        TERENCE   KLWELLEN             SALARIED       $43,000.00        SANDY     KRAAMER              HOURLY              $6.73        BURT      LANCHESTER           SALARIED       $54,500.00        HERBERT   LIPSICH              HOURLY              $8.89        LARRY     LITERATA             SALARIED       $37,500.00        RENE      MAKER                SALARIED       $85,000.00        CAROL     MCDOUGALL            HOURLY              $8.65        DANIEL    MOON                 SALARIED       $72,000.00        RICHARD   MUNYON               SALARIED       $36,000.00        BRIAN     NICEMAN              HOURLY              $6.73        KATHERINE O'HEARN              SALARIED       $42,500.00        MADELINE  ORGRATZI             SALARIED       $39,000.00        THEMIS    PAPAZEUS             SALARIED      $100,000.00        LAURA     PENMAN               SALARIED       $39,000.00        ELEANOR   PEOPLES              SALARIED       $80,000.00        JOHN      RUPEE                SALARIED       $80,000.00        NANCY     TERNER               HOURLY              $6.25        MARK      TIME                 SALARIED       $33,000.00        RALPH     TYRO                 SALARIED       $20,000.00        RICHARD   WAGNER               SALARIED       $47,000.00        ROGER     WILCO                SALARIED       $80,000.00