Reading IBM documentation I become a little bit confused about how to correctly write a program/procedure entry point.
Especially reading this https://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c092508410.htm
I see:
The prototype with the matching name must precede the procedure interface in the source
And here http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzasd/freeinterface.htm
I read:
If you do not specify a prototype for a cycle-main procedure, you use *N as the name for the procedure interface
So I code a new program this way:
CTL-OPT ...
DCL-PI *N;
P1 CHAR(2);
P2 CHAR(2) CONST;
P3 CHAR(2) CONST;
P4 CHAR(1) CONST;
P5 PACKED(7) CONST;
P6 POINTER;
P7 INT(5);
END-PI;
...
and it compile and run fine.
So what I'm asking is, when and why should I specify a prototype before the interface?