Can someone specify the rules one should follow while using COPY statement in COBOL program. I have just started my program in this and if this is provided I would have it as a cross reference while coding.
Printable View
Can someone specify the rules one should follow while using COPY statement in COBOL program. I have just started my program in this and if this is provided I would have it as a cross reference while coding.
Some of the rules for COPY statement are given below:
1. A COPY statement can occur anywhere a character-string or a separator can occur except that a COPY statement must not occur within another COPY statement.
2. If the word COPY appears in a comment-entry or in the place where a comment entry can appear, it is considered part of the comment-entry.
3. The general syntax is
COPY {Textname} [{OF/IN} {Library name}] [REPLACING {Textword1 BY Textword2}...]
In this when TextWord1 is Pseudo Text it must not be null, nor can it consist solely of either the character space(s) or comment lines.
4. Also when TextWord2 is Pseudo Text it can be null. Null Pseudo Text is indicated by four equal signs (e.g. ====)