Newsletters   Subscriptions  Forums  Store  Media Kit  About Us  Contact  Search   Home 
fhg
Volume 4, Number 19 -- June 2, 2004

Don't Let Overrides Deceive You


by Cletus the Codeslinger


[The code for this article is available for download.]


Overrides have some nice advantages. Without overrides, I would have to clone programs in order to use different files of the same format. Overrides also let me use different members of a multi-member file. Sometimes it's helpful to know which file or member was used to produce a certain report or display. OS/400 includes an easy-to-use API that eliminates the confusion.

The API I'm referring to is Retrieve File Override Information (QDMRTVFO). Maybe the best way to introduce it is to show the prototype member I /COPY into programs that call QDMRTVFO.

D QDMRTVFO        PR                  EXTPGM('QDMRTVFO') 
D  Outfo                        48a                      
D  OutfoLen                     10i 0 CONST              
D  FormatName                    8a   CONST              
D  FileName                     10a   CONST              
D  ErrorDS                      16a                      

D OutfoErrorDS    DS            16    QUALIFIED          
D   BytesProv                   10i 0 inz(16)            
D   BytesAvail                  10i 0                    
D   ExceptionID                  7                       

D OutfoDS         DS            48    QUALIFIED          
D   BytesReturn                 10i 0                    
D   BytesAvail                  10i 0                    
D   FileName                    10a                      
D   LibName                     10a                      
D   MemberName                  10a                      
D   OvrType                     10a

QDMRTVFO takes five parameters:

  • A 48-byte data structure into which the API will load the override information. In this copy member, this data structure has the name OutfoDS.

  • A 4-byte integer containing the length of the data structure. This seems unnecessary, but is provided to allow you to pass a shorter data structure, if you wish.

  • An 8-byte format name. The only supported value to date is OVRL0100.

  • The name of the file being overridden.

  • The usual error data structure used with APIs. In this copy member, the error data structure is OutfoErrorDS.

Here's a short RPG program that illustrates how to use QDMRTVFO. This program reads and lists the PDM options file, QAUOOPT.

The API is called in the RtvOverride subroutine. If there is an override over QAUOOPT, the subfields of the OutfoDS data structure will have values. If there is no override, the subfields will come back blank.

--Cletus the Codeslinger


Ted Holt responds: This reminds me of a similar technique that can be used with native I/O operations. There are three subfields in the file information data structure that return the name of the database file member that is being used and the name of the library that contains them.

FSomeFile  if   e             disk    infds(SomeDS)

D SomeDS          ds
D    File                83     92
D    Lib                 93    102
D    Mbr                129    138 

But that technique doesn't work with SQL, as yours does.

Sponsored By
GUILD COMPANIES

Do you really need a good reason to expand your iSeries skill set?

Here are two facts to remember:

1. Training increases productivity.

2. Order now and save up to 30% on
a single-user license to Manta Combination Packs of training courses.

Now is the Time to Increase Your iSeries Knowledge!

There are 98 iSeries-specific courses and exams in the Manta Combination Packs that cover a wide range of skills, including:

Programming
System Administration
Operations
Client Access Express

Get up to 30% off on all Manta Combination Packs NOW!

PLUS, Manta is giving full credit for courses within a Combo Pack purchased since July 2003, and 50% credit for courses purchased between July 2002 and July 2003--good toward the puchase of a full Combo Pack. Contact us at 212-942-5818 for details.

Act Fast - Offer Ends July 15

More details at http://store.itjstore.com/macopa.html.


Editors: Howard Arner, Joe Hertvik, Ted Holt,
Shannon O'Donnell, Kevin Vandever
Managing Editor: Shannon Pastore
Contributing Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, 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.


THIS ISSUE
SPONSORED BY:

Advanced Systems Concepts
Guild Companies
WorksRight Sofware
Guild Companies
GST


BACK ISSUES

TABLE OF
CONTENTS
Pooling Your DataSources

Don't Let Overrides Deceive You

Query/400 and Multiple Detail Lines

Admin Alert: Checking Your iSeries Batteries

OS/400 Alert: Windows XP Service Pack 2 Beta


The Four Hundred
OS/400 Community Reacts to eServer i5

Java, .NET on iSeries Programmers Minds, RPG in Their Blood

Worldwide Server Market Perked Up in Q1

Four Hundred Stuff
Access OS/400 Servers from Wireless BlackBerry Devices

IBM Introduces Integration Software to the Midmarket

eStorage Offers 70 GB iSeries Disk Drive for $995

Four Hundred Monitor


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