OpenTP1 Version 7 Programming Reference COBOL Language
TPADVERTISE - Advertise a service name
Format
01 SERVICE-NAME PIC X(15). 01 PROGRAM-NAME PIC X(32). 01 TPSTATUS-REC. COPY TPSTATUS. CALL "TPADVERTISE" USING SERVICE-NAME PROGRAM-NAME TPSTATUS-REC. |
Description
TPADVERTISE allows a server to advertise the services that it offers. By default, a server's services are advertised when it is booted and unadvertised when it is shutdown.
TPADVERTISE advertises SERVICE-NAME for the server. SERVICE-NAME should be 15 characters or fewer, but cannot be SPACES. Longer names are accepted and truncated to 15 characters. Users should make sure that truncated names do not match other service names. PROGRAM-NAME is the name of a service program. This program is invoked whenever a request for SERVICE-NAME is received by the server. PROGRAM-NAME cannot be SPACES.
If SERVICE-NAME is already advertised for the server and PROGRAM-NAME matches its current program, TPADVERTISE returns success (this includes truncated names that match already advertised names). However, if SERVICE-NAME is already advertised for the server but PROGRAM-NAME does not match its current program, an error is returned (this can happen if truncated names match already advertised names).
<<Data areas>>
<<SERVICE-NAME
Specify the name of the service to be advertised.>>
<<PROGRAM-NAME
Specify the name of the service program.>>
<<TPSTATUS-REC
Will be assigned the return value indicating the result of TPADVERTISE execution.>>
Return value
Upon successful completion, TPADVERTISE sets TP-STATUS to TPOK.
Errors
Under the following conditions, TPADVERTISE fails and sets TP-STATUS to one of the following values:
See also
TPSVCSTART, TPUNADVERTISE.
<<Notes on use with OpenTP1>>
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.