Bryan's RPG IV Journal
Using /COPY With Free Format
Q. I'm having problems using /Copy in a free format RPG block. The compiler error I get is:
What am I doing wrong?
A. When you're coding in free format, this error message almost always means that the compiler ran into fixed format syntax in a free format block.
/Copy members are considered to be fixed format syntax, even if you code the /Copy statement in a free format block of code. If the /Copy member contains free format syntax, you should enclose the free format code in the /Copy member in its own /Free and /End-free delimiters.
In the primary source member, you need not code /End-free before you code the /Copy directive:
... (Free format code)
... (More free format code)
You can also indent the /Copy directive, if you wish, instead of beginning in column 7.
Incidentally, the conditional compilation directives(/Define, /Undefine, /If, /Elseif, /Else, /Endif, and /Eof) also work in free format syntax. And, contrary to IBM's documentation, you can also indent these directives in free format syntax.
RNF0257 Form-Type entry not valid or out of sequence.What am I doing wrong?
A. When you're coding in free format, this error message almost always means that the compiler ran into fixed format syntax in a free format block.
/Copy members are considered to be fixed format syntax, even if you code the /Copy statement in a free format block of code. If the /Copy member contains free format syntax, you should enclose the free format code in the /Copy member in its own /Free and /End-free delimiters.
In the primary source member, you need not code /End-free before you code the /Copy directive:
/Free... (Free format code)
/Copy library/srcfile, member... (More free format code)
/End-freeYou can also indent the /Copy directive, if you wish, instead of beginning in column 7.
Incidentally, the conditional compilation directives(/Define, /Undefine, /If, /Elseif, /Else, /Endif, and /Eof) also work in free format syntax. And, contrary to IBM's documentation, you can also indent these directives in free format syntax.
Log of Journal Entries |
|
Use this scrollable blog map to view other journal entries: |
|
| It is your responsibility to ensure procedures, techniques, and code used from this website are accurate and appropriate for your installation. No warranty or support is implied or expressed. |
![]() |
| Privacy and Email Policy |
| AS/400®, eServer, i5/OS, IBM i, Integrated Language Environment®, iSeries, OS/400®, RPG/400®, System i5, VisualAge®, and WebSphere® are trademarks of IBM Corporation. Note: IBM® System i is the latest member of the family of eServer iSeries. This site might refer to System i as System i5, iSeries, or AS/400. |
|
If you are having trouble navigating the menu at the top of this page, you may use the following scrollable site map instead: |
|
|











International visitors: