COBOL Manual for TNS and TNS/R Programs

Libraries and Utility Routines
HP COBOL Manual for TNS and TNS/R Programs522555-006
13-69
COBOL_SETMODE_
lastparams
is a data item at least four characters long that corresponds to the last-params
parameter of the Guardian environment routine SETMODE. For best results, define
it as a group with two NATIVE-2 data items immediately subordinate to it; for
example:
01 LASTPARAMS
02 PARAM1 NATIVE-2
02 PARAM2 NATIVE-2
cpinfo
is a checkpoint list in which the routine records the changes to the message
storage data space. Example:
01 CP-LIST-1.
05 MAX-COUNT PIC 9999 COMP VALUE IS 100.
05 CURRENT-COUNT PIC 9999 COMP VALUE IS 0.
05 ELEMENT PIC 9(9) COMP OCCURS 100 TIMES.
The initial value of MAX-COUNT must be the same as the number of occurrences
of ELEMENT.
In the non-CRE environment, the initial value of MAX-COUNT is the maximum
number of elements that cpinfo can contain. In the CRE, the maximum number
of elements that cpinfo can contain is the initial value of MAX-COUNT divided
by 2.5. The cpinfo in the preceding example can contain 100 elements in the
non-CRE environment, but only 40 in the CRE.
The required number of table elements depends on the number of operations the
list must record. The worst-case situation uses six elements.
A complete checkpoint list is required only when a program has a backup that must
be kept current. When a record of changes is not required, a null checkpoint list
can be used. This is an example description:
03 CP-LIST-1 PIC 9(9) COMP VALUE IS 0.
error-return
is a numeric data item that has one of these values upon completion:
Value Meaning (page 1 of 2)
n The call to SETMODE caused Guardian file error n.
0* No error occurred.
1 A required parameter is missing.
2 file-name is not a COBOL file name.
*error-return is 0 for a deferred call (that is, one that is held until the file is open). If an error occurs at
that time, a run-time diagnostic is issued.