SQL0312 30 23 Position 26 Variable ID not defined or not usable.
SQL0312 30 23 Position 31 Variable NAME not defined or not
usable.
I have also tried CRTSQLRPG statement. Same issue. Compile is not
successful.
my table is created as follows:
create table customer(custid int, custnm char(20))
Any advice would be appreciated.
F* FILE DECLARATION FOR QPRINT
F*
FQPRINT O F 132 PRINTER
C*
C Z-ADD0 ID 50
C MOVE *BLANK NAME 9
C*
C/EXEC SQL WHENEVER SQLERROR GOTO UPDERR
C/END-EXEC
C*
C/EXEC SQL DECLARE C1 CURSOR FOR
C+ SELECT CUSTID, CUSTNM FROM CUSTOMER
C+ WHERE CUSTID = 1
C/END-EXEC
C*
C/EXEC SQL
C+ OPEN C1
C/END-EXEC
C/EXEC SQL WHENEVER NOT FOUND GO TO DONE
C/END-EXEC
C SQLCOD DOUNE0
C/EXEC SQL
C+ FETCH C1 INTO :ID, :NAME
C/END-EXEC
C SQLCODE IFEQ 0
C EXCPTOUT
C ENDIF
C ENDDO
C DONE TAG
C/EXEC SQL
C+ CLOSE C1
C/END-EXEC
C ERROR TAG
C SETON LR
C RETRN
C*
OQPRINT E OUT
O CUSTID4 5
O CUSTNM 17
F* FILE DECLARATION FOR QPRINT
F*
FQPRINT O F 132 PRINTER
D*
DID S 10I 0
DNAME S 20A
D*
C/EXEC SQL WHENEVER SQLERROR GOTO UPDERR
C/END-EXEC
C*
C/EXEC SQL DECLARE C1 CURSOR FOR
C+ SELECT CUSTID, CUSTNM FROM CUSTOMER
C+ WHERE CUSTID = 1
C/END-EXEC
C*
C/EXEC SQL
C+ OPEN C1
C/END-EXEC
C/EXEC SQL WHENEVER NOT FOUND GO TO DONE
C/END-EXEC
C SQLCOD DOUNE 0
C/EXEC SQL
C+ FETCH C1 INTO :ID, :NAME
C/END-EXEC
C SQLCODE IFEQ 0
C EXCEPT OUT
C ENDIF
C ENDDO
C DONE TAG
C/EXEC SQL
C+ CLOSE C1
C/END-EXEC
C ERROR TAG
C SETON LR
C RETRN
OQPRINT E OUT
O ID
O NAME
However I get a lot of sev 40 errors in the spool file:
*RNF2318 00 1 No overflow indicator is specified; indicator
assigned and
automatic skip to 06 generated.
*RNF6011 00 1 The Space and Skip entries are blank and no PRTCTL
keyword
specified; Space-After defaults to 1.
*RNF7031 00 34 The name or indicator is not referenced.
*RNF0262 20 5 Entry not left-adjusted; defaults to left-adjusted.
*RNF5032 20 1 Result-Field entry is not blank for the specified
operation
defaults to blanks.
*RNF5014 30 1 Operation code is not valid; specification is
ignored.
*RNF5053 30 1 Resulting-Indicators entry is blank for specified
operation
specification is ignored.
*RNF7030 30 2 The name or indicator is not defined.
*RNF7043 30 3 Target of GOTO or CABxx operation is not a label;
the
specification is ignored.
*RNF7023 40 1 The Compiler cannot determine how the program can
end.
Is there anythign I have missed out?
Thanks a lot.
RNF0257 30 2 Form-Type entry for main procedure not valid or out
of
sequence.
Any ideas?
Thanks a lot.
This is RPGIV syntax
> C ERROR TAG
> C SETON LR
> C RETRN
This is RPG III syntax
You can't mix these two versions of language.
I assume you have converted your source to RPG IV? As Dika said, your
original source was (mostly) RPG III, but if you are only getting one
RNF message, it sounds like it is now all RPG IV.
Message RNF0257 is issued when the specs are not in the order H F D I C
O P. The listing should show exactly which lines are getting the
RNF0257 messages.