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

ELSE
START EMP-FILE KEY = DEPT-NO OF EMP-DATA
AFTER POSITION EMP-NO
GENERIC
END-IF
* Zero the counter
* Perform (with test after) until EOF or 10 employees found:
* Read EMP-FILE NEXT record
* If EOF, return array to requester with signal for EOF
* else add 1 to the counter
* copy info to the array
* end-if
In Example 136, suppose that department 1572 has 12 employees:
000131Smith Jan 0001572
001552Nguyen Tracy 0001572
001744Dietrich Pat 0001572
001745Wellhausen Robin 0001572
001746Thomas Kim 0001572
001991Chew Meredith 0001572
004451O'Hara Flemming 0001572
005433Logan Shannon 0001572
006112McClure Beck 0001572
009733Kinoshita Lynn 0001572
012255Bostrup Stacy 0001572
013146Tilden Tex 0001572
If the requester sends a request with an EMP-NO value of zero for department 1572, the server
returns the records for the first 10 employees (131 through 9733) in response. If the requester
sends EMP-NO as 9733 in the second request for department 1572, the START AFTER positions
the file to resume reading after that number, so the server returns the last 2 records in the file.
STARTBACKUP
NOTE: Do not use this directive in the OSS environment.
STARTBACKUP defines options for handling process pairs and starting the backup process.
cpu
is the processor module where the backup process is to run. The cpu parameter is either an
integer numeric literal or an identifier that designates an integer numeric data item. The value
associated with cpu must not be less than 0 nor greater than 15 and cannot designate the
same processor in which the process executing the STARTBACKUP statement is running.
options
is either an integer numeric literal or an identifier that designates an integer numeric data item.
The value must be 0, 1, 2, or 3. The significance of options is:
The fault-tolerant facility is to read and process system messages, and the primary process is to terminate
abnormally if a trap condition occurs. If this option is specified and the primary process is stopped
0
(because of a command interpreter STOP command or by a third process), the backup process stops.
The non-CRE environment run-time processes relevant system messages, such as CPU-DOWN, as part
of this activity. The occurrence of a trap condition in the primary process causes it to fail (see the
explanation of ARMTRAP in the Guardian Programmer’s Guide.) Additionally, if the backup process
fails, the primary process automatically starts a new backup process when it is possible to do so.
This option is the same as option 0 except that if the primary process stops, the backup process takes
over processing of the application.
1
460 Procedure Division Verbs