TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Designing Your Application
NonStop TS/MP Pathsend and Server Programming Manual–132500
2-25
Server Program Structure
Server Program Structure
Example 2-2 illustrates the structure of a single-function server program written in
COBOL85. The program in the following example handles data entry for the order-
processing application introduced at the beginning of this section.
Note. The program in Example 2-2 illustrates program structure only; it is not a complete
program. For an example of a complete, running Pathway server program, refer to Appendix B,
Examples.
Example 2-2. COBOL85 Server Program Example (page 1 of 3)
IDENTIFICATION DIVISION. Declares server name.
PROGRAM-ID. ORDER-SERVER.
ENVIRONMENTAL DIVISION.
CONFIGURATION SECTION.
SPECIAL NAMES. Defines source library file
FILE “$src.srvlib.orderlib” IS COBOL-LIB. names.
FILE “$obj.srvlib.ocmgrobj” IS COMM-MGR.
INPUT-OUTPUT SECTION.
Selects logical names for
FILE CONTROL. $RECEIVE and all database
SELECT MSG-IN files accessed by server.
ASSIGN TO $RECEIVE $RECEIVE is a Guardian
FILE STATUS IS RCV-STAT IN WS-RCV-INFO. file that receives and stores
messages transmitted between
SELECT MSG-OUT requesters and servers.
ASSIGN TO $RECEIVE
FILE STATUS IS RCV-STAT IN WS-RCV-INFO.
SELECT LAST-ID
ASSIGN TO $DATA.ORDER.LASTID
ORGANIZATION IS RELATIVE
ACCESS IS SEQUENTIAL
RECORD KEY IS WS-LASTID-REL-KEY
FILE STATUS IS FILE-STAT IN WS-FILE-INFO.
.
.
.
RECEIVE-CONTROL. Declares number of
TABLE OCCURS 5 TIMES concurrent opens and
SYNCDEPTH IS 1 maximum size of largest
REPLY CONTAINS 204 CHARACTERS. request message.
DATA DIVISION.
FILE SECTION.
Declares record data
FD MSG-IN structures for logical file
RECORD CONTAINS 204 CHARACTERS names.
LABEL RECORDS ARE OMITTED
01 ORDER-MSG.
.
.
.