SRI Technologies

Last Modified
Date: 11-Dec-2005
Time: 02:53:30
Index

Project Name: SqrPlus Event Driven Sqr's (EDS) System
System Name: Demo System
Application Name: Demo Application
Source File: DEMO06.EDS
Program Name: Demo Program 06
Program Description: Program that demonstrates Event Driven Sqr's (EDS) capability of SqrPlus product. Program produces MAIN Report on Pay Data and SUB report on leave data for employees.
Menu Navigation: None
Author: Scott M

Program Change Log:
Sl.NODateAuthorRemark
1.02-Sep-2005Scott.MInitial Coding

Main Tables Used:
SLNO.Table NameAccess ModeProcedure NameRemarks
1NoneN/AN/ANot Applicable

Input Parameters:

File Inputs/Outputs:
Sl.NOFileModeRemarks
1.c:\temp\demo05.csvInputData file for input stream that contains pay data for employees. Data file has multiple rows for given employee. Data is pre sorted on Company, PayGroup and Dept.

Initial Processing:
 

Initialise Printer:

  1. Initialise printer as line printer in portrait mode.

Init Report:

  1. Set Current Date and Time.
  2. Get Report Parameters, RunControl values.

Main Processing:
 

Generate Main Report using EDS:

  1. Generate report using EDS (Event Driven Sqr's) Methodology.
  2. Open Input file, abort if unsucessful.
  3. Ignore employees with tax less than 700.
  4. Do not ignore if leave data is found for the employee.
  5. If leave data is found, report them as sub-report after printing pay data for that employee.
  6. Initialise EDS system with MAIN Report Type as 'Pay'.
  7. Read each record from input stream (pay csv file).
  8. Submit each record to EDS System.
  9. Exit EDS system on end of input stream data.

Generate Sub Report using EDS:

  1. Initialise EDS system with SUB Report Type as 'leave'.
  2. Read each record from input stream (pre-loaded array) for current employee.
  3. Submit each record to EDS System.
  4. Exit EDS system on end of data for current employee.

EOJ Processing:
 

End Of Report Event:

  1. Print Grand Totals and number of records processed from input stream.

Terminate:

  1. Set end of report flag.

See Also:

  1. Demo05.sqr

Include Files:

  1. d:\sqrplus\sqr\sqrp-eds.sqc

Procedure Call Tree:

    01  BEGIN-PROGRAM
        02  INIT-REPORT 
        02  REPORT 
            03  LOAD-LEAVE-DATA 
            03  SRIT-EDS-BEGIN-PAY 
            03  SRIT-EDS-SET-PAGEBREAK 
            03  SQRP-EDS-GET-FLD-BY-NUM 
            03  SRIT-EDS-PROCESS-PAY 
            03  SRIT-EDS-END-PAY 
            03  SRIT-EDS-NEW-LINE 
            03  END-OF-REPORT 
        02  TERMINATE 
        02  BEGIN-HEADING (indirect call) 
            03  SQRP-EDS-PRINT-TXT-RJUST 
        02  BEGIN-FOOTING (indirect call) 


Selected Procedures:

  1. Procedure Name: MY-PAY-INIT-VARIABLES
    Procedure Description: Initialise variables
    Procedure Type: Global

    Arguments/Parameter:
    SLNO.VariableMode
    N/ANoneNot Applicable

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Initialise variables:

    1. Called by EDS System.
    2. Initialise variables used in detail section. This is required as detail section reports data that is built from multiple records from the input stream.

  2. Procedure Name: MY-PAY-SKIP
    Procedure Description: Skip Input
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1#SKIPBy Reference

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Skip Test:

    1. Called by EDS System.
    2. Tell EDS to include qualified employees in the report. Include if tax is >= 700 or leave data is found for the employee.

  3. Procedure Name: MY-PAGE-BREAK
    Procedure Description: Report Page Break
    Procedure Type: Global

    Arguments/Parameter:
    SLNO.VariableMode
    N/ANoneNot Applicable

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Process Page Break:

    1. Called by EDS System when page overflow is detected.
    2. Start new page.
    3. Print ' Contd...' on top of each page for current detail section based on break level which may be 1 , 2 or 3 as there are three key fields e.g. company, paygroup, department.

  4. Procedure Name: PAY-BEFORE-COMPANY
    Procedure Description: Company Before Event
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$COMPANYBy Value
    2$EFFDTBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Company Before Event:

    1. Called by EDS System when Value in company changes.
    2. Force new page but not first time.
    3. Print Company code and Description.

  5. Procedure Name: PAY-BEFORE-PAYGROUP
    Procedure Description: Paygroup Before Event
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$COMPANYBy Value
    2$PAYGROUPBy Value
    3$EFFDTBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Paygroup Before Event:

    1. Called by EDS System when Value in Paygroup changes.
    2. Print Paygroup Code and Description.

  6. Procedure Name: PAY-BEFORE-DEPT
    Procedure Description: Department Before Event
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$COMPANYBy Value
    2$PAYGROUPBy Value
    3$DEPTBy Value
    4$EFFDTBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Department Before Event:

    1. Called by EDS System when Value in Department changes.
    2. Print Department Code and Description.

  7. Procedure Name: MY-PAY-DETAIL-SECTION
    Procedure Description: Print Detail Section
    Procedure Type: Global

    Arguments/Parameter:
    SLNO.VariableMode
    N/ANoneNot Applicable

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Print Detail Section:

    1. Called by EDS System to print detail section.
    2. Print detail section fields.
    3. Call Leave Sub Report to report leave data.

  8. Procedure Name: PAY-AFTER-COMPANY
    Procedure Description: Company After Event
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$COMPANYBy Value
    2$EFFDTBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Company After Event:

    1. Called by EDS System after Value in Company changes.
    2. Print Company Totals and reset after printing.

  9. Procedure Name: PAY-AFTER-PAYGROUP
    Procedure Description: Paygroup After Event
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$COMPANYBy Value
    2$PAYGROUPBy Value
    3$EFFDTBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Paygroup After Event:

    1. Called by EDS System after Value in Paygroup changes.
    2. Print PayGroup Totals and reset after printing.

  10. Procedure Name: PAY-AFTER-DEPT
    Procedure Description: Department After Event
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$COMPANYBy Value
    2$PAYGROUPBy Value
    3$DEPTBy Value
    4$EFFDTBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Department After Event:

    1. Called by EDS System after Value in Department changes.
    2. Print Department Totals and reset after printing.

  11. Procedure Name: LEAVE-REPORT
    Procedure Description: Generate Leave Sub Report
    Procedure Type: Local

    Arguments/Parameter:
    SLNO.VariableMode
    1$EMPLIDBy Value

    Database Tables:
    SLNO.Table NameAccess ModeRemarks
    1NoneN/ANot Applicable

    Processing:

    Generate Sub Report using EDS:

    1. Initialise EDS system with SUB Report Type as 'leave'.
    2. Read each record from input stream (pre-loaded array) for current employee.
    3. Submit each record to EDS System.
    4. Exit EDS system on end of data for current employee.


Sample Output: