Pathmaker Programming Guide

Coding Custom Services
Creating Services and Servers
067868 Tandem Computers Incorporated 4–21
Coding Custom
Services
When you add a custom service, the Pathmaker product creates a file called the
Custom Source File for you to use for your COBOL85 or C custom service code. This
subsection explains what you need to code in this file, including the Pathmaker
required variables. A brief example of service code and tables listing file error
messages is also included.
Custom Source File For a COBOL85 service, the Custom Source File is the file in which you write COBOL
code for the Working-Storage, Extended-Storage Sections, and Procedure Division of a
the service. For a C service, the Custom Source File is the file in which you write C
code for the service’s functions. A Custom Source File is required for all custom
services.
The Pathmaker product will create a Custom Source File when you add a service to the
project catalog if both of these conditions are true:
You have entered a valid file name into the Custom Source File field on the Service
Definition screen.
A file by that name does not already exist.
The Pathmaker product creates the Custom Source File when you add the service to
the project catalog. If the file named in the Custom Source File field already exists, the
Pathmaker product does not create the file. If you want to add your custom service
code to an existing file, you must add the required section headings for the Working-
Storage Section, the Extended-Storage Section, and the Procedure Division to the file
manually for COBOL85 services. If you want to add C custom service code to an
existing file, you must add the required section heading for the service and the three
required functions to the file manually.
Custom Source File Sections for a COBOL85 Service
The Custom Source File for a COBOL85 service can contain five sections: one for
Extended-Storage, one for Working-Storage, one for Procedure Division code, one for
setup code, and one for cleanup code. These sections must have specific headings in
the Custom Source File :
?SECTION T9XS-
service-name
<−− Extended-Storage
?SECTION T9WS-
service-name
<−− Working-Storage
?SECTION T9PR-
service-name
<−− Procedure Division
?SECTION T9SP-
service-name
<−− Procedure Division, setup code
?SECTION T9CP-
service-name
<−− Procedure Division, cleanup code
where
service-name
is the name of the service that will contain this COBOL code.
The Pathmaker product places these section headings in the Custom Source File for
you unless you are creating the Custom Source File manually.
Code you supply in the setup section will be performed following the perform of
T9154-OPEN-LOCAL-FILES. Code you supply in the cleanup section will be
performed prior to the perform of T9154-CLOSE-LOCAL-FILES. Examples of the type
of tasks that might be accomplished in these sections include loading in-memory
tables into Extended Storage, creating temporary work files, and the explicit opening