──┬─ $ ──┬─┬─────────┬─ NEWSEGMENT ────────────────────────────────────┤ └─ $$ ─┘ ├─ RESET ─┤ └─ SET ───┘
Explanation
This control option causes subroutines to be stored in new code segments, which enables excessively large WFL subroutines to compile. Before you use the NEWSEGMENT option, you should attempt to reduce the size of a large subroutine so that WFL compiles without the NEWSEGMENT option.
If you use the NEWSEGMENT option, the option can be set before the subroutine and reset after the subroutine. The default value is RESET.
Note: | You should only use this option if the following message displays while compiling a large subroutine: |
ERROR: CODE SEGMENT CAPACITY EXCEEDED - THE SUBROUTINE <name> IS TOO LARGE AND MUST BE BROKEN INTO SMALL SUBROUTINES. ***** COMPILATION ABORTED *****
Example
In the following job, the NEWSEGMENT option creates a new code segment for each procedure. This option increases the size of the WFL code file and might cause the WFL job to execute more slowly. However, it might enable compilation of some excessively large WFL jobs that otherwise could not compile.
$$SET NEWSEGMENT BEGIN JOB NEWSEGMENT: FILE F; SUBROUTINE SETUP; BEGIN F(TITLE=FILE/NAME,KIND=DISK,NEWFILE); . . . END;
SUBROUTINE MAKEFILE; BEGIN OPEN(F); LOCK(F); . . . END MAKEFILE; . . .
SETUP; MAKEFILE; . . . END JOB;