Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 32
Programming the Requester
Create the database file using FUP commands as follows:
1> FUP
-SET TYPE K
-SET BLOCK 2048
-SET REC 135
-SET IBLOCK 2048
-SET KEYLEN 6
-SHOW
TYPE K
EXT ( 1 PAGES, 1 PAGES)
REC 130
BLOCK 2048
IBLOCK 2048
KEYLEN 6
KEYOFF 0
MAXEXTENTS 16
-CREATE $APPL.SUBAPPL.RECFILE
CREATED - $APPL.SUBAPPL.RECFILE
-EXIT
2>
Because the requester process opens the server by the name $SER1, you need to run
the server process by this name. The following TACL command does this:
1> RUN server-object-file-name /NAME $SER1, NOWAIT/
You can now run as many requester processes as you like as follows:
4> RUN requester-object-file-name
.
.
Programming the Requester
The requester program prompts the user for a function to perform. The user can
choose from the following functions:
Read a record
Add a record
Update an existing record
Exit the program
The requester formulates a request from information entered by the user and sends a
message to the server process containing the appropriate information: a function code
and, for operations that imply writing to the database, the contents of a database
record.
The requester receives a response from the server. The response depends on the
function. For operations that imply reading the database, the response includes
database records. For write operations, a response indicating that the write finished
successfully is enough.