NET/MASTER Network Control Language (NCL) Programmer's Guide
Working With Server Classes
Working With Pathway Server Classes
106160 Tandem Computers Incorporated 15–23
Working With Server
Classes
This subsection presents a step-by-step example that demonstrates how to
communicate with a Pathway server process from an NCL PATHSEND requester. It
shows an example of:
An NCL PATHSEND requester used to communicate with a Pathway server
process
A panel description file used by the NCL PATHSEND requester
A DDL source schema file used as the input for creating the user-defined maps
used by the NCL PATHSEND requester
A COBOL server program used to create the Pathway server process
Comments throughout the source code in the NCL PATHSEND requester, the panel
description file, and the COBOL server program describe how each works.
This subsection does not describe how to create, configure, or start a Pathway system:
it assumes that you have an existing Pathway system to which you can add a Pathway
SERVER object.
To see how this example works, follow these steps:
1. Type the following NCL procedure in your user procedure library, calling it
ZEX1501N:
zex1501n: PROCEDURE
/* This procedure is an NCL PATHSEND requester. */
/* It displays a panel to get a request message */
/* to send to a Pathway server process and to */
/* display a reply message received from the */
/* Pathway server process. */
ON ERROR FLUSH
CALL make_server_available SHARE &status
CALL send_and_receive_message SHARE &status
CALL make_server_unavailable SHARE &status
/* =============== MAKE SERVER AVAILABLE =============== */
make_server_available: PROCEDURE
/* Make server available for NonStop NET/MASTER and NCL */
INTCLEAR TYPE=ANY
INTCMD "PSNDCTL OPEN=$TRPM.SERVER-1 ID=DYNAMIC SWGUID=NO"
INTREAD
PSEND OPEN ID=ID1 PSNDID=DYNAMIC FORMAT=MAPPED MAP=ENTRY_REPLY
/* The following statement makes the server available using */
/* unmapped request and reply messages: */
/* PSEND OPEN ID=ID2 PSNDID=DYNAMIC FORMAT=UNMAPPED */
SELECT &SYS.PSEND.RC
WHEN 8 THEN &status = "Open request accepted"
WHEN 12 THEN &status = "Open request rejected"
WHEN 16 THEN &status = "Error occurred" &SYSMSG
OTHERWISE
&status = "Unexpected error"
END /*select*/
END make_server_available
/* ============= SEND AND RECEIVE MESSAGE ============== */