Free Format Readc - IBM AS400

This is a discussion on Free Format Readc - IBM AS400 ; I'm having a hard time finding the free format code to read a subfile. I can do the readc, but I can't test for an %eof and it doesn't generate an error. Help!...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Free Format Readc

  1. Free Format Readc

    I'm having a hard time finding the free format code to read a subfile.
    I can do the readc, but I can't test for an %eof and it doesn't
    generate an error.

    Help!


  2. Re: Free Format Readc

    Use %EOF without the file argument:

    READC(E) subfileLine;

    DOW NOT %EOF()
    AND NOT %ERROR();

    // ...code to manage the user's input

    READC(E) subfileLine;

    ENDDO;


    Alida wrote:
    > I'm having a hard time finding the free format code to read a subfile.
    > I can do the readc, but I can't test for an %eof and it doesn't
    > generate an error.
    >
    > Help!
    >


  3. Re: Free Format Readc

    On Sep 6, 5:14 pm, Alida wrote:
    > I'm having a hard time finding the free format code to read a subfile.
    > I can do the readc, but I can't test for an %eof and it doesn't
    > generate an error.
    >
    > Help!


    READC (The Record Format in your Display File)

    %EOF (The Display File Name in your F Spec)

    You treat a display file, just like a disk file.
    You read the record format, but then check the file pointer status
    using the filename.


+ Reply to Thread