fhg
Volume 10, Number 8 -- March 3, 2010

How to Replace Display Files While They Are In Use

Published: March 3, 2010

Hey, Ted:

If you recompile a program while someone's running it, it's no big deal. The system moves the old object into library QRPLOBJ and the user never knows the difference. However, creating a display file is a different situation. You can't replace a display while someone has a lock on it. Here's a way to replace a display file, even while people are using it.

To illustrate, assume a high-level program, MYHLLPGM, that uses display file MYDSPF. Most likely MYHLLPGM would be written in RPG or maybe COBOL. A user takes a menu option that calls MYHLLPGM, and the system locks MYDSPF.

The trick is to make the program use its own copy of the display file. Here's some CL code that shows how it's done.

CHKOBJ     OBJ(QTEMP/MYDSPF) OBJTYPE(*FILE)
MONMSG     MSGID(CPF9801) EXEC(DO)
CRTDUPOBJ  OBJ(MYDSPF) FROMLIB(*LIBL) OBJTYPE(*FILE) +
             TOLIB(QTEMP)
ENDDO

OVRDBF     FILE(MYDSPF) TOFILE(QTEMP/MYDSPF)
CALL       PGM(MYHLLPGM)

The Check Object (CHKOBJ) command looks to see if there's a copy of MYDSPF in QTEMP. If not, the Create Duplicate Object (CRTDUPOBJ) command creates one.

The Override with Display File (OVRDSPF) command causes the HLL program to use the display file in QTEMP, rather than the one in the production library.

Now you can recreate the production display file while people are using it.

You can have the CL program delete the display file after the program ends. I usually leave the file in QTEMP, since most days I don't recreate the display file. If a user gets a level check on the display file after I've recreated it, I tell him to sign off and on again.

--R




                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
CNX

Don't settle for screen scraping your way to the world wide web. . .
Give your RPG programs a true Web 2.0 Interface!

Valence offers RPG Programmers a genuine Web 2.0 solution for the System i,
combining simple ILE RPG procedures with a robust and easy-to-use
JavaScript framework for the browser.

JUST RELEASED! Valence version 2.1 is now available!
Includes new multilingual features, expanded AutoCode functionality, additional RPG procedures,
back-end performance improvements and much more. New flexible licensing terms too!

See video demos of Valence in action and
download the community edition for FREE!


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Erwin Earley, Brian Kelly, Michael Sansoterra
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

Northeast User Groups Conference:  20th Annual Conference, April 12 - 14, Framingham, MA
DRV Technologies:  SpoolFlex automatically converts reports to user friendly PC formats - FREE trial!
COMMON:  Join us at the annual 2010 conference, May 3 - 6, in Orlando, Florida


 

IT Jungle Store Top Book Picks

Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
The iSeries Express Web Implementer's Guide: List Price, $49.95
The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
Can the AS/400 Survive IBM?: List Price, $49.00
Chip Wars: List Price, $29.95


 
The Four Hundred
X64 and Blade Servers Lead the Server Recovery

Custom Baby Data Centers Coming from Big Blue

System Automation, VTL, and Security Linked in Help/Systems, Crossroads Deal

Mad Dog 21/21: It's i or Die for Power in the Midrange

Hackers Escalate Web Site Attacks, Despite Decline in Security Vulnerabilities

Four Hundred Stuff
CNX Offers Free Community Edition of Valence Web 2.0 App

Altova Adds DB2/400 Support to XML Development Tools

nuBridges Calls for Tokenization Standards

InstallAnywhere Utility Updated with Significant New Features

TN5250 for Android Available from Mochasoft

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
February 27, 2010: Volume 12, Number 09

February 20, 2010: Volume 12, Number 08

February 13, 2010: Volume 12, Number 07

February 6, 2010: Volume 12, Number 06

January 30, 2010: Volume 12, Number 05

January 23, 2010: Volume 12, Number 04

TPM at The Register
Citrix goes virtual with more appliances

Chip biz to grow 10% in 2010

HP slips Intel's desktop Cores into biz laptops

Marathon reels in another $6.5m

Windows server revenue outpaced Linux in Q4

Novell: Linux finally breaks even

EMC shuffles Ionix to VMware

Novell flirts with Citrix

HyTrust nets $10.5m in funding

Cray inks $45m super pact with DoD

Gartner report card gives high marks to x64, blades

Netezza to bake analytics into appliances

THIS ISSUE SPONSORED BY:

SEQUEL Software
CNX
System i Developer


Printer Friendly Version


TABLE OF CONTENTS
Variable Program Calls in Free-Format RPG

How to Replace Display Files While They Are In Use

Admin Alert: Preparing Your CBU For a Real Emergency

Four Hundred Guru

BACK ISSUES




 
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-2010 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement