Skip to content

AP790 OCL

The provided document appears to be an Operation Control Language (OCL) program snippet, typically used in IBM System/3x or AS/400 environments to control job execution, particularly for RPG (Report Program Generator) programs. Below, I’ll explain the process steps of the OCL program, identify any external programs called, and note any tables used based on the provided snippet.

Process Steps of the OCL Program

OCL is a job control language used to define how programs, such as RPG programs, are executed, including file assignments, printer settings, and conditional logic. Here’s a step-by-step breakdown of the process defined in the provided OCL snippet:

  1. Program Identification and Purpose:
  2. The comment lines (// * 'PRINTING 1099 FILE EDIT') indicate that this OCL program is related to printing or editing a 1099 file, likely for tax reporting purposes (e.g., IRS Form 1099).
  3. The // GSY2K comment might refer to a specific system, module, or compliance indicator (e.g., Year 2000 compliance), but it’s not directly actionable in the OCL.

  4. Loading the Program:

  5. // LOAD AP790: This command loads the RPG program named AP790. The LOAD statement initiates the execution of the specified program, which is presumably an RPG program responsible for processing or printing the 1099 file.

  6. Conditional File Assignment:

  7. // IF ?9?/G +: This is a conditional statement checking the value of a substitution variable ?9?. In OCL, substitution variables (denoted by ?n?) are placeholders for values passed to the job at runtime, often used to determine file names, labels, or other parameters.

    • If the condition ?9?/G is true (e.g., the variable ?9? equals 'G'), the program executes the following file assignment:
    • FILE NAME-AP1099,LABEL-AP1099,DISP-SHR: Assigns a file named AP1099 with the label AP1099 and specifies shared disposition (DISP-SHR), meaning the file can be accessed by multiple jobs concurrently.
    • If the condition is false, the program executes:
    • FILE NAME-AP1099,LABEL-?9?AP1099,DISP-SHR: Assigns the same file name AP1099, but the label is dynamically constructed by appending the value of ?9? to AP1099 (e.g., if ?9? is 2023, the label becomes 2023AP1099). The disposition remains shared (DISP-SHR).
  8. Printer Configuration:

  9. // PRINTER NAME-PRINT,CPI-15: This defines the printer settings for the job.

    • NAME-PRINT: Specifies the printer output queue or device named PRINT.
    • CPI-15: Sets the printer to 15 characters per inch, which controls the font density for the printed output, likely to ensure the 1099 forms are formatted correctly.
  10. Program Execution:

  11. // RUN: This command triggers the execution of the loaded program (AP790) with the specified file and printer configurations. The RPG program AP790 would then process the AP1099 file, likely performing tasks such as reading, editing, or printing 1099-related data.

External Programs Called

  • AP790: This is the primary RPG program loaded and executed by the OCL script. It is responsible for the core logic of processing or printing the 1099 file. No other external programs are explicitly called in the provided OCL snippet.

Tables Used

  • The OCL snippet does not explicitly reference any tables. In RPG programs, tables are typically defined within the RPG source code (e.g., using TAB definitions or arrays) rather than in the OCL. Since the snippet only covers the OCL portion and not the RPG program (AP790) itself, no tables are identified here.
  • The file AP1099 is referenced, but it is a data file, not a table. If AP790 uses tables internally (e.g., for lookup or validation purposes), they would be defined in the RPG program’s source code, which is not provided.

Additional Notes

  • Substitution Variable (?9?): The use of ?9? suggests the OCL program is designed to be flexible, allowing the file label to vary based on runtime parameters (e.g., different years or versions of the 1099 file). The condition ?9?/G likely checks for a specific value to determine the file label.
  • File Disposition (DISP-SHR): The shared disposition indicates that the AP1099 file can be accessed by other jobs, which is common in multi-user environments like AS/400.
  • Limitations of the Snippet: The provided OCL is a partial job control script. The actual processing logic (e.g., calculations, validations, or report formatting) resides in the AP790 RPG program, which is not included. To fully understand the tables or additional files used, the RPG source code would need to be analyzed.
  • Environment: This OCL syntax is specific to IBM midrange systems (e.g., System/38 or AS/400). The AP1099 file is likely a database file containing 1099 data, and AP790 is an RPG program that processes this data for printing or editing.

If you have access to the AP790 RPG source code or additional OCL snippets, I can provide a more detailed analysis of the tables or external programs involved. Let me know if you’d like me to search for related information or clarify any specific aspect!