COBOL Manual for TNS/E Programs (H06.03+)

Program Compilation
HP COBOL Manual for TNS/E Programs520347-003
11-57
IF and IFNOT
The compiler sees this, depending on the setting of toggles 1 and 2:
Lines whose compilation IF or IFNOT suppresses still appear in the compiler listing. To
keep them from appearing, use NOLIST and LIST directives as the code fragments in
Example 11-10 show.
Toggles On Source Lines Compiled
None
01 MASTER-RECORD.
03 HEADER PICTURE X(30).
1 only
01 MASTER-RECORD.
03 HEADER PICTURE X(30).
03 ACCOUNT-ID PICTURE X(50).
03 TRAILER PICTURE X(100).
2 only
01 MASTER-RECORD.
03 HEADER PICTURE X(30).
1 and 2
01 MASTER-RECORD.
03 HEADER PICTURE X(30).
03 ACCOUNT-ID PICTURE X(50).
03 ACCOUNT-ID-REDEF REDEFINES ACCOUNT-ID.
05 ACCOUNT-GROUP PICTURE X(20).
05 ACCOUNT-CLASS PICTURE X(10).
05 ACCOUNT-NUMBER PICTURE X(20).
03 TRAILER PICTURE X(100).
Example 11-10. Omitting Uncompiled Lines from Compiler Listing
?IF n
?NOLIST
?ENDIF n
?IFNOT n
* Lines compiled if toggle n is not set go here
?ENDIF n
?IF n
?LIST
?ENDIF n
?IFNOT n
?NOLIST
?ENDIF n
?IF n
* Lines compiled if toggle n is set go here
?ENDIF n
?IFNOT n
?LIST
?ENDIF n