You can include all RPG specification types in the source member, except an H specification. CA 2E sorts the different specification types into their appropriate positions within a program:
CA 2E automatically inserts any C-specifications that follow a subroutine, but are not part of a subroutine, in the ZZINIT subroutine.
The order of specification is
Parameter fields are only recognized in the factor one, factor two, and result positions of the RPG calculation specifications that form part of the instance code.
Parameters must take the form #UMMMM where U is the parameter usage defined on the function (I, O, or B), and MMMM is the mnemonic name (DDS name) of the formal parameter. For example:
C #IORVL ADD #BLNVL #OTLVL
CA 2E checks usage of parameters within the instance code both for correspondence with the formal parameter and for use within the user RPG code. For example if field ORCD is alphanumeric, CA 2E would not allow the following:
C Z-ADD ZERO #BORCD
The letter U is reserved as the initial letter for user-specified field names and subroutine names in user-written source. If you use other prefixes, you may find they conflict with CA 2E generated names in certain instances.
If your EXCUSRSRC function contains an ICOPY statement, ensure that the source member to be copied does not contain a subroutine. CA 2E generates the EXCUSRSRC code as a subroutine in your function. The ICOPY includes the other subroutine inside the EXCUSRSRC subroutine. This causes compile errors as a subroutine cannot be embedded in another subroutine.
If you use RPG indicators, you must ensure that they do not conflict with those used elsewhere in the program. To ensure that your usage of indicators in user-written source code does not conflict with the use made of them in CA 2E generated code, you should save the current indicator values at the start of user-written code and restore them at the end. For example, to save and restore indicators 21 to 40:
C MOVEA*IN,21 UWIN 20 * Save C C .....user code..... C C MOVEAUWIN *IN,21 * Restore
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |