Skip to content

List of Use Cases Implemented in the Call Stack

The call stack for the rack pricing update process, as defined by the OCL and RPG programs (BB956P.ocl36.txt, BB9541.rpg36.txt, BB956P.rpg36.txt, BB9563.ocl36.txt, BB9563.rpg36.txt, BB9564.ocl36.txt, BB9564.rpg36.txt, BB9565.ocl36.txt, BB9565.rpg36.txt, BB9566.ocl36.txt, BB9566.rpg36.txt), implements several use cases related to updating and managing rack pricing data. Below is a comprehensive list of the use cases derived from the programs:

  1. Use Case 1: Create a Deduplicated Customer List for Rack Pricing
  2. Description: Generate a unique list of company and customer numbers from the customer master file (PRCTUM) for use in the rack pricing update process.
  3. Program: BB9541
  4. Details: Reads PRCTUM, checks for duplicates in BB956S, and writes new records to BB956S with an active flag ('A').

  5. Use Case 2: Validate User Input for Rack Pricing Update

  6. Description: Validate user-provided inputs (company number, customer number, and date) to ensure they are valid before proceeding with pricing updates.
  7. Program: BB956P
  8. Details: Interactively validates company number against BICONT, customer number against BB956S, and month (01–12). Handles Y2K date conversion and displays errors on a screen.

  9. Use Case 3: Filter and Validate Rack Pricing Records

  10. Description: Process rack pricing records to identify new pricing entries that match specific criteria (date, non-existing in PRCTUM, and specific container descriptions) and generate a report.
  11. Program: BB9563
  12. Details: Validates RKPRCE records against a provided date, checks for non-existence in PRCTUM, and verifies container descriptions ("BRAD PENN" or "DA LUBRICANTS") in GSCNTR1. Writes valid records to NEWPROD and a printed report.

  13. Use Case 4: Display New Pricing Records for User Review

  14. Description: Display new pricing records from NEWPROD for user review, allowing confirmation or cancellation.
  15. Program: BB9564
  16. Details: Reads up to 10 records from NEWPROD and displays company, location, product, container, and unit of measure on a screen. Supports cancellation.

  17. Use Case 5: Update Customer Master with New Pricing Records

  18. Description: Add new pricing records from NEWPROD to the PRCTUM customer master file, ensuring no duplicates.
  19. Program: BB9565
  20. Details: Checks for duplicates in PRCTUM and adds new records with an active flag ('A').

  21. Use Case 6: Generate Pricing Download File

  22. Description: Create a download file containing validated rack pricing records that match customer data in PRCTUM.
  23. Program: BB9566
  24. Details: Copies RKPRCE records to RKPRCEO (?9?PRCDOWN) if they match records in PRCTUM, after clearing the output file.

Function Requirement Document for Rack Pricing Update

Rack Pricing Update Function Requirements

Overview

The Rack Pricing Update function processes rack pricing data to generate a deduplicated customer list, validate inputs, filter pricing records, update the customer master file, and produce a download file for external use. The function takes inputs programmatically (no screen interaction) and ensures data integrity through validation and deduplication.

Inputs

  • Company Number (KYCO, 2 chars): Identifies the company.
  • Customer Number (KYCUST, 6 digits): Identifies the customer.
  • Date (KYDATE, 6 digits, YYMMDD): Date for pricing records.
  • Customer Master File (PRCTUM): Contains company number, customer number, product code, container code, unit of measure, and delete flag.
  • Rack Pricing File (RKPRCE): Contains company number, location, price class, product code, description, container code, unit of measure, date, and time.
  • Company Control File (BICONT): Contains company number and name.
  • Container File (GSCNTR1): Contains container code, descriptions, and type.

Outputs

  • Customer List File (BB956S): Deduplicated list of company and customer numbers.
  • New Pricing File (NEWPROD): Filtered pricing records.
  • Updated Customer Master File (PRCTUM): Updated with new pricing records.
  • Pricing Download File (RKPRCEO/?9?PRCDOWN): Validated pricing records for download.
  • Printed Report: Details of filtered pricing records.

Process Steps

  1. Create Deduplicated Customer List:
  2. Read PRCTUM records.
  3. Check for duplicates in BB956S using company and customer number.
  4. Write unique records to BB956S with active flag ('A').

  5. Validate Inputs:

  6. Verify KYCO exists in BICONT.
  7. Verify KYCUST exists in BB956S.
  8. Validate KYMO (month from KYDATE) is 01–12.
  9. Convert KYDATE to 8-digit format (e.g., 20YYMMDD) using Y2K logic:

    • If year (KYYR) >= 80, use century 19 (1900s); else, use 20 (2000s).
  10. Filter and Validate Pricing Records:

  11. Read RKPRCE records where date matches converted KYDATE.
  12. Check non-existence in PRCTUM using company, customer, product, container, and unit of measure.
  13. Validate container code in GSCNTR1, ensuring second description is "BRAD PENN" or "DA LUBRICANTS".
  14. Write valid records to NEWPROD (company, location, product, container, unit of measure).
  15. Generate printed report with company, location, price class, product, description, container, unit of measure, and date.

  16. Update Customer Master:

  17. Read NEWPROD records.
  18. Check for duplicates in PRCTUM using company, customer, product, container, and unit of measure.
  19. Add non-duplicate records to PRCTUM with active flag ('A').

  20. Generate Download File:

  21. Clear RKPRCEO (?9?PRCDOWN).
  22. Read RKPRCE records.
  23. Write records to RKPRCEO if they match PRCTUM records by company, customer, product, container, and unit of measure, copying the entire record.

Business Rules

  1. Deduplication:
  2. Ensure no duplicate company/customer pairs in BB956S.
  3. Prevent duplicate pricing records in PRCTUM based on company, customer, product, container, and unit of measure.
  4. Validation:
  5. Company number must exist in BICONT.
  6. Customer number must exist in BB956S.
  7. Month must be 01–12.
  8. Pricing records must match the input date and specific container descriptions ("BRAD PENN" or "DA LUBRICANTS").
  9. Data Integrity:
  10. Only active records (non-deleted, PCDEL ≠ 'D') are processed.
  11. New records in PRCTUM and BB956S are marked with active flag ('A').
  12. Output:
  13. NEWPROD contains filtered pricing data for review and update.
  14. RKPRCEO contains validated pricing records for external use.
  15. Printed report documents filtered records.

Calculations

  • Y2K Date Conversion:
  • Input: KYDATE (6 digits, YYMMDD).
  • Multiply by 10000.01 to get 6-digit DATYMD.
  • If year (KYYR) >= 80, prepend century 19 (e.g., 19YYMMDD); else, prepend 20 (e.g., 20YYMMDD).
  • Output: 8-digit date (DATE8).

Error Handling

  • Return error if:
  • Company number is invalid (not in BICONT).
  • Customer number is invalid (not in BB956S).
  • Month is not 01–12.
  • Skip records that fail date, PRCTUM, or container description validation.

Assumptions

  • Inputs are provided programmatically, bypassing screen interaction.
  • All files (PRCTUM, RKPRCE, BICONT, GSCNTR1, BB956S, NEWPROD, RKPRCEO) are accessible in the specified library (?9?).
  • BB9564 (display step) is optional and skipped in a non-interactive context.