Previous Topic
Table Of Contents
Parent Topic

High-Level Language SWSWTO (SWCPWT) Function

Related Topics

Web Server API Function Index


gfchkmrk.gif (134 bytes) May be used in Shadow/REXX
gfchkmrk.gif (134 bytes) May be used from Other REXX Interpreters
gfchkmrk.gif (134 bytes) HLL entry point name is SWCPWT

The SWSWTO function allows a message to be written to the MVS operator console. Optionally, a route code can be supplied. If a zero route code is coded, the default will be used. The route code is one of four constants, which is described below. Each constant determines a set of route and descriptor codes, which is described in the IBM publication - - Assembler Services Reference.

gfgraybr.gif (1830 bytes)

CALL Arguments

The SWSWTO function takes four arguments. All four arguments must be specified on the call.

Arg.
No.
HLL Argument Type I/O Description of Argument
c COBOL PL/I
1 HDBC USAGE POINTER PTR Input The Web Server connection handle is an opaque, four-byte address pointer. The connection handle is currently not used, and must be set to zero (NULL).
2 PTR PIC X(nnn) CHAR(nnn) Input This is the message passed to the WTO service. You can specify a null terminated string, or explicitly provide the value length via the third argument. The maximum length is 70 bytes.
3 SDWORD PIC S9(5) COMP FIXED BIN(31) Input This the size of the data value given by the second argument passed to WTO. You can optionally specify SWS_NTS to indicate the data is a null terminated string.
4 UDWORD PIC S9(5) COMP FIXED BIN(31) Input This argument is one of the following constants:

SWS-WTO-INFO rtcde(1)desc(4,9)
SWS-WTO-WARN rtcde(1,11)desc(4,9)
SWS-WTO-SEVERE rtcd(1,11)desc(1,11)
SWS-WTO-HARDCOPY none

 

gfgraybr.gif (1830 bytes)

Return Values

SWSWTO always sets a signed numeric return code value. Possible values are:

SWS_SUCCESS
The operation succeeded. The specified data was written to the product's wrap-around trace.
SWS_ERROR
A parameter validation or run-time error was encountered. Error information is available using the SWSERROR function.
SWS_INVALID_HANDLE
The connection handle is invalid. No error information is available.
Any other value
The operation failed.
 

Top

gfgraybr.gif (1830 bytes)

PL/I Example

 
    DCL  TCONN     PTR;                 /* Connection Handle       */
    DCL  TDATA     CHAR(70);            /* Text output area        */
    DCL  TSIZE     FIXED BIN(31);       /* Text length area        */
    DCL  RC        FIXED BIN(31);       /* return code             */
    DCL  DMHX      FIXED BIN(31) BASED; /* Dummy Handle field      */
 
 
    ADDR(TCONN)->DMHX = 0;              /* Clear Connection Handle */
 
    TDATA    = 'WTO Message Text';      /* Set output area         */
    TSIZE    = 16;                      /* set length              */
    CALL SWSWTO( TCONN                  /* output trace message    */
                 TDATA,
                 TSIZE,
                 SWS-WTO-INFO );
    RC = PLIRETV();                     /* get return code         */
    IF RC ^= SWS_SUCCESS THEN           /* exit program if bad RC  */
       EXIT;
 
gfgraybr.gif (1830 bytes)

C Example

 
    HDBC tConn   = NULL;                /* Connection Handle       */
    char tData[] = "Null-terminated!";  /* Text string definition  */
    long RC;                            /* return code             */
 
    rc = SWSWto( &tConn,                /* output trace message    */
                 tData,
                 SWS_NTS,
                 SWS-WTO-INFO );
    if (rc ^= SWS_SUCCESS) return;      /* exit program if bad RC  */
 

gfgraybr.gif (1830 bytes)

COBOL Example

 
    77  TCONN                USAGE IS POINTER.
    77  TDATA                PIC X(70).
    77  TSIZE                PIC S9(5) COMP.
    77  DESC                 PIC S9(5) COMP VALUE 12.
    77  ROUTE                PIC S9(5) COMP VALUE 1.
 
    MOVE 'WTO MESSAGE'   TO TDATA.
    MOVE 11              TO TSIZE.
 
    CALL 'SWCPWT' USING TCONN,
                  TDATA,
                  TSIZE,
                  SWS-WTO-INFO.
 
    MOVE RETURN-CODE TO WS-SWSAPI-RETURN-CODE.
    IF NOT SWS-SUCCESS GOBACK.
 

 


Top