fhg
Volume 6, Number 23 -- June 14, 2006

Avoid Locked Display Files/Resetting Page Numbers

Published: June 14, 2006

Dear Esteemed Professional Colleagues:

The following question (minus my editing for grammar) was recently posted on the IT Jungle Forums.

I have a display file that remains locked almost all day by users. If I want to recreate the file, I have to wait until all users log out, releasing the lock. Is it possible for me to recreate the display files while it is locked?

--Kaizad Patel


Those of us who still write and/or maintain green-screen applications (and there are a lot of us) understand Kaizad's problem. Here's my reply to him.

You can't recreate the display file if someone has it open. You might be interested in a technique I've seen in MAPICS. When the user selects the menu option to run the program, the CL program runs CRTDUPOBJ against the display file, putting the copy in QTEMP. The RPG program opens the display file in QTEMP, not the one in the production library. Thus, there is never a lock on the display file.


Here's another question from the forums.

How can I re-initialize the PAGNBR figurative constant used in RLU?

And here's the answer, courtesy of RussK.

Use a controlling indicator with the PAGNBR keyword in the external print file. Whenever the record is written with the indicator on, the page counter will be set back to 1. Write the record format with the indicator off, and the page counter will increment normally. The important trick is to place the PAGNBR keyword on a source line separate from the starting position so that the indicator will only control the keyword. Placing them on the same line would cause the indicator to control whether the page number printed at all.

A             120'PAGE:'
A             +1
A 80                PAGNBR
A                EDTCDE(Z)

There is a lot of good information in the IT Jungle Forums, and there are a lot of questions remaining to be answered. Visit soon, help yourself to the insight the forums offer, and help out if you can.

--Ted


RELATED RESOURCE

IT Jungle Forums



Sponsored By
ITERA

High Availability for $50 a day.
Including IBM System i5 Hardware!

Until recently… iSeries high availability solutions were reserved mostly for large enterprises. Now, high availability is dramatically easier to use and less expensive to own and manage.

Thousands of small- and mid-sized companies can now afford
the “luxury” of rapid, complete data recovery.

Click here for more information.



Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

COMMON:  Join us at the Fall 2006 conference, September 17-21, in Miami Beach, Florida
New Generation Software:  Leading provider of iSeries BI and financial management software
Canvas Systems:  We build and deliver custom iSeries rental solutions

 


 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement