• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Add Outfile Support to Your Applications

    October 12, 2011 Ted Holt

    Note: The code accompanying this article is available for download here.

    When I compare IBM i to other operating systems, I am amazed. This well-designed, well-built operating system has numerous features that are foreign concepts to other operating systems. One of those features is that of “outfiles”, files that are built by display-type and work-type commands. If you haven’t done so, consider that it may be advantageous to write your own commands with outfile support.

    In general, programs that write to database files always write to certain database files, and that’s as it should be. A file maintenance program that allows users to add, delete, and change customer information always sends output to the customer master file.

    But consider a file that is the result of a query process. There are good reasons that such data should be written to a file of the user’s choosing at run time. The user may want to use this file with a query tool, or send it to his PC in CSV format for use with Excel. Allowing a user to specify a file’s name at run time is not unlike his naming a document that he creates with a Word processor.

    Here’s a short example application that illustrates the process of creating outfiles. I call it XTRCUS (Extract Customer) because it extracts customer data from the database. It consists of these objects:

    Object

    Type

    Attribute

    Description

    XTRCUS

    *CMD

     

    Command interface

    XTRCUS001C

    *PGM

    CLLE

    Command-processing program

    XTRCUS001R

    *PGM

    RPGLE

    Data retrieval program

    XTRCUSPF

    *FILE

    PF

    Outfile template

     

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Rocket Software

    Two Steps Forward, No Steps Back

    For over 35 years, Rocket Software’s solutions have empowered businesses to modernize their infrastructure, unlock data value, and drive transformation – all while ensuring modernization without disruption.

    LEARN MORE

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    TMW Unveils New Trucking Solutions at User Confab I/O, Memory Boosted On Entry, Enterprise Power Systems

    Leave a Reply Cancel reply

Volume 11, Number 30 -- October 12, 2011
None

Table of Contents

  • Adobe Flash Builder for the iSeries Programmer, Part 3
  • Add Outfile Support to Your Applications
  • Skipping Robot/SCHEDULE Runs on AS/400-Class Machines

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