• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Don’t Let Overrides Deceive You

    June 2, 2004 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.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    ASNA Updates Visual RPG for .NET Development Tool How the eServer i5s Stack Up Against the iSeries

    Leave a Reply Cancel reply

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle