Reggie,
The downside to that is that your program becomes full of both DEFINE and
COPY statements. If you include the IF NOT DEFINED, DEFINE and ENDIF
statements into the copybook, your program is much neater, since it only
includes the COPY statements - all the definition stuff is hidden within
each copybook.
Of course, this only really works if each copybook is granular enough to
contain a single definition (or at least a set of related definitions)
- that's the way we have it set up. To make it easier to comprehend, when
the program source is compiled, a compile preprocessor runs and changes each
/COPY line as follows
/COPY,QRPGLESRC CPYMBR1 Member text
where Member text (which starts at position 50) is the text for the CPYMBR1
source member. Here's an example:
D/COPY QRPGLECPY,XCMD_P XCMD prototype
D/COPY QRPGLECPY,Y1I1DSP *FILE FilDS File informati
D/COPY QRPGLECPY,Y1PGDSP PSDS definition (including
D/COPY QRPGLECPY,SYSTEM system() prototype
D/COPY QRPGLECPY,QCAPCMD_P Execute a command (QCAPCMD
D/COPY QRPGLECPY,QCMD_P Command processor (QCMD) p
D/COPY QRPGLECPY,QUSRJOBI_P Retrieve Job Information
That way, even if the copybook member name isn't particularly meaningful,
the text will give more information.
Rory
On 8/1/07, Reggie Acosta - El Monte <racosta@xxxxxxxxxxxxxxx> wrote:
Robert,
Add /DEFINE compiler directive before the /INCLUDE COPYBOOK directive as
follows:
/DEFINE Include_dsFileFormat
/INCLUDE COPYBOOK
HTH,
Reggie Acosta
As an Amazon Associate we earn from qualifying purchases.