ILE C/C++ Programmer's Guide

Instructions

The following example copies data from the input file T1520ASI to the output file T1520ASO by using the same order in which they are added to the file T1520ASI. The _Rreadn() and _Rwrite() functions are used.

  1. To create an input file, enter:

    CRTPF FILE(MYLIB/T1520ASI) RCDLEN(300)

    This creates a physical file T1520ASI.

  2. Type the following sample data into T1520ASI:

    joe 5
    fred 6
    wilma 7
  3. To create an output file, enter:

    CRTPF FILE(MYLIB/T1520ASO) RCDLEN(300)

    This creates a physical file T1520ASO.

  4. To create the program, enter:

    CRTBNDC PGM(MYLIB/T1520ASP) SCRFILE(QCPPLE/QACSRC)

    This creates the program T1520ASP that uses the source code in Figure 128.

  5. To run the program, enter:

    CALL PGM(MYLIB/T1520ASP)

    The physical file T1520ASO contains the following data:


    joe 5
    fred 6
    wilma 7


[ Top of Page | Previous Page | Next Page | Table of Contents ]