COBOL Manual for TNS and TNS/R Programs
Issues Related to Binding and Linking
HP COBOL Manual for TNS and TNS/R Programs—522555-006
24-22
LESS-CODE Directive
•
Records declared in the File Section are allocated in user data space, but you can
move them to the Extended-Storage Section (user extended space) and back
again with the MOVE statement, the INTO clause of the READ statement, or the
FROM clause of the WRITE or REWRITE statement.
•
In the HP COBOL environment, the CHECKPOINT statement cannot process data
items declared in the Extended-Storage Section.
•
The default access mode for data items in the Extended-Storage Section is
EXTENDED-STORAGE (extended, or 32-bit, addressing). If these data items are
passed as parameters, the corresponding formal parameters must also be 32-bit-
addressed.
•
If an HP COBOL program calls a routine (COBOL or non-COBOL) that uses the
environment routines ALLOCATESEGMENT and USESEGMENT to alter user
extended space, then any extended-storage context the HP COBOL program had
is lost upon return from the called program.
If you call USESEGMENT, you must save the value of the segment ID number of
the segment previously in use (USESEGMENT returns this value) and restore that
value before returning to the COBOL code.
LESS-CODE Directive
When a compiled program is larger than 128 KB, you can recompile it with the directive
LESS-CODE 1 to reduce its object code. Because the directive LESS-CODE 1 also
slows program execution speed, however, LESS-CODE 1 is recommended only for
infrequently called programs.
The LESS-CODE directive applies to every program that it precedes it and every
program that contains it.
If the LESS-CODE directive applies to a main program, the compiler does not generate
code to initialize the Working-Storage Section or Extended-Storage Section. The object
program executes faster, but the object file is significantly larger because it includes
the data for the Working-Storage Section and Extended-Storage Section.
If the LESS-CODE directive applies to a subprogram, the compiler generates code to
initialize the Working-Storage Section, but not the Extended-Storage Section, when the
program is initialized. (An initial program is initialized every time it is called; a noninitial
program is initialized only if it is canceled with a CANCEL statement and then called
with a CALL statement.) To initialize the Extended-Storage Section, the program calls
the operating system routine RESETMEMORY. The program executes more slowly
because calling RESETMEMORY (which requires input-output) takes longer than
executing code to initialize the Extended-Storage Section. The object program is also
larger.