GB/T 4092.10-1992 Programming language COBOL Source text management module
Some standard content:
1.1 Function
National Standard of the People's Republic of China
Programming language COBOL
Source text management module
Programming language COBOL
Source text management moduleGB/T 4092. 10—92
Replaces G102.103
The source text management module contains COPY statements and REPLAC.F statements. Each statement can be used independently or in conjunction with other statements to provide an extended capability of looping in and replacing source program text as part of source program compilation. The COBOL library contains text used by the compiler at compile time. The effect of interpreting the COPY statement is to generate text from the library that is considered by the compiler to be part of the source program. Similarly, COBOL source programs can be written using programmer-defined symbols, which are expanded into syntactically correct short statements, sub-statements, and statements at compile time. The result of interpreting the REPLACE statement is to replace the text that occurs in the source program with the new text. The replaced text is then treated as part of the source program by the editor. 1.2 Level Features
Level 1 source text management provides the ability to copy text from a separate library into the source program. The text is copied from the library unchanged. Level 2 source text management provides additional functionality, allowing all occurrences of a given word value, identifier, word, or word group in the library text to be replaced with another text during the copy-in process. Level 2 also provides for the availability of more than one COBOL library during editing and for replacing text that occurs in the source program with the new text. 2COPY Statement
2.1 Function
The COPY statement inserts text into the COBOL source program. 2.2 General Format
COPY Text Name || tt||REPLACING
2.3 Syntax rules
Library name 1
-pseudo text 1-
identifier 1
word value 1
-=pseudo text 2:
identifier 2
word value 2
(1) If more than one (OHOI) library is available during compilation, then the text name 1 must be qualified by the library name 1 of the COBOL library in which the text associated with the text name 1 is located.
In a COBOL library, each text name must be unique. Approved by the State Administration of Technical Supervision on August 4, 1992 and implemented on May 1, 1993
GB/T 4092. 10--92
(2) The COPY statement must be preceded by a space and followed by a delimiter, a dot. (3) The pseudo-text must contain one or more orthogonal characters. (4) The pseudo-text 2 may contain zero, one or more orthogonal characters. (5) The characters in pseudo-text 1 and pseudo-text 2 may be continuous (see GB/T 4092. 16.7.2.5 Pseudo: text) (6) Character 1 or character 2 Any single COPY except "COPY\". (7) The COPY statement can specify where delimiters other than slashes can appear in the source program string or in the source program, but the COPY statement cannot appear in the COPY statement. (8) The implementer must allow pseudo text and library text to have a maximum line length of 3%2: (9) Pseudo text 1 cannot contain only one delimiter or a semicolon. (10) If the word COPY appears in a comment or a comment appears in the comment, it is treated as part of the comment. 2.4 General Rules || t t||(1) Compiling a source program containing a COPY statement is logically equivalent to processing all COPY statements before processing the resulting source program.
(2) The effect of processing a COPY statement is to copy the text associated with the text into the source program: starting with the reserved word COPY and ending with the delimiter period (including the period character). (3) If the REPLACINC: phrase is not specified, the text is unchanged. If the REPILACING phrase is specified, the text is replaced with the corresponding pseudo text 3. Identifier 1, character 2, and character value 1. (4) For the purpose of the match check, identifier 1, character 1, and character value 1 are treated as pseudo text containing identifier 1, character 1, and character value 1, respectively.
(5) The comparison operation for fast text replacement is performed in the following manner: The leftmost library literal that is not a delimiter comma or a delimiter semicolon is the first literal to be compared, and any literal or space before this literal is copied to the source program. Starting with the first literal to be compared and the first pseudo-literal 1, identifier 1, word 1, or word value 1 specified in the PFPLACING phrase, the entire PFPLACING phrase before the word HY is compared with the same number of consecutive library literals.
Pseudo-literal 1, identifier 1, word 1, or word value 1 is matched with the library literal only if, in the pseudo-literal 1, the ordered sequence of literals of identifier 1, word 1, or word value 1 is equal to the ordered sequence of literals of the library literal. For matching, a delimiter comma, semicolon, or space in the pseudo-literal 1 or the library literal is considered to be a space. A sequence of one or more case separators is considered a single space.
If no match is found, the comparison is continued with the possible subsequent texts in the REPLACING phrase. Identifier 1, 1, or value 1 until a match is found or there are no subsequent REPLACING operations. When all REPLACING operations are compared and no match is found, the leftmost next text is copied into the source program, and the subsequent text is considered the leftmost text. The comparison cycle restarts from the first text 1, identifier 1, word 1, or value 1 specified in the REPLACING phrase. If a match between identifier 1, word 1, or value 1 and the text occurs, the corresponding text 2, identifier 2, word 2, or value 2 is substituted into the source program. The text in the text immediately following the last text that participated in the match is considered the leftmost text. The comparison cycle starts again with the first pseudo text 1, identifier, word 1 or word value 1 specified in the REPLACING phrase.
The comparison operation continues until the last text in the library text has participated in a match or the last recognized text in the library text has been matched with a complete comparison cycle.
(6) For matching purposes, the comment lines and case lines in the library text and the flash text 1 are ignored: the order of possible text in the text and the order of text in the pseudo text 1 is determined according to the base format rules (see 5.2.2 of GB/T 4092 for basic format). 4092.10—92
is used to represent the text. When pseudotext 2 is inserted into the source program as a result of text replacement, comment lines and blank lines appearing therein are copied unchanged into the resulting program. Comment lines or blank lines appearing in the library text are copied unchanged into the resulting source program, with the following exception: If a comment line or blank line appears in a text sequence that matches a pseudotext ", then the comment line and blank line in the library text are not copied. (7) False positive lines are allowed in library texts and pseudo texts. The text in a false positive line is matched as if "D\ had not appeared in the indicator area. If a false positive line begins in the source program after the opening pseudo text delimiter and before the matching closing pseudo text delimiter, then the pseudo text specifies a false positive line
. (S) The syntactic correctness of the library text is not independently determined. Except for the COPY and REPLACE statements, the syntactic correctness of the entire COBOL source program can only be determined after all COPY and REPLACE statements have been completely processed. (5) Each text copied from the library but not replaced is copied so that it begins at the beginning of the same area in the line of the result program as it did in the line of the library text. However, if a text copied from the library that begins in area AThe text follows another text that also begins in area A on the same line. If the previous text in the same line is replaced by a longer text, the subsequent text begins in area B if it cannot begin in area A. Each literal in pseudo text 2 that is substituted into the resulting program begins in the resulting program in the same area in which it appears in pseudo text 2. Each identifier 2, value 2, and word 2 that is substituted into the resulting program begins in the resulting program in the area in which it would appear if the leftmost library text participating in the match were replaced: the library text must follow the rules of the COBOL base format. If the source program introduces additional lines due to a COPY statement, and if the COPY statement begins on a check line or introduces text later than the check line of the library text, the introduced text is placed on the check line. When introducing a check line specified by a BY phrase, if the first library text to be substituted is specified on the check line 1:, the text appears on the check line. Except for the above cases, only the text specified by the error line 1 in pseudo text 2 appears as the error line of the result program. If the text constant specified as text 2 or pseudo text 2 or library text is too long to fit on one line in the result program without continuing to the next line, and the text constant is not on the error line, an additional continuation line is added to accommodate the remainder of the text constant. If the substitution requires the continuation of the text constant to continue on the error line, the program is faulty (!0). For compilation purposes, the replaced text is inserted into the source program according to the basic format rules (see Preliminary Knowledge 6.7 Basic Format). When the text of pseudo text 2 is copied into the source program, additional spaces can only be introduced between text words where spaces already exist (including spaces between source program lines).
(11) If, as a result of COPY processing, additional lines are introduced into the source program, the indicator area of the introduced line contains characters from the line beginning with the text to be replaced, unless that line contains a hyphen, in which case the introduced line contains spaces. When the word value constant continues to the "non-error line" introduction line, the hyphen is placed in the indicator area of the introduced line. 3REPLACE Statement
3.1 Function
The REPLACE statement is used to replace the source program text. 3.2 General Format
Formula 1:
Format 2:
3.3 Syntax Rules
REPLACE (--pseudo text 1 = HY = pseudo text 2 ~-)REPI.ACE OFF
(1) The REPLACE statement can appear anywhere in the source program where a string can appear. It must be preceded by a delimiter period, except when it is the first statement in an independently compiled program. (2) The REPLACE statement must end with a delimiter period:
GB/T 4092.10
(3) Pseudo-text 1 must contain one or more body texts. (4) Pseudo-text 2 may contain zero or one or more stop texts. (5) There are continuation lines in the characters of pseudo-text 1 and pseudo-text 2 (see 6-7.2.5 pseudo-text 1 in GB/T 4592-1). (6) The implementer must allow the body text of the stop text to be 1 to 322 characters long. (7) Pseudo-text 1 cannot consist only of delimiters or semicolons. (8) If REPLACE appears in a comment or appears where a comment appears, it is considered to be part of the comment. 3.4 General Rulesbzxz.net
(1) A REPLACE statement of format 1 indicates that each occurrence of pseudo-text 1 in the source program is to be replaced by the corresponding pseudo-text 2. (2) A REPLACE statement of format 2 indicates that any current body replacement is not to continue. (3) A certain REFI.ACE statement The effective range of a given occurrence is from the point at which it is referenced until the next occurrence of the statement or until the end of a separate compiler. (4) Any REPLACE statement contained in the source program is processed after any COPY statement contained in the source program is processed. (3) The text produced as a result of processing a REPLACE statement must not contain any REPLACE statement. (6) The comparison operation to determine text replacement is performed in the following manner: Starting with the leftmost source program terminator and the first character in text 1, text 1 is compared with the corresponding consecutive source program terminator a.
,
b. Pseudo text 1 is matched with the source program when the ordered sequence of characters constituting pseudo text 1 is equal character by character to the ordered sequence of characters in the source program terminator. For the purpose of matching, a delimiter character of text 1 or source program terminator A, a comma, a semicolon, or a space is considered to be a space. A sequence of two or more space separators is considered to be a single space. If no match is found, the comparison with the subsequent occurrences of pseudo text 1 continues until a match is found or there are no more subsequent occurrences of pseudo text 1.
d. When all occurrences of pseudo text 1 have been compared and no match is found, the subsequent source text is the leftmost source text, and the comparison cycle restarts from the second occurrence of pseudo text 1. e. If a match is found between pseudo text 1 and the source text, the corresponding source text 2 is replaced by the source text in the center of the matching sequence. In the source program, the source text immediately following the rightmost text participating in the match is considered to be the leftmost source text. The comparison cycle restarts from the third occurrence of pseudo text 1. 1. The comparison operation continues until the most existing text in the source program body in the REPLAC operation finds a match or is recognized as the leftmost source program text and participates in a complete comparison cycle. (7) For the sake of matching, comment lines or blank lines present in the source program body and pseudo-text 1 are ignored; the text order in the source program body and pseudo-text 1 is determined according to the basic format rules (see G13/[4092.] 6.7.2 for the detailed description of the basic format). When pseudo-text 2 is substituted into the source program as the result of text replacement, comment lines and blank lines present in it are copied into the result program without change. If comment lines or blank lines in the source program are present in the text sequence that matches the pseudo-text, they are not replaced. (8) Error lines are allowed in the pseudo-text. The text matching in the error lines is called as if the instruction area is not hit. (Details) (9) Except for COPY and REPLACE statements, the syntactic correctness of the entire COBOL source program can only be determined after the corresponding COPY and REPLACE statements have been processed. (10) The text captured into the source program as a result of processing the REPLACE statement is directly included in the source program according to the standard format rules (see 6.7 Standard format in GB/T4092.1). When inserting the text of pseudo text 2 into the source program, it is only possible to introduce additional spaces between the text that already have spaces (including imaginary spaces between source program lines): (I1) If the processing of the REPLACE statement requires the introduction of additional lines in the source program, the indicator area of the introduced line contains the same characters as the line of text to be replaced, unless that line contains a hyphen, in which case the introduced line also contains spaces. If the word value constant in pseudo text 2 is too long to fit on the resulting program without being continued to the next line, then the word value constant is not on the correct line, and an additional continuation line is introduced to accommodate the remainder of the word value constant. If the substitution requires the continued word value constant to continue on the correct line, the program will fail. Additional remarks: This standard was proposed by the Ministry of Machinery and Electronics Industry of the People's Republic of China. This standard was drafted by Nanjing University of Posts and Telecommunications. The main drafters of this standard are Qian Shuren, Wang Jingying, Feng Hui, and Duan Xiang. This standard was first issued in December 1983 and revised for the first time in August 1992.7 Basic format). When the text of pseudo text 2 is copied into the source program, additional spaces can only be introduced between text where spaces already exist (including spaces between source program lines).
(11) If additional lines are introduced into the source program as a result of COPY statement processing, the indicator area of the lead-in line contains characters that are between the lines where the text to be replaced begins, unless the line contains a hyphen. In this case, the lead-in line contains spaces. When the word value constant continues to the lead-in line of the non-error line, the hyphen is placed in the indicator area of the lead-in line. 3 REPLACE statement
3.1 Function
The REPLACE statement is used to replace the source program text. 3.2 General format
Formula 1:
Format 2:
3.3 Language rules
REPLACE (--pseudo text 1 = HY = pseudo text 2 ~-) REPI.ACE OFF
(1) The REPLACE statement can appear anywhere in the source program where a string can appear. It must be preceded by a delimiter period, except when it is the first statement in an independently compiled program. (2) The REPLACE statement must end with a delimiter period:
GB/T 4092.10
(3) Pseudo-text 1 must contain one or more body texts. (4) Pseudo-text 2 may contain zero or one or more stop texts. (5) There are continuation lines in the characters of pseudo-text 1 and pseudo-text 2 (see 6-7.2.5 pseudo-text 1 in GB/T 4592-1). (6) The implementer must allow the body text of the stop text to be 1 to 322 characters long. (7) Pseudo-text 1 cannot consist only of delimiters or semicolons. (8) If REPLACE appears in a comment or appears where a comment appears, it is considered to be part of the comment. 3.4 General Rules
(1) A REPLACE statement of format 1 indicates that each occurrence of pseudo-text 1 in the source program is to be replaced by the corresponding pseudo-text 2. (2) A REPLACE statement of format 2 indicates that any current body replacement is not to continue. (3) A certain REFI.ACE statement The effective range of a given occurrence is from the point at which it is referenced until the next occurrence of the statement or until the end of a separate compiler. (4) Any REPLACE statement contained in the source program is processed after any COPY statement contained in the source program is processed. (3) The text produced as a result of processing a REPLACE statement must not contain any REPLACE statement. (6) The comparison operation to determine text replacement is performed in the following manner: Starting with the leftmost source program terminator and the first character in text 1, text 1 is compared with the corresponding consecutive source program terminator a.
,
b. Pseudo text 1 is matched with the source program when the ordered sequence of characters constituting pseudo text 1 is equal character by character to the ordered sequence of characters in the source program terminator. For the purpose of matching, a delimiter character of text 1 or source program terminator A, a comma, a semicolon, or a space is considered to be a space. A sequence of two or more space separators is considered to be a single space. If no match is found, the comparison with the subsequent occurrences of pseudo text 1 continues until a match is found or there are no more subsequent occurrences of pseudo text 1.
d. When all occurrences of pseudo text 1 have been compared and no match is found, the subsequent source text is the leftmost source text, and the comparison cycle restarts from the second occurrence of pseudo text 1. e. If a match is found between pseudo text 1 and the source text, the corresponding source text 2 is replaced by the source text in the center of the matching sequence. In the source program, the source text immediately following the rightmost text participating in the match is considered to be the leftmost source text. The comparison cycle restarts from the third occurrence of pseudo text 1. 1. The comparison operation continues until the most existing text in the source program body in the REPLAC operation finds a match or is recognized as the leftmost source program text and participates in a complete comparison cycle. (7) For the sake of matching, comment lines or blank lines present in the source program body and pseudo-text 1 are ignored; the text order in the source program body and pseudo-text 1 is determined according to the basic format rules (see G13/[4092.] 6.7.2 for the detailed description of the basic format). When pseudo-text 2 is substituted into the source program as the result of text replacement, comment lines and blank lines present in it are copied into the result program without change. If comment lines or blank lines in the source program are present in the text sequence that matches the pseudo-text, they are not replaced. (8) Error lines are allowed in the pseudo-text. The text matching in the error lines is called as if the instruction area is not hit. (Details) (9) Except for COPY and REPLACE statements, the syntactic correctness of the entire COBOL source program can only be determined after the corresponding COPY and REPLACE statements have been processed. (10) The text captured into the source program as a result of processing the REPLACE statement is directly included in the source program according to the standard format rules (see 6.7 Standard format in GB/T4092.1). When inserting the text of pseudo text 2 into the source program, it is only possible to introduce additional spaces between the text that already have spaces (including imaginary spaces between source program lines): (I1) If the processing of the REPLACE statement requires the introduction of additional lines in the source program, the indicator area of the introduced line contains the same characters as the line of text to be replaced, unless that line contains a hyphen, in which case the introduced line also contains spaces. If the word value constant in pseudo text 2 is too long to fit on the resulting program without being continued to the next line, then the word value constant is not on the correct line, and an additional continuation line is introduced to accommodate the remainder of the word value constant. If the substitution requires the continued word value constant to continue on the correct line, the program will fail. Additional remarks: This standard was proposed by the Ministry of Machinery and Electronics Industry of the People's Republic of China. This standard was drafted by Nanjing University of Posts and Telecommunications. The main drafters of this standard are Qian Shuren, Wang Jingying, Feng Hui, and Duan Xiang. This standard was first issued in December 1983 and revised for the first time in August 1992.7 Basic format). When the text of pseudo text 2 is copied into the source program, additional spaces can only be introduced between text where spaces already exist (including spaces between source program lines).
(11) If additional lines are introduced into the source program as a result of COPY statement processing, the indicator area of the lead-in line contains characters that are between the lines where the text to be replaced begins, unless the line contains a hyphen. In this case, the lead-in line contains spaces. When the word value constant continues to the lead-in line of the non-error line, the hyphen is placed in the indicator area of the lead-in line. 3 REPLACE statement
3.1 Function
The REPLACE statement is used to replace the source program text. 3.2 General format
Formula 1:
Format 2:
3.3 Language rules
REPLACE (--pseudo text 1 = HY = pseudo text 2 ~-) REPI.ACE OFF
(1) The REPLACE statement can appear anywhere in the source program where a string can appear. It must be preceded by a delimiter period, except when it is the first statement in an independently compiled program. (2) The REPLACE statement must end with a delimiter period:
GB/T 4092.10
(3) Pseudo-text 1 must contain one or more body texts. (4) Pseudo-text 2 may contain zero or one or more stop texts. (5) There are continuation lines in the characters of pseudo-text 1 and pseudo-text 2 (see 6-7.2.5 pseudo-text 1 in GB/T 4592-1). (6) The implementer must allow the body text of the stop text to be 1 to 322 characters long. (7) Pseudo-text 1 cannot consist only of delimiters or semicolons. (8) If REPLACE appears in a comment or appears where a comment appears, it is considered to be part of the comment. 3.4 General Rules
(1) A REPLACE statement of format 1 indicates that each occurrence of pseudo-text 1 in the source program is to be replaced by the corresponding pseudo-text 2. (2) A REPLACE statement of format 2 indicates that any current body replacement is not to continue. (3) A certain REFI.ACE statement The effective range of a given occurrence is from the point at which it is referenced until the next occurrence of the statement or until the end of a separate compiler. (4) Any REPLACE statement contained in the source program is processed after any COPY statement contained in the source program is processed. (3) The text produced as a result of processing a REPLACE statement must not contain any REPLACE statement. (6) The comparison operation to determine text replacement is performed in the following manner: Starting with the leftmost source program terminator and the first character in text 1, text 1 is compared with the corresponding consecutive source program terminator a.
,
b. Pseudo text 1 is matched with the source program when the ordered sequence of characters constituting pseudo text 1 is equal character by character to the ordered sequence of characters in the source program terminator. For the purpose of matching, a delimiter character of text 1 or source program terminator A, a comma, a semicolon, or a space is considered to be a space. A sequence of two or more space separators is considered to be a single space. If no match is found, the comparison with the subsequent occurrences of pseudo text 1 continues until a match is found or there are no more subsequent occurrences of pseudo text 1.
d. When all occurrences of pseudo text 1 have been compared and no match is found, the subsequent source text is the leftmost source text, and the comparison cycle restarts from the second occurrence of pseudo text 1. e. If a match is found between pseudo text 1 and the source text, the corresponding source text 2 is replaced by the source text in the center of the matching sequence. In the source program, the source text immediately following the rightmost text participating in the match is considered to be the leftmost source text. The comparison cycle restarts from the third occurrence of pseudo text 1. 1. The comparison operation continues until the most existing text in the source program body in the REPLAC operation finds a match or is recognized as the leftmost source program text and participates in a complete comparison cycle. (7) For the sake of matching, comment lines or blank lines present in the source program body and pseudo-text 1 are ignored; the text order in the source program body and pseudo-text 1 is determined according to the basic format rules (see G13/[4092.] 6.7.2 for the detailed description of the basic format). When pseudo-text 2 is substituted into the source program as the result of text replacement, comment lines and blank lines present in it are copied into the result program without change. If comment lines or blank lines in the source program are present in the text sequence that matches the pseudo-text, they are not replaced. (8) Error lines are allowed in the pseudo-text. The text matching in the error lines is called as if the instruction area is not hit. (Details) (9) Except for COPY and REPLACE statements, the syntactic correctness of the entire COBOL source program can only be determined after the corresponding COPY and REPLACE statements have been processed. (10) The text captured into the source program as a result of processing the REPLACE statement is directly included in the source program according to the standard format rules (see 6.7 Standard format in GB/T4092.1). When inserting the text of pseudo text 2 into the source program, it is only possible to introduce additional spaces between the text that already have spaces (including imaginary spaces between source program lines): (I1) If the processing of the REPLACE statement requires the introduction of additional lines in the source program, the indicator area of the introduced line contains the same characters as the line of text to be replaced, unless that line contains a hyphen, in which case the introduced line also contains spaces. If the word value constant in pseudo text 2 is too long to fit on the resulting program without being continued to the next line, then the word value constant is not on the correct line, and an additional continuation line is introduced to accommodate the remainder of the word value constant. If the substitution requires the continued word value constant to continue on the correct line, the program will fail. Additional remarks: This standard was proposed by the Ministry of Machinery and Electronics Industry of the People's Republic of China. This standard was drafted by Nanjing University of Posts and Telecommunications. The main drafters of this standard are Qian Shuren, Wang Jingying, Feng Hui, and Duan Xiang. This standard was first issued in December 1983 and revised for the first time in August 1992.A semicolon or space is considered a single space. A sequence of two or more space characters is considered a single space. If no match is found, the comparison continues with the subsequent occurrences of pseudo text 1 until a match is found or there are no more subsequent occurrences of pseudo text 1.
d. When all occurrences of pseudo text 1 have been compared and no match is found, the subsequent source text is the leftmost source text, and the comparison cycle restarts from the th occurrence of pseudo text 1. e. If a match between source text 1 and source text occurs, the corresponding source text 2 is replaced by the source text in the center of the matching sequence. The source text immediately following the rightmost text participating in the match in the program is considered to be the leftmost source text. The comparison cycle restarts from the th occurrence of pseudo text 1. 1. The comparison operation continues until the most existing text in the source program body in the REPLAC operation finds a match or is recognized as the leftmost source program text and participates in a complete comparison cycle. (7) For the sake of matching, comment lines or blank lines present in the source program body and pseudo-text 1 are ignored; the text order in the source program body and pseudo-text 1 is determined according to the basic format rules (see G13/[4092.] 6.7.2 for the detailed description of the basic format). When pseudo-text 2 is substituted into the source program as the result of text replacement, comment lines and blank lines present in it are copied into the result program without change. If comment lines or blank lines in the source program are present in the text sequence that matches the pseudo-text, they are not replaced. (8) Error lines are allowed in the pseudo-text. The text matching in the error lines is called as if the instruction area is not hit. (Details) (9) Except for COPY and REPLACE statements, the syntactic correctness of the entire COBOL source program can only be determined after the corresponding COPY and REPLACE statements have been processed. (10) The text captured into the source program as a result of processing the REPLACE statement is directly included in the source program according to the standard format rules (see 6.7 Standard format in GB/T4092.1). When inserting the text of pseudo text 2 into the source program, it is only possible to introduce additional spaces between the text that already have spaces (including imaginary spaces between source program lines): (I1) If the processing of the REPLACE statement requires the introduction of additional lines in the source program, the indicator area of the introduced line contains the same characters as the line of text to be replaced, unless that line contains a hyphen, in which case the introduced line also contains spaces. If the word value constant in pseudo text 2 is too long to fit on the resulting program without being continued to the next line, then the word value constant is not on the correct line, and an additional continuation line is introduced to accommodate the remainder of the word value constant. If the substitution requires the continued word value constant to continue on the correct line, the program will fail. Additional remarks: This standard was proposed by the Ministry of Machinery and Electronics Industry of the People's Republic of China. This standard was drafted by Nanjing University of Posts and Telecommunications. The main drafters of this standard are Qian Shuren, Wang Jingying, Feng Hui, and Duan Xiang. This standard was first issued in December 1983 and revised for the first time in August 1992.A semicolon or space is considered a single space. A sequence of two or more space characters is considered a single space. If no match is found, the comparison continues with the subsequent occurrences of pseudo text 1 until a match is found or there are no more subsequent occurrences of pseudo text 1.
d. When all occurrences of pseudo text 1 have been compared and no match is found, the subsequent source text is the leftmost source text, and the comparison cycle restarts from the th occurrence of pseudo text 1. e. If a match between source text 1 and source text occurs, the corresponding source text 2 is replaced by the source text in the center of the matching sequence. The source text immediately following the rightmost text participating in the match in the program is considered to be the leftmost source text. The comparison cycle restarts from the th occurrence of pseudo text 1. 1. The comparison operation continues until the most existing text in the source program body in the REPLAC operation finds a match or is recognized as the leftmost source program text and participates in a complete comparison cycle. (7) For the sake of matching, comment lines or blank lines present in the source program body and pseudo-text 1 are ignored; the text order in the source program body and pseudo-text 1 is determined according to the basic format rules (see G13/[4092.] 6.7.2 for the detailed description of the basic format). When pseudo-text 2 is substituted into the source program as the result of text replacement, comment lines and blank lines present in it are copied into the result program without change. If comment lines or blank lines in the source program are present in the text sequence that matches the pseudo-text, they are not replaced. (8) Error lines are allowed in the pseudo-text. The text matching in the error lines is called as if the instruction area is not hit. (Details) (9) Except for COPY and REPLACE statements, the syntactic correctness of the entire COBOL source program can only be determined after the corresponding COPY and REPLACE statements have been processed. (10) The text captured into the source program as a result of processing the REPLACE statement is directly included in the source program according to the standard format rules (see 6.7 Standard format in GB/T4092.1). When inserting the text of pseudo text 2 into the source program, it is only possible to introduce additional spaces between the text that already have spaces (including imaginary spaces between source program lines): (I1) If the processing of the REPLACE statement requires the introduction of additional lines in the source program, the indicator area of the introduced line contains the same characters as the line of text to be replaced, unless that line contains a hyphen, in which case the introduced line also contains spaces. If the word value constant in pseudo text 2 is too long to fit on the resulting program without being continued to the next line, then the word value constant is not on the correct line, and an additional continuation line is introduced to accommodate the remainder of the word value constant. If the substitution requires the continued word value constant to continue on the correct line, the program will fail. Additional remarks: This standard was proposed by the Ministry of Machinery and Electronics Industry of the People's Republic of China. This standard was drafted by Nanjing University of Posts and Telecommunications. The main drafters of this standard are Qian Shuren, Wang Jingying, Feng Hui, and Duan Xiang. This standard was first issued in December 1983 and revised for the first time in August 1992.
Tip: This standard content only shows part of the intercepted content of the complete standard. If you need the complete standard, please go to the top to download the complete standard document for free.