COBOL Manual for TNS and TNS/R Programs
Program Compilation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
11-86
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-13 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-13. 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