• 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
    Maxava

    Migrating to New IBM i Hardware?

    Whether you are moving to POWER9, Power10, or a cloud hosted system MAXAVA HAS YOU COVERED!

    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

  • Security Still Top Concern, IBM i Marketplace Study Says
  • Bob Langieri Shares IBM i Career Trends Outlook for 2023
  • Kisco Brings Native SMS Messaging to IBM i
  • Four Hundred Monitor, February 1
  • 2023 IBM i Predictions, Part 4
  • Power Systems Did Indeed Grow Revenues Last Year
  • The IBM Power Trap: Three Mistakes That Leave You Stuck
  • Big Blue Decrees Its 2023 IBM Champions
  • As I See It: The Good, the Bad, And The Mistaken
  • IBM i PTF Guide, Volume 25, Number 5

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 © 2022 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.