Previous Topic: Function Code 8—Send a Message to MONITOR Receivers

Next Topic: Synchronizing Access to Resources

Return Codes

Following a call to the API, R15 is set to one of the following values:

0

Indicates that the function works.

4

Indicates that the specified length of the message is invalid.

8

Indicates that the specified NCL ID is invalid.

24

Indicates that the specified function code is not supported.

28

Indicates storage shortage.

32

Indicates that the caller is not executing as a subsystem.

Example: Send a Message

This example shows how a message can be sent to the current caller's environment. (It is assumed that an &CALL request is being processed by the subsystem code, and that addressability to the NCPS and NCPN areas has been set up.)

      MVC   CBFC,=F'4'                  FUNC CODE
      MVC   CBML,=A(L'MSG1)             MSG LENGTH
      L     R15,NCPSAPIE                GET API EPA
      CALL  (15),                       CALL API          *
            (CBFC,CBML,MSG1,NCPSNCLI),  WITH THESE PARMS  *
            MF=(E,CWA)                  PLIST BUILT HERE
      ...
MSG1  DC    C'HELLO FROM A SUBSYSTEM'
      ...
CWA   DS    4F                          PARMLIST BUILT HERE
CBFC  DS    F                           FUNCTION CODE
CBML  DS    F                           MESSAGE LENGTH