From: James Moore To: All
I have a program where I need to look at the last payment made in our payment file. I have been looking for ways to do this without CHAINing to the file and then using SETGT and READP. I couldn't find any way to do this with OPNQRYF or join logicals. Using select criteria won't work because the last payment made may span across years. For example, in January 1993, it's likely that the last payment date is December 1992.
Am I missing any possibilities here? I would really like to improve performance as all payments ever made are kept in this file. Any ideas would be appreciated.
From: Eric Lehti To: James Moore
Why not have a last-payment-made field in a file? Update it every time you add a record to your history file. The key to this file would be the entity the payment is going to. Or, if payment history is a history of payments from customers, simply add the last-payment-made field to the Customer Master.
If payment history is a history of payments to vendors, add it to your Vendor Master record.
From: James Moore To: Eric Lehti
That is a very good idea. I guess I'm just trying to find a way to work with what I've got without rewriting major chunks of code. I may have to go to a system like you mentioned though. I think I can get what I need by creating a logical file that is keyed by date in descending order. That way I only have to read the record once and get the last payment made. Your way is much more elegant though. Thanks for the input.
Editor's Note: Another possibility is to create a decimal data area to contain the date of last payment. Data areas are small, inexpensive objects capable of many functions and uses. For more information about data areas, see "The Versatile Data Area" in the February 1993 issue of MC.
Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.
IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn:
LATEST COMMENTS
MC Press Online