With the *CONTROL (or *CBL) statement, you can selectively display or suppress the listing of source code and storage maps throughout the source text.
| Format |
|---|
|
For a complete discussion of the output produced by these options, see the COBOL for Windows Programming Guide.
See the LSTFILE compiler option in the COBOL for Windows Programming Guide for information on specifying whether listings are encoded in UTF-8 or in the code page specified by the compile-time locale.
The *CONTROL and *CBL statements are synonymous. *CONTROL is accepted anywhere that *CBL is accepted.
The characters *CONTROL or *CBL can start in any column beginning with column 7, followed by at least one space or comma and one or more option keywords. The option keywords must be separated by one or more spaces or commas. This statement must be the only statement on the line, and continuation is not allowed. The statement can be terminated with a period.
The *CONTROL and *CBL statements must be embedded in a program source. For example, in the case of batch applications, the *CONTROL and *CBL statements must be placed between the PROCESS (CBL) statement and the end of the program (or END PROGRAM marker, if specified).
The source line containing the *CONTROL (*CBL) statement will not appear in the source listing.
If an option is defined at installation as a fixed option, that fixed option takes precedence over all of the following:
The requested options are handled in the following manner:
Listing of the input source text lines is controlled by any of the following statements:
*CONTROL SOURCE [*CBL SOURCE] *CONTROL NOSOURCE [*CBL NOSOURCE]
If a *CONTROL NOSOURCE statement is encountered and SOURCE has been requested as a compilation option, printing of the source listing is suppressed from this point on. An informational (I-level) message is issued stating that printing of the source has been suppressed.
The compiler always produces an object code listing. The LIST and NOLIST options of the *CONTROL (or *CBL) statement are syntax checked but have no effect on the object code listing.
Listing of storage map entries is controlled by any of the following statements occurring in the data division:
*CONTROL MAP [*CBL MAP] *CONTROL NOMAP [*CBL NOMAP]
If a *CONTROL NOMAP statement is encountered, and MAP has been requested as a compilation option, listing of storage map entries is suppressed from this point on.
For example, either of the following sets of statements produces a storage map listing in which A and B will not appear:
*CONTROL NOMAP *CBL NOMAP
01 A 01 A
02 B 02 B
*CONTROL MAP *CBL MAP