Ch 6. Compiler-Directing Statements [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Language Reference for the Series 700 and 800
Chapter 6 Compiler-Directing Statements
Introduction to Compiler-Directing Statements
During the creation of your source program, you may wish to include some
of the optional Compiler-directing statements. These are found in the
library module, the Basis mechanism, the ++INCLUDE/ -INC mechanisms,
(OSVS) (VSC2) and the listing control statements. (MF) (OSVS) (VSC2) The
USE statement is described in Chapter 5 File Input and Output and the
ENTER statement is described in Chapter 3 The Nucleus. They
determine how your source program will be created from a set of source
files, by allowing text from other files to be included in your source
file during the compile process.
The Library Module
The library module provides a capability for specifying text that is to
be copied from a source user-library. This is usually created using any
suitable source text editor. It also provides a capability for replacing
text in the source program. (ANS85)
COBOL libraries consist of files that contain source to be made available
to the COBOL system. The effect of the interpretation of the COPY
statement is to insert text into the source program, where it will be
treated by the COBOL system as part of the source program. All
occurrences of a given literal, identifier, word or group of words in the
library text can be replaced with alternative text during the copy
process. The library module also provides for the availability of more
than one COBOL library at the time the object code is created.
________________________________________________________________________
|(ANS85) |
|The effect of the REPLACE statement is to substitute new text for text|
|appearing in the source program and have the new text treated by your |
|COBOL system as part of the source program. |
________________________________________________________________________
The BASIS Mechanism
(OSVS) (VSC2)
The Basis mechanism provides support to allow a COBOL program source file
to be noninteractively edited (temporarily) and the result of this edit
to be submitted to your COBOL system. The COBOL program source file
referenced as the source of the temporary edit (the "subject- program")
remains unchanged, and there is no record of the result of the edit other
than the files output by your COBOL system (listing, and so on). The
resulting code file cannot be animated since there is no source file for
reference.
The program submitted to your COBOL system consists of two files: an
edit control file (containing the BASIS statement and editing
information) and the COBOL source file (the "subject program" as
described above).
There are three special statements associated with the BASIS mechanism:
BASIS
INSERT
DELETE
These special statements are not part of the COBOL language. These
statements, in their entirety, must be contained on a single line and
must be in uppercase.
________________________________________________________________________
|The ++INCLUDE and -INC Mechanisms |
| |
|(OSVS) (VSC2) |
| |
|The ++INCLUDE and -INC mechanisms provide another (IBM-mainframe |
|compatible) means whereby a COBOL program source file or portion of |
|source code can be included in a file to be compiled. |
| |
|These special statements are not part of the COBOL language. These |
|statements, in their entirety, must be contained on a single line and |
|must be in uppercase. |
________________________________________________________________________
________________________________________________________________________
|The Listing Control Statements |
| |
|(MF) (VSC2) (OSVS) |
| |
|The listing control statements provide a control for producing output |
|file listings during the compile process. |
| |
|There are three statements associated with the listing control |
|statements: |
| |
|EJECT |
|SKIP1, SKIP2 AND SKIP3 |
|TITLE (MF) (VSC2) |
________________________________________________________________________
________________________________________________________________________
|The ++INCLUDE Statement |
| |
|(OSVS) (VSC2) |
| |
|Function |
| |
|The ++INCLUDE statement is used to include all of the data records of |
|one source file in another source file at compilation time. |
| |
|General Format |
| |
| ++ INCLUDE text-name |
| |
|Syntax Rules |
| |
| |
| 1. ++INCLUDE must begin in column 8, must be in all uppercase |
| letters, and must be followed by one or more spaces. |
| |
| 2. Text-name defines a unique external file name which conforms to|
| the rules for user defined words. |
| |
| 3. These special statements are not part of the COBOL language. |
| These statements in their entirety must be contained on a |
| single line and must be in uppercase. |
| |
|General Rules |
| |
| |
| 1. Text-name determines the COBOL source file to be included in at|
| this place in the source code. |
| |
| 2. Any other text appearing on the line is treated as comment. |
| |
| |
| |
|3. The ++INCLUDE statement is sensitive to the PANVALET directive. |
| See your COBOL System Reference for details. (MF) |
| |
________________________________________________________________________
________________________________________________________________________
|The -INC Statement |
| |
|(OSVS) (VSC2) |
| |
|Function |
| |
|The -INC statement is used to include all of the data records of one |
|source file in another source file at compilation time. |
| |
|General Format |
| |
| - INC text-name |
| |
|Syntax Rules |
| |
| |
| 1. -INC must begin in column 1 and be followed by one or more |
| spaces. |
| |
| 2. Text-name defines a unique external file name which conforms to|
| the rules for user-defined words. |
| |
| 3. These special statements are not part of the COBOL language. |
| These statements in their entirety must be contained on a |
| single line and must be in uppercase. |
| |
|General Rules |
| |
| |
| 1. Text-name determines the COBOL source file to be included in at|
| this place in the source code. |
| |
| 2. Any other text appearing on the line is treated as comment. |
| |
| |
| |
|3. The -INC statement is sensitive to the LIBRARIAN directive. See |
| your COBOL System Reference for details. (MF) |
| |
________________________________________________________________________
________________________________________________________________________
|The BASIS Statement |
| |
|(OSVS) (VSC2) |
| |
|Function |
| |
|The BASIS statement identifies that the program (the edit control file|
|and the COBOL source file) is to be submitted to your COBOL system |
|under the BASIS mechanism rules. |
________________________________________________________________________
General Format
________________________________________________________________________
|(OSVS) (VSC2) |
| |
|Syntax Rules |
| |
| |
| 1. The BASIS statement must be the first line of the edit control |
| file. |
| |
| 2. The BASIS reserved word can commence anywhere between columns 1|
| and 66 of the statement line. |
| |
| 3. Sequence numbers can be included anywhere in columns 1 |
| through 6 of the statement and must be followed by a |
| space. |
| |
| 4. Text-name defines a unique external file name which conforms to|
| the rules for user defined words (note lower- case is |
| translated into uppercase). External-file-name-literal |
| is an alphanumeric literal enclosed in quotation marks |
| that conforms to the operating system rules for file |
| names. |
| |
|General Rules |
| |
| |
| 1. Text-name or external-file-name-literal determines the COBOL |
| source file to be edited by the control file. |
| |
| 2. The editing of the COBOL source file is determined by |
| the INSERT and DELETE statements in the edit control |
| file. |
________________________________________________________________________
________________________________________________________________________
|General Notes on Basis Mechanism Statements |
| |
|(OSVS) (VSC2) |
| |
| |
| 1. DELETE statements wholly within area B of the source-program |
| line, not followed by a valid subject-sequence or |
| subject-sequence-range, will be treated as a COBOL DELETE |
| statement by your COBOL system. |
| |
| 2. Within the Basis mechanism DELETE statement, all |
| subject-sequence and subject-sequence-range numbers must be in |
| ascending numeric order. |
| |
| 3. Within the edit control file, all subject-sequence and |
| subject-sequence-range numbers must be in ascending numeric |
| order. |
________________________________________________________________________
The COPY Statement.
Function
The COPY statement incorporates text into a COBOL source program.
General Format
Syntax Rules
1. If more than one COBOL library is available while the source is
passed through the COBOL system, text-name must be qualified by
the library-name identifying the COBOL library in which the text
associated with text-name resides. See your COBOL System
Reference for details of libraries.
This restriction is removed. (OSVS) (VSC2) (MF)
2. The COPY statement must be preceded by a space and terminated by
the separator period.
3. Pseudo-text-1 must not be null, nor can it consist solely of the
character space(s), nor can it consist solely of comment lines.
4. Pseudo-text-2 can be null.
5. Character-strings within pseudo-text-1 and pseudo-text-2 can be
continued. However, both characters of a pseudo-text delimiter
must be on the same line. (See Continuation of Lines in the
chapter COBOL Concepts.)
6. Word-1 or word-2 can be any single COBOL word.
7. A COPY statement can occur in the source program anywhere a
character-string or a separator can occur except that a COPY
statement must not occur within a COPY statement.
________________________________________________________________________
|(MF) (VSC2) |
|Nested COPY statements are allowed. However, recursive COPY |
|statements (where a library-text is referred to by a COPY statement |
|within it) are not allowed. When nested COPY statements are used, the|
|REPLACING phrase can not be used. |
________________________________________________________________________
8. Text-name defines a unique external file name which conforms to
the rules for user defined words.
________________________________________________________________________
|(MF) |
|External file-name-literal is an alphanumeric literal that conforms to|
|the operating system rules for file names. It can be specified with |
|or without enclosing quotation marks. |
________________________________________________________________________
Note that text-names and unquoted external-file-name-literals are
always converted to uppercase.
________________________________________________________________________
|(MF) |
| |
| |
| |
|9. Library-name-literal is an alphanumeric literal that conforms |
| either to the operating system rules for file names or to the |
| operating system rules for device identifiers. It can be |
| specified with or without enclosing quotation marks. |
| |
________________________________________________________________________
Note that unquoted library-name-literals are always converted to
uppercase.
________________________________________________________________________
|(MF) (OSVS) (VSC2) |
| |
| |
| |
|10. The SUPPRESS phrase is used to suppress printing the contents of |
| the copy member on the source listing. |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|11. 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. |
| |
________________________________________________________________________
General Rules
1. The compilation of a source program containing COPY statements is
logically equivalent to processing all COPY statements prior to
the processing of the resulting source program.
2. The effect of processing a COPY statement is that the library text
associated with text-name is copied into the source program,
logically replacing the entire COPY statement, beginning with the
reserved word COPY and ending with the punctuation character
period, inclusive.
________________________________________________________________________
|(OSVS) |
|(See General Rule 13. for OLDCOPY alternative processing.) |
________________________________________________________________________
3. If the REPLACING phrase is not specified, the library text is
copied unchanged.
If the REPLACING phrase is specified, the library text is copied
and each properly matched occurrence of pseudo-text-1,
identifier-1, literal-1 and word-1 in the library text is replaced
by the corresponding pseudo-text-2, identifier-2, literal-2 or
word-2.
4. For purposes of matching, identifier-1, literal-1 and word-1 are
treated as pseudo-text containing only identifier-1, literal-1 or
word-1, respectively.
5. The comparison operation to determine text replacement occurs in
the following manner:
a. The leftmost library text word which is not a separator
comma or a separator semicolon is the first text word used
for comparison. Any text word or space preceding this text
word is copied into the source program. Starting with the
first text word for comparison and first pseudo-text-1,
identifier-1, word-1, or literal-1 that was specified in
the REPLACING phrase, the entire REPLACING phrase operand
that precedes the reserved word BY is compared to an
equivalent number of contiguous library text words.
b. Pseudo-text-1, identifier-1, word-1, or literal-1 match the
library text if, and only if, the ordered sequence of text
words that forms pseudo text-1, identifier-1, word-1, or
literal-1 is equal, character for character, to the ordered
sequence of library text words. For purposes of matching,
each occurrence of a separator comma, semicolon, or space
in pseudo-text-1 or in the library text is considered to be
a single space. Each sequence of one or more space
separators is considered to be a single space.
________________________________________________________________________
|(ANS85) |
|Each lowercase letter is equivalent to the corresponding uppercase |
|letter as specified for the COBOL character set. |
________________________________________________________________________
c. If no match occurs, the comparison is repeated with each
next successive pseudo-text-1, identifier-1, word-1, or
literal-1, if any, in the REPLACING phrase until either a
match is found or there is no next successive REPLACING
operand.
d. When all the REPLACING phrase operands have been compared
and no match has occurred, the leftmost library text word
is copied into the source program. The next successive
library text word is then considered as the leftmost
library text word, is then considered as the leftmost
library text word, and the comparison cycle starts again
with the first pseudo-text-1, identifier-1, word-1, or
literal-1 specified in the REPLACING phrase.
e. Whenever a match occurs between pseudo-text-1,
identifier-1, word-1, or literal-1 and the library text,
the corresponding pseudo-text-2, identifier-2, word-2, or
literal-2 is placed into the source program. The library
text word immediately following the rightmost text word
that participated in the match is then considered as the
leftmost text word. The comparison cycle starts again with
the first pseudo-text-1, identifier-1, word-1, or literal-1
specified in the REPLACING phrase.
f. The comparison operation continues until the rightmost text
word in the library text has either participated in a match
or been considered as a leftmost library text word and
participated in a complete comparison cycle.
6. A comment line occurring in the library text and pseudo-text-1 is
interpreted, for purposes of matching, as a single space. Comment
lines appearing in pseudo-text-2 and library text are copied into
the source program unchanged.
7. Debugging lines are permitted within library text and
pseudo-text-2. Debugging lines are not permitted within
pseudo-text-1; text-words within a debugging line participate in
the matching rules as if the "D" did not appear in the indicator
area.
________________________________________________________________________
|(ANS85) |
|A debugging line is specified within pseudo-text if the debugging line|
|begins in the source program after the opening pseudo-text delimiter |
|but before the matching closing pseudo-text delimiter. |
________________________________________________________________________
8. The text produced as a result of the complete processing of a COPY
statement must not contain a COPY statement.
________________________________________________________________________
|(VSC2) |
|This text can contain a COPY statement provided neither this |
|contained COPY nor the already expanded COPY includes the REPLACING |
|phrase. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|COPY statements may be nested in this way to any level. Any one of |
|the COPY statements in this structure may include the REPLACING |
|phrase, and the replacements specified will be in effect for all |
|subsidiary COPYs. |
________________________________________________________________________
9. The syntactic correctness of the library text cannot be
independently determined.
Except for COPY statements, (ANS85) the syntactic correctness of
the entire COBOL source program cannot be determined until all
COPY statements have been completely processed.
10. Each text word copied from the library but not replaced is copied
so as to start in the same area of the line in the resultant
program as it begins in the line within the library. However, if
a text word copied from the library begins in area A but follows
another text word, which also begins in area A of the same line,
and if replacement of a preceding text word in the line by
replacement text of greater length occurs, the following text word
begins in area B if it cannot begin in area A. Each text word in
pseudo-text-2 that is to be placed into the resultant program
begins in the same area of the resultant program as it appears in
pseudo-text-2. Each identifier-2, literal-2, and word-2 that is
to be placed into the resultant program begins in the same area of
the resultant program as the leftmost library text word that
participated in the match would appear if it had not been
replaced.
Library text must conform to the rules for COBOL reference format.
If additional lines are introduced into the source program as a
result of a COPY statement, each text word introduced appears on a
debugging line if the copy statement begins on a debugging line,
or if the text word being introduced appears on a debugging line
in library text. When a text word specified in the BY phrase is
introduced, it appears on a debugging line if the first library
text word being replaced is specified on a debugging line. Except
in the preceding cases, only those text words that are specified
on debugging lines where the debugging line is within
pseudo-text-2 appear on debugging lines in the resultant program.
If any literal specified as literal-2 or within pseudo-text-2 or
library text is of too great length to be accommodated on a single
line without continuation to another line in the resultant program
and the literal is not being placed on a debugging line,
additional continuation lines are introduced which contain the
remainder of the literal. If replacement requires that the
continued literal be continued on a debugging line, the program is
in error.
11. For purposes of compilation, text-words after replacement are
placed in the source program according to the rules for reference
format as described in Chapter 1 Introduction.
12. If the unit identifier is not explicitly specified, the default
drive will be used. The default is operating system-dependent and
is described in your COBOL System Reference.
________________________________________________________________________
|(OSVS) |
| |
| |
| |
|13. The COBOL system directive OLDCOPY (see your COBOL System |
| Reference) can be set and this causes the entire entry to be |
| replaced by the information identified by text-name, except that |
| the data-name preceding the COPY statement replaces the |
| corresponding data-name in the text-name. See the example |
| below: |
| |
| Source-file Code. |
| |
| 01 PRODUCT-CODE COPY COPYPROD: |
| |
| Copy-file Code "COPYPROD": |
| |
| 01 PROD-CD |
| . 05 ITEM-NAME PIC X(30) |
| . 05 ITEM-NUMBER PIC X(5). |
| |
| Resulting COBOL Code: |
| |
| 01 PRODUCT-CODE. |
| 05 ITEM-NAME PIC X(30). |
| 05 ITEM-NUMBER PIC X(5). |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|14. If certain conventions are followed in library text, parts of |
| names, for example the prefix portion of data-names, can be |
| changed with the REPLACING phrase. For example, the prefix (TAG)|
| will be replaced in the following example. |
| |
| To use this type of "partial word replacement" the portion of the|
| words to be modified must be enclosed in pairs of left and right |
| parenthesis or they must be enclosed within colons. For example,|
| (ABC) and :XYZ: are both valid candidates for partial word |
| replacement. |
| |
| Note that although the original COPY-file, Payroll, does not |
| contain valid COBOL syntax, after processing of the COPY |
| REPLACING statement, the resultant code is valid. |
| |
| Example |
| |
| Source-file Code: |
| |
| Copy Payroll Replacing |
| ==(TAG)== by ==Payroll==. |
| |
| Copy-file Code: |
| |
| 01 (TAG). |
| 05 (TAG)-Week PIC S99. |
| 05 (TAG)-Gross-Pay PIC S9(5)V99. |
| 05 (TAG)-Hours PIC S9(3) |
| Occurs 1 to 52 times |
| Depending on (TAG)-Week of (TAG). |
| |
| Is treated as if it were coded as: |
| |
| 01 Payroll. |
| 05 Payroll-Week PIC S99. |
| 05 Payroll-Gross-Pay PIC S9(5)V99. |
| 05 Payroll-Hours PIC S9(3) |
| Occurs 1 to 52 times |
| Depending on Payroll-Week of Payroll. |
| |
________________________________________________________________________
________________________________________________________________________
|The DELETE Statement - Basis Control |
| |
|(OSVS) (VSC2) |
| |
|Function |
| |
|The DELETE statement (under the Basis mechanism) identifies lines of |
|the COBOL source file to be ignored by your COBOL system. Any COBOL |
|statements that follow the DELETE statement (up to the next |
|Basis-mechanism INSERT or DELETE statement in the edit control file) |
|are included. |
________________________________________________________________________
General Format
________________________________________________________________________
|(OSVS) (VSC2) |
| |
|Syntax Rules |
| |
| |
| 1. The DELETE reserved word can commence anywhere between columns |
| 1 and 66 of the statement line. |
| |
| 2. Sequence numbers can be included anywhere in columns 1 |
| through 6 of the statement and must be followed by a |
| space. |
| |
| 3. Subject-sequence-1, subject-sequence-2, and so on, must be |
| unquoted 6-digit positive integers (following the rules for |
| integer numeric-literals). |
| |
| 4. Subject-sequence-range-1, subject-sequence-range-2, and so on, |
| must consist of two subject-sequence numbers (as above) |
| separated by a hyphen (-). |
| |
| 5. The comma between subject-sequences and/or subject-sequence |
| ranges is mandatory. |
| |
|General Rules |
| |
| |
| 1. Subject-sequence-1, subject-sequence-2, and so on, refer to |
| sequence numbers of those statements within the COBOL source |
| file which are to be ignored by your COBOL system. |
| |
| 2. Subject-sequence-range-1, subject-sequence-range-2, and so on, |
| refer to inclusive ranges of statement sequence numbers within |
| the COBOL source file, all of which statements are to be |
| ignored when the intermediate code is produced. |
| |
| 3. Any COBOL statements following the DELETE statement in the edit|
| control file up to the next BASIS-mechanism DELETE or INSERT |
| statement will be included in the source submitted to your |
| COBOL system. These COBOL source statements are inserted in |
| place of the last statement omitted by this Basis-mechanism |
| DELETE statement. |
________________________________________________________________________
The EJECT Statement.
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
| |
|Function |
| |
|The EJECT statement tells your COBOL system to print the next line of |
|source code at the top of the next page. |
| |
|General Format |
| |
| EJECT [ ] (VSC2) (MF) |
| |
|Syntax Rule |
| |
|EJECT may begin either in area A or in area B, must be the only |
|statement on the line and may optionally be followed by a period |
|(OSVS) |
| |
|General Rule |
| |
|The EJECT statement itself is not printed. |
________________________________________________________________________
________________________________________________________________________
|The INSERT Statement - Basis Control |
| |
|(OSVS) (VSC2) |
| |
|Function |
| |
|The INSERT statement (under the Basis mechanism) lists lines of COBOL |
|source to be included in the program submitted to your COBOL |
|system. |
| |
|General Format |
| |
| [sequence-number] INSERT subject-sequence |
| COBOL statement [COBOL statement] |
| |
|Syntax Rules |
| |
| |
| 1. The INSERT reserved word can commence anywhere between columns |
| 1 and 66 of the statement line. |
| |
| 2. Subject-sequence must be an unquoted positive numeric integer |
| (following the rules for integer numeric-literals). |
| |
|General Rules |
| |
| |
| 1. Subject-sequence refers to that statement within the COBOL |
| source file after which the COBOL statement(s) is to be |
| included. |
| |
| 2. All those COBOL statements following the INSERT statement in |
| the edit control file up to the next Basis-mechanism DELETE or |
| INSERT statement will be included in the source submitted to |
| your COBOL system. There must be at least one COBOL |
| statement immediately following the Basis-mechanism INSERT |
| statement. |
________________________________________________________________________
The REPLACE Statement.
________________________________________________________________________
|(ANS85) |
| |
|Function |
| |
|The REPLACE statement is used to replace source program text. |
| |
|General Formats |
| |
|Format 1 |
| |
| REPLACE {==pseudo-text-1==BY==pseudo-text-2==} ... |
| |
|Format 2 |
| |
| REPLACE OFF |
| |
|Syntax Rules |
| |
| |
| 1. A REPLACE statement can occur anywhere in the source program |
| where a character-string can occur. It must be preceded by a |
| separator period except when it is the first statement in a |
| separate program. |
| |
| 2. A REPLACE statement must be terminated by a separator |
| period. |
| |
| 3. Pseudo-text-1 must contain one or more text words. |
| |
| 4. Pseudo-text-2 can contain zero, one, or more text words. |
| |
| 5. Character-strings within pseudo-text-1 and pseudo-text-2 can be|
| continued. |
| |
| 6. A text word within pseudo-text must be between 1 and 322 |
| characters long. |
| |
| 7. Pseudo-text-1 must not consist entirely of a separator comma or|
| a separator semicolon. |
| |
| 8. If the word REPLACE appears in a comment-entry or in the place |
| where a comment-entry can appear, it is considered part of the |
| comment-entry. |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
|General Rules |
| |
| |
| 1. The Format 1 REPLACE statement specifies the text of the source|
| program to be replaced by the corresponding text. Each matched|
| occurrence of pseudo-text-1 in the source program is replaced |
| by the corresponding pseudo-text-2. |
| |
| 2. The Format 2 REPLACE statement specifies that any text |
| replacement currently in effect is discontinued. |
| |
| 3. A given occurrence of the REPLACE statement is in effect from |
| the point at which it is specified until the next occurrence |
| of the statement or the end of the separate program, |
| respectively. |
| |
| 4. Any REPLACE statements contained in a source program are |
| processed after the processing of any COPY statements contained|
| in a source program. |
| |
| 5. The text produced as a result of the processing of a REPLACE |
| statement must contain neither a COPY statement nor a REPLACE |
| statement. |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|6. The comparison operation to determine text replacement occurs in |
| the following manner: |
| |
| |
| a. Starting with the leftmost source program text word and |
| the first pseudo-text-1, pseudo-text-1 is compared to an |
| equivalent number of contiguous source program text |
| words. |
| |
| b. Pseudo-text-1 matches the source program text if, and only|
| if, the order sequence of text words that forms |
| pseudo-text-1 is equal, character for character, to the |
| ordered sequence of source program text words. For |
| purposes of matching, each occurrence of a separator |
| comma, semicolon, or space in pseudo-text-1 or in the |
| source program text is considered to be a single space. |
| Each sequence of one or more space separators is |
| considered to be a single space. |
| |
| Each lowercase letter is equivalent to the corresponding |
| uppercase letter as specified for the COBOL character |
| set. |
| |
| c. If no match occurs, the comparison is repeated with each |
| next successive occurrence of pseudo-text-1, until either |
| a match is found or there is no next successive occurrence|
| of pseudo-text-1. |
| |
| d. Whenever a match occurs between pseudo-text-1 and the |
| source program text, the correponding pseudo-text-2 |
| replaces the matched text in the source program. The |
| source program text word immediately following the |
| rightmost text word that participated in the match is then|
| considered as the leftmost source program text word. The |
| comparison cycle starts again with the first occurrence of|
| pseudo-text-1. |
| |
| e. The comparison operation continues until the rightmost |
| text word in the source program text which is within the |
| scope of the REPLACE statement has either participated in |
| a match or been considered as a leftmost source program |
| text word and participated in a complete comparison |
| cycle. |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|7. Comment lines or blank lines occurring in the source program text|
| and in pseudo-text-1 are ignored for purposes of matching; and |
| the sequence of text words in the source program text and in |
| pseudo-text-1 is determined by the rules for reference format. |
| See the section "Reference Format Representation" in the |
| chapter COBOL Concepts. Comment lines or blank lines in |
| pseudo-text-2 are placed into the resultant program unchanged |
| whenever pseudo-text-2 is placed into the source program as a |
| result of text replacement. A comment line or blank line in |
| source program text is not placed into the resultant program if |
| that comment line or blank line appears within the sequence of |
| text words that match pseudo-text-1. |
| |
|8. Debugging lines are permitted in pseudo-text. Text words within |
| a debugging line participate in the matching rules as if the "D" |
| did not appear in the indicator area. |
| |
|9. Only after all COPY and REPLACE statements have been completely |
| processed, can the syntactical correctness of the rest of the |
| source code be determined. |
| |
|10. Text words inserted into the source program as a result of |
| processing a REPLACE statement are placed in the source program |
| according to the rules for reference format. See "Reference |
| Format" in Chapter 2 COBOL Concepts. When inserting text|
| words of pseudo-text-2 into the source program, additional spaces|
| can be introduced only between text words where there already |
| exists a space (including the assumed space between source |
| lines). |
| |
|11. If additional lines are introduced into the source program as a |
| result of the processing of REPLACE statements, the indicator |
| area of the introduced lines contains the same character as the |
| line on which the text being replaced begins, unless that line |
| contains a hyphen, in which case the introduced line contains a |
| space. |
| |
| If any literal within pseudo-text-2 is of a length too great to |
| be accommodated on a single line without continuation to |
| another line in the resultant program and the literal is not |
| being placed on a debugging line, additional continuation |
| lines are introduced which contain the remainder of the |
| literal. If replacement requires the continued literal |
| to be continued on a debugging line, the program is in |
| error. |
| |
________________________________________________________________________
________________________________________________________________________
|The SKIP1, SKIP2 and SKIP3 Statements |
| |
|(OSVS) (VSC2) (MF) |
| |
|Function |
| |
|The SKIP1, SKIP2 and SKIP3 statements control the vertical spacing of |
|the source code listing produced by your COBOL system. They specify |
|the lines to be skipped in the source code listing. |
________________________________________________________________________
General Format
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
| |
|Syntax Rule |
| |
|These statements can begin either in area A or in area B, must be the |
|only statement on the line and can optionally be followed by a period.|
|(MF) (VSC2) |
| |
|General Rules |
| |
| |
| 1. SKIP1 tells your COBOL system to skip one line (double |
| spacing). |
| |
| SKIP2 tells your COBOL system to skip two lines (triple |
| spacing). |
| |
| SKIP3 tells your COBOL system to skip three lines (quadruple |
| spacing). |
| |
| 2. The SKIP statement itself is not printed. |
________________________________________________________________________
The TITLE Statement.
________________________________________________________________________
|(VSC2) (MF) |
| |
|Function |
| |
|The TITLE statement tells your COBOL system what title to print on the|
|first line of all subsequent pages of the program listing. |
| |
|General Format |
| |
| TITLE literal-1 [ . ] |
| |
|Syntax Rules |
| |
| |
| 1. Literal-1 must be non-numeric and can be followed by a period. |
| It can not be a figurative constant. |
| |
| 2. The word TITLE can begin either in Area A or Area B and must be|
| the only statement on the line. |
| |
| 3. The TITLE statement can appear anywhere in the source |
| program. |
| |
|General Rules |
| |
| |
| 1. Literal-1 will be used as a title on all subsequent pages of |
| the program listing. The default title, which is used until a |
| TITLE directive is encountered, identifies your COBOL system |
| and its current release level. |
| |
| 2. The chosen or default title occupies the left-hand side of the |
| first line of each page. The remainder of the line gives the |
| date and time the intermediate code is produced and a page |
| number. |
| |
| 3. A second title line is also output containing the name of the |
| main source file and of the current COPY-file. |
| |
| 4. The TITLE statement causes an immediate new page. |
| |
| 5. The TITLE statement itself is not printed. |
________________________________________________________________________
MPE/iX 5.0 Documentation