AS400 Mid Range/record locks

Advertisement


Question
i have a pgm that is accessed over and over all day long by numerous people, occasionally we get CPF4128 msg, record lock, or allocated to another user. How to i stop this in the program or on the CL or both? Be specific.

Answer
If the message is being issued by an RPG program, it is likely coming from a CHAIN command, which allows the program to go directly to a specific record based on some unique key.  If so, there is a resulting indicator coded in the HIGH position that turns on if the record is not found. An indicator in the next two spaces (the LOW position) will turn on if the record is already locked for update to another job and will prevent the CPF4128 message. However, a programmer will have to decide what to make the program do next in that case - perhaps issue a message to the user that the record is locked for update.

- Laird

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.