OpenTP1 Version 7 Programming Reference COBOL Language

[Contents][Index][Back][Next]

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:

TPEINVAL
Either SERVICE-NAME or PROGRAM-NAME is SPACES, or PROGRAM-NAME is not the name of a valid program.

TPELIMIT
SERVICE-NAME cannot be advertised because of space limitations.

TPEMATCH
SERVICE-NAME is already advertised for the server but with a program other than PROGRAM-NAME. Although TPADVERTISE fails, SERVICE-NAME remains advertised with its current program (that is, PROGRAM-NAME does not replace the current program).

TPEPROTO
TPADVERTISE was called in an improper context.

TPESYSTEM
A communication resource manager system error has occurred. The exact nature of the error is determined in a product-specific manner.

TPEOS
An operating system error has occurred. The exact nature of the error is determined in a product-specific manner.

See also

TPSVCSTART, TPUNADVERTISE.

<<Notes on use with OpenTP1>>

  1. <<The function TPADVERTISE can be called only by SPPs. When the server starts, all services specified in the user service definition are automatically advertised. Combinations of service names and programs can be advertised only when they are specified in the user service definition of this function.>>
  2. <<Under the OpenTP1, if the service group of UAPs which invoke the function TPADVERTISE is the same as the service group of UAPs which have advertised the services, this function returns normally on the assumption that advertisement is completed. If the two groups do not match, the function returns with an error.>>
  3. <<Under the OpenTP1, the maximum length of PROGRAM-NAME is 20 characters.>>