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:
- Use Case 1: Create a Deduplicated Customer List for Rack Pricing
- Description: Generate a unique list of company and customer numbers from the customer master file (
PRCTUM) for use in the rack pricing update process. - Program:
BB9541 -
Details: Reads
PRCTUM, checks for duplicates inBB956S, and writes new records toBB956Swith an active flag ('A'). -
Use Case 2: Validate User Input for Rack Pricing Update
- Description: Validate user-provided inputs (company number, customer number, and date) to ensure they are valid before proceeding with pricing updates.
- Program:
BB956P -
Details: Interactively validates company number against
BICONT, customer number againstBB956S, and month (01–12). Handles Y2K date conversion and displays errors on a screen. -
Use Case 3: Filter and Validate Rack Pricing Records
- 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. - Program:
BB9563 -
Details: Validates
RKPRCErecords against a provided date, checks for non-existence inPRCTUM, and verifies container descriptions ("BRAD PENN" or "DA LUBRICANTS") inGSCNTR1. Writes valid records toNEWPRODand a printed report. -
Use Case 4: Display New Pricing Records for User Review
- Description: Display new pricing records from
NEWPRODfor user review, allowing confirmation or cancellation. - Program:
BB9564 -
Details: Reads up to 10 records from
NEWPRODand displays company, location, product, container, and unit of measure on a screen. Supports cancellation. -
Use Case 5: Update Customer Master with New Pricing Records
- Description: Add new pricing records from
NEWPRODto thePRCTUMcustomer master file, ensuring no duplicates. - Program:
BB9565 -
Details: Checks for duplicates in
PRCTUMand adds new records with an active flag ('A'). -
Use Case 6: Generate Pricing Download File
- Description: Create a download file containing validated rack pricing records that match customer data in
PRCTUM. - Program:
BB9566 - Details: Copies
RKPRCErecords toRKPRCEO(?9?PRCDOWN) if they match records inPRCTUM, 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¶
- Create Deduplicated Customer List:
- Read
PRCTUMrecords. - Check for duplicates in
BB956Susing company and customer number. -
Write unique records to
BB956Swith active flag ('A'). -
Validate Inputs:
- Verify
KYCOexists inBICONT. - Verify
KYCUSTexists inBB956S. - Validate
KYMO(month fromKYDATE) is 01–12. -
Convert
KYDATEto 8-digit format (e.g., 20YYMMDD) using Y2K logic:- If year (
KYYR) >= 80, use century 19 (1900s); else, use 20 (2000s).
- If year (
-
Filter and Validate Pricing Records:
- Read
RKPRCErecords where date matches convertedKYDATE. - Check non-existence in
PRCTUMusing company, customer, product, container, and unit of measure. - Validate container code in
GSCNTR1, ensuring second description is "BRAD PENN" or "DA LUBRICANTS". - Write valid records to
NEWPROD(company, location, product, container, unit of measure). -
Generate printed report with company, location, price class, product, description, container, unit of measure, and date.
-
Update Customer Master:
- Read
NEWPRODrecords. - Check for duplicates in
PRCTUMusing company, customer, product, container, and unit of measure. -
Add non-duplicate records to
PRCTUMwith active flag ('A'). -
Generate Download File:
- Clear
RKPRCEO(?9?PRCDOWN). - Read
RKPRCErecords. - Write records to
RKPRCEOif they matchPRCTUMrecords by company, customer, product, container, and unit of measure, copying the entire record.
Business Rules¶
- Deduplication:
- Ensure no duplicate company/customer pairs in
BB956S. - Prevent duplicate pricing records in
PRCTUMbased on company, customer, product, container, and unit of measure. - Validation:
- Company number must exist in
BICONT. - Customer number must exist in
BB956S. - Month must be 01–12.
- Pricing records must match the input date and specific container descriptions ("BRAD PENN" or "DA LUBRICANTS").
- Data Integrity:
- Only active records (non-deleted,
PCDEL ≠ 'D') are processed. - New records in
PRCTUMandBB956Sare marked with active flag ('A'). - Output:
NEWPRODcontains filtered pricing data for review and update.RKPRCEOcontains validated pricing records for external use.- 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.