A problem in compiling sqlrpg source - IBM AS400

This is a discussion on A problem in compiling sqlrpg source - IBM AS400 ; Hello everybody, Hereby, there is a simple RPG program that accesses a physical file by sql statements. The program reads rows(records) from a table (physical file) and writes them into an output file. The sub type of the source file ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: A problem in compiling sqlrpg source

  1. A problem in compiling sqlrpg source


    Hello everybody,

    Hereby, there is a simple RPG program that accesses a
    physical file by sql statements.

    The program reads rows(records) from a table (physical file)
    and writes them into an output file. The sub type of the
    source file is "sqlrpg". The source is not compiled

    The message is:
    SQ11106: RPG specification out of order.

    The target release is of the AS400: V5R3M0

    Since this is the first time that I access physical file by
    this way and I've nobody to ask in the organization I'm
    working for, I'll be grateful if somebody tells me what's
    wrong with this source:

    The lines are not written in the exact positions of rpg
    source file. However, I assume that the meaning is clear.

    H D
    FQPRINT O F 132 OF PRINTER
    IPARAM DS
    ..

    IRPT DS


    ..
    ..
    C *ENTRY PLIST

    ..

    C EXCPTHEAD0
    ..
    ..
    C/EXEC SQL
    C+ DECLARE C 1CURSOR FOR
    C+ SELECT FIELD1, FIELD2
    C+ FROM FILE
    C/END-EXEC
    C/EXEC SQL OPEN C1
    C/END-EXEC
    C/EXEC SQL WHENEVER NOT FOUND GO TO DONE1
    C*
    C SQLCOD DOUNE0
    C/EXEC SQL
    C+ FETCH C1 INTO :RPT
    C/END-EXEC
    C OF EXCPTHEAD0
    C EXCPTLINE
    C END
    C DONE1 TAG
    C/EXEC SQL CLOSE C1
    C/END-EXEC
    C RETRN
    ..
    ..
    O - OUTPUT FORM

    Thank you,
    Amos

  2. Re: A problem in compiling sqlrpg source

    It looks as if you have a space in the wrong place in the "DECLARE C1 CURSOR
    FOR" line
    This might make the compiler think that you were trying to open the cursor
    before you had declared it.

    Peter Kinsman
    "AMOS" wrote in message
    news:f60c11f5-3cd9-4746-97ef-54361ba3da39@d1g2000hsg.googlegroups.com...
    >
    > Hello everybody,
    >
    > Hereby, there is a simple RPG program that accesses a
    > physical file by sql statements.
    >
    > The program reads rows(records) from a table (physical file)
    > and writes them into an output file. The sub type of the
    > source file is "sqlrpg". The source is not compiled
    >
    > The message is:
    > SQ11106: RPG specification out of order.
    >
    > The target release is of the AS400: V5R3M0
    >
    > Since this is the first time that I access physical file by
    > this way and I've nobody to ask in the organization I'm
    > working for, I'll be grateful if somebody tells me what's
    > wrong with this source:
    >
    > The lines are not written in the exact positions of rpg
    > source file. However, I assume that the meaning is clear.
    >
    > H D
    > FQPRINT O F 132 OF PRINTER
    > IPARAM DS
    > .
    >
    > IRPT DS
    >
    >
    > .
    > .
    > C *ENTRY PLIST
    >
    > .
    >
    > C EXCPTHEAD0
    > .
    > .
    > C/EXEC SQL
    > C+ DECLARE C 1CURSOR FOR
    > C+ SELECT FIELD1, FIELD2
    > C+ FROM FILE
    > C/END-EXEC
    > C/EXEC SQL OPEN C1
    > C/END-EXEC
    > C/EXEC SQL WHENEVER NOT FOUND GO TO DONE1
    > C*
    > C SQLCOD DOUNE0
    > C/EXEC SQL
    > C+ FETCH C1 INTO :RPT
    > C/END-EXEC
    > C OF EXCPTHEAD0
    > C EXCPTLINE
    > C END
    > C DONE1 TAG
    > C/EXEC SQL CLOSE C1
    > C/END-EXEC
    > C RETRN
    > .
    > .
    > O - OUTPUT FORM
    >
    > Thank you,
    > Amos




+ Reply to Thread