Previous Topic Table Of Contents Parent Topic Next Topic |  | # High-Level Language SWSClearQueue (SWCPQL) Function Related Topics Web Server API Function Index
| May be used in Shadow/REXX
| Not available from Other REXX Interpreters
| HLL entry point name is SWCPQL
SWSClearQueue is the Web Server API function used to clear the external data queue associated with the current Web transaction thread. Clearing the queue marks it as empty. Normally, an external data queue is allocated and used only when executing Shadow/REXX procedures. However, a queue may now also be used from HLL programs. For HLL program executions, an external data queue may be pre-allocated by coding the QUEUESIZE( ) keyword. If one of the SWSxxxxxQueue HLL functions is invoked, an external data queue is created dynamically, using the default size, if one does not already exist. ## CALL Arguments The SWSClearQueue function takes one to three arguments; only the first is required.
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. The connection handle is an opaque, four-byte address pointer. The connection handle is currently not used, and must be set to zero (NULL).
2 | SDWORD | PIC S9(5) COMP | FIXED BIN(31) | Input | This argument is unused in the current release and must be set to zero.
3 | SDWORD | PIC S9(5) COMP | FIXED BIN(31) | Input | This argument is unused-used in the current release and must be set to zero.

## Return Values

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

SWS_SUCCESS
  The operation succeeded.
SWS_ERROR
  A parameter validation or run-time error was encountered. Error information is available using the SWSERROR function.
SWS_ENVIRONMENT_ERROR
  The request can not be processed because of a run-time environmental error. For example, you invoked the API service outside of a Web transaction procedure or from outside the server's address space. Use the server's wrap-around trace to obtain diagnostic information.
SWS_INVALID_HANDLE
  The connection handle is invalid. No error information is available.
Any other value
  The operation failed.

Top

## PL/I Example

        DCL  TCONN     PTR;                 /* Connection Handle       */
        DCL  RC        FIXED BIN(31);       /* return code             */
        DCL  DMHX      FIXED BIN(31) BASED; /* Dummy Handle field      */
        DCL  FB00      FIXED BIN(31) INIT(0);  /* Dummy argument       */

        ADDR(TCONN)->DMHX = 0;              /* Clear Connection Handle */

        CALL SWSClearQueue( TCONN           /* clear the queue         */
                            FB00,
                            FB00);
        RC = PLIRETV();                     /* get return code         */
        IF RC ^= SWS_SUCCESS THEN           /* exit program if bad RC  */
           EXIT;

## C Example

        HDBC    tConn   = NULL;             /* Connection Handle       */
        SDWORD  tDummy = 0;                 /* dummy argument          */
        long RC;                            /* return code             */

        rc = SWSClearQueue( &tConn,         /* clear the queue        */
                            tDummy,
                            tDummy);
        if (rc ^= SWS_SUCCESS) return;      /* exit program if bad RC  */

## COBOL Example

        77  TCONN                USAGE IS POINTER.
        77  FB00                 PIC S9(5) COMP VALUE 0.

        CALL 'SWCPQL' USING TCONN,
                            FB00,
                            FB00.
        MOVE RETURN-CODE TO WS-SWSAPI-RETURN-CODE.
        IF NOT SWS-SUCCESS GOBACK.

Top