FR710PC CLP
The CL program FR710PC is a control language program designed to serve as an intermediary between the prompt program FR710P and the report generation program FR710C. Its primary purpose is to receive parameters from FR710P, call the FR710C program to generate the Freight Out Accrual Report, and display a status message upon completion. Below is a detailed explanation of the process steps, business rules, tables used, and external programs called.
Process Steps of the FR710PC Program¶
- Program Declaration and Parameter Definition:
- Purpose: Declares the program and its input parameters.
-
Steps:
- The program is defined with three input parameters:
&P$CO: A 2-character field for the company number.&P$RDAT: An 8-character field for the report date (inCCYYMMDDformat).&P$FGRP: A 1-character field for the file group ('G' or 'Z').- Declares a variable
&MSG(512 characters) to store a status message.
-
Call the Report Generation Program:
- Purpose: Invokes the
FR710Cprogram to generate the Freight Out Accrual Report. -
Steps:
- Calls the
FR710Cprogram, passing the parameters&P$CO,&P$RDAT, and&P$FGRPdirectly. - Note: A commented-out
SBMJOBcommand suggests that the program could submitFR710Cas a batch job, but the current implementation runs it interactively within the same job.
- Calls the
-
Display Status Message:
- Purpose: Informs the user that the report has been printed.
-
Steps:
- Sets the
&MSGvariable to the message "Freight Out Accrual Report By Company Has Been Printed". - Sends the message to the external program message queue (
*EXT) usingSNDPGMMSGwith message IDCPF9898from theQCPFMSGmessage file, indicating a status message. - Delays the job for 2 seconds using
DLYJOBto ensure the message is visible to the user before the program ends.
- Sets the
-
Program Termination:
- Purpose: Ends the program cleanly.
- Steps:
- The
ENDPGMcommand terminates the program, returning control to the calling program (FR710P).
- The
Business Rules¶
- Parameter Validation: The program assumes that the input parameters (
&P$CO,&P$RDAT,&P$FGRP) are validated by the calling program (FR710P). No additional validation is performed inFR710PC. - Report Execution: The program is responsible for triggering the report generation by calling
FR710C. The commented-outSBMJOBcommand suggests an alternative batch processing option, which may be used for performance or scheduling purposes but is not currently active. - User Feedback: The program provides immediate feedback to the user via a status message, ensuring they are informed of the report's completion.
- File Group Handling: The
&P$FGRPparameter ('G' or 'Z') determines which file set (gglcontorzglcont) is used byFR710Cfor report data, as set up by the file overrides inFR710P. - Assumption of Success: The program assumes that
FR710Cexecutes successfully and does not include error handling for cases whereFR710Cfails.
Tables Used¶
- None: The
FR710PCprogram itself does not directly reference or access any database tables. Any table access (e.g.,glcont,gglcont, orzglcont) is handled by theFR710Pprogram (via file overrides) or theFR710Cprogram (for report data retrieval).
External Programs Called¶
- FR710C: The main report generation program, called with parameters
&P$CO(company number),&P$RDAT(report date), and&P$FGRP(file group). This program is responsible for producing the Freight Out Accrual Report. - SNDPGMMSG (System Command): Used to send a status message to the user. While not a standalone program, it interacts with the system message queue (
QCPFMSG) to display the completion message.
Additional Notes¶
- Commented SBMJOB: The commented-out
SBMJOBcommand indicates a potential design choice to runFR710Cas a batch job, which could allow for asynchronous processing or better resource management. The current interactive call suggests that immediate execution is preferred in the current implementation. - Minimal Error Handling: The program does not check for errors returned from
FR710Cor handle exceptions, relying onFR710Pfor input validation andFR710Cfor report generation logic. - Purpose as Intermediary:
FR710PCacts as a simple pass-through to invokeFR710Cand provide user feedback, with no significant business logic or data manipulation.
This program is a lightweight coordinator between the user interface (FR710P) and the report generator (FR710C), ensuring the report is triggered with the correct parameters and the user is notified of its completion.