Information Systems:Box label program (PLZIU400) hangs for a single customer
This is one of those crazy quirks of the system that leave you in awe.
Background
The warehouse uses a program in the UNITY menus (25 - Special box labels) to manually print one-off box labels (e.g. for a mail run or a special shipment). It presents the user with a simple interface to enter the customer number (blank for all), number of labels, and the thermal printer to print to.
Problem
A user prints x number of labels for a customer and then tries to print another x number of labels on the same day and notices that the program hangs. Anyone else that tries to print for the same customer using the same program experiences the hang as well. Once the program hangs, the user cannot force quit the sessions by closing the window; multiple attempts will therefore bog the CPU with hung sessions.
Explanation
Since this program generates box labels and Atlas is the primary transportation partner, part of the logic is to generate a unique Atlas waybill (even if the box is not being sent out through Atlas) using metadata: the customer number + Julian date (days part) + 2-digit counter from 01-99.
Here is an example of how the problem can happen:
- On Sep. 9 2021, the Julian day is 252. A user prints 50 box labels for 10478. Hence, the waybills 1047825201 - 1047825250 are used and logged to the file ATLEXTRAP.
- The following year, on the same day, the user prints another 50 labels for 10478. On the 50th label, the wayill generator wraps back to 1 after the 2-digit counter reaches 99.
- 1047825201 is now a duplicate, which the program prevents from being written to ATLEXTRAP, and it handles this by incrementing the counter, thus yielding an infinite loop. You can examine this via SQL on CVUSDAP (filter by CLCUVE), where CVNUMB loops through 0-99 endlessly during the time one of the sessions is still hung.
If these were not legacy programs, a bug fix would've been attempted. The rarity of this problem also makes a patch not worthwhile.
Fix
Find today's Julian day. Examine ATLEXTRAP where the waybill number (ATLSHIP) starts with the customer number + Julian day e.g. 1047825201. Delete records where ATLSDAT is a previous year, or if many were printed on the current day by accident, delete these records.