Volume 10, Number 7 -- February 24, 2010

How To Use the Inhibit Write Keyword?

Published: February 24, 2010

Hey, Ted:

I stumbled upon the Inhibit Write (INHWRT) keyword parameter of the Override with Database File (OVRDBF) command recently while I was looking through the help text for something else. How long has the parameter been there? I can think of some ways to put it to work. Can you tell me something about INHWRT and how to go about using it?


That parameter has been there forever, Bill, but I don't think a lot of people know about it. I see it mentioned occasionally in online forums. I don't consider it a terribly useful feature of i5/OS.

When you override a database file with INHWRT(*YES), the database manager suppresses all output operations to the file. To the best of my knowledge, the INHWRT parameter was designed with debugging in mind. When you enter debugging mode with STRDBG UPDPROD(*NO), the system halts if you try to write to a database file in a production database. By overriding the file with INHWRT(*YES), the debugger can run without writing to the file. However, if you can make a copy of the file in a test library, such as QTEMP, you won't need the override. Use the TYPE parameter of Create Library (CRTLIB) or Change Library (CHGLIB) to determine whether a library is for production or test.

Also, many shops now have a test system (often a logical partition), which means they can debug in production mode all the time. Such was not the case on the S/38 and earlier versions of the operating system currently known as IBM i.

If you use INHWRT in testing, be aware that your test may not be complete. For example, if the program tries to write a record with a duplicate key, your test run won't catch it if INHWRT is in effect. If you have calculations that are conditioned to the success or failure of output operations, they may not work the same under INHWRT(*YES) and INHWRT(*NO).

I know of two other ways to control output that you might consider when writing or modifying source code. You can use the EXTIND keyword in the F spec to control any file, input, as well as output. If an external indicator (U1-U8) is off when the cycle gets ready to open the file, the file will not be opened and all I/O will be ignored. I used that technique a good bit back in my S/34 and S/36 days.

The other way is control the file open and I/O operations manually. That is, pass a parameter into a program, and depending on the setting of that parameter, either process the file or not. You'll have to include the USROPN keyword on the file. This method is more work, but it's my preference.

All this is not to say that INHWRT is worthless. Many shops still run old programs that were written years ago. Imagine a program that builds a report and writes to a database file. Imagine that the report has gotten misplaced and needs to be regenerated. How do you rerun the program in order to get the report without corrupting the database file? Maybe you can use INHWRT(*YES).

And by the way, INHWRT also applies to output done though SQL.


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

Sponsored By

Learn how to integrate your IBM i
applications together and save big.

Watch our latest on-demand webinar to learn
how you can easily create a dynamic framework
for all your applications.

Plus, see a live demonstration of our new
enterprise portal for the IBM i - Atrium.

Download this educational webinar today.

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

PowerTech:  Strengthen your security. Get a FREE Compliance Assessment today
looksoftware:  Learn more and get your complementary ilook licences
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
The Power7 Systems Sales Pitch

i/OS Gets Short Sheeted with Power7 Thread Counts

The System iWant, 2010 Edition: Clustered Boxes

As I See It: Opinions Are Like ISPs--Everybody Has One

Spend on the Old, Scrimp on the New

Four Hundred Stuff
Visual LANSA Gets Expanded Interoperability, Developer Convenience

Linoma Bolsters Surveyor/400 with Excel Capabilities, SSL

Lawson Updates M3 Suite of ERP Apps for i/OS

Customers Begin Using ilook to Web-Enable i/OS System Screens

Shield Adds IFS Replication to HA Offering

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

System i PTF Guide
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

January 16, 2010: Volume 12, Number 03

TPM at The Register
AMD's 'Magny-Cours' Opterons surface on eBay

IBM flicks out HS22V Xeon blade

Cray swings profit on Q4 revenue dive

Teradata ekes out sales and profit growth

SGI spins up Cyclone HPC cloud

Unisys parts with server chief

Red Hat projects to seed cloudy IT

Big Blue says Power7 will make world smarter

Hitachi inks Xsigo pact for server I/O virt

IBM chills sealed data center with outside air

Riverbed WAN optimizers get SSDs, 10 GE

Intel's 'Tukwila' Itaniums - hot n' pricey


WorksRight Software
Profound Logic Software
Northeast User Groups Conference

Printer Friendly Version

Naming Idiosyncrasies with the DB2 Storage Engine for MySQL

How To Use the Inhibit Write Keyword?

Hunting Down Storage Hogs

Four Hundred Guru


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