Previous Topic
Table Of Contents
Parent Topic
Next Topic

High-Level Language SWSQueryQueue (SWCPQQ) Function

Related Topics

Web Server API Function Index


gfNotSgn.gif (211 bytes) See QUEUED() built-in function
gfNotSgn.gif (211 bytes) Not available from Other REXX Interpreters
HLL entry point name is SWCPQQ

SWSQueryQueue is the Web Server API function used to query the external data queue associated with the current Web transaction thread. The function returns information about the overall queue size, maximum size of each line, and number of queued lines.

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 SWSQueryQueue function takes four arguments, all of which are 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 FAR * PIC S9(5) COMP FIXED BIN(31) Input This argument receives the maximum size of each queued line. The value returned is 752 in the current release of the product.
3 SDWORD FAR * PIC S9(5) COMP FIXED BIN(31) Input This argument receives a count of the maximum possible lines allocated to the queue; both in-use and free lines are included in the total.
4 SDWORD FAR * PIC S9(5) COMP FIXED BIN(31) Input This argument receives a count of the currently queued lines.

 

Return Values

SWSQueryQueue 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  LINESIZE  FIXED BIN(31) INIT(0);  /* Maximum Line Size    */
    DCL  MAXLINES  FIXED BIN(31) INIT(0);  /* Total Lines          */
    DCL  QUEUED    FIXED BIN(31) INIT(0);  /* Queued Lines         */
 
    ADDR(TCONN)->DMHX = 0;              /* Clear Connection Handle */
 
    CALL SWSQueryQueue( TCONN           /* query the queue         */
                        LINESIZE,
                        MAXLINES,
                        QUEUED );
 
    RC = PLIRETV();                     /* get return code         */
    IF RC ^= SWS_SUCCESS THEN           /* exit program if bad RC  */
       EXIT;
 

 

C Example


 
    HDBC    tConn     = NULL;           /* Connection Handle       */
    SDWORD  tLineSize = 0;              /* Lines Size              */
    SDWORD  tMaxLines = 0;              /* Total lines             */
    SDWORD  tQueued   = 0;              /* Queued Lines            */
    long RC;                            /* return code             */
 
    rc = SWSQueryQueue( &tConn,         /* query the queue        */
                        &tLineSize,
                        &tMaxLines,
                        &tQueued );
 
    if (rc ^= SWS_SUCCESS) return;      /* exit program if bad RC  */
 

 

COBOL Example


 
    77  TCONN                USAGE IS POINTER.
    77  TLINESSIZE           PIC S9(5) COMP VALUE 0.
    77  TMAXLINES            PIC S9(5) COMP VALUE 0.
    77  TQUEUED              PIC S9(5) COMP VALUE 0.
 
    CALL 'SWCPQQ' USING TCONN,
                        TLINESIZE,
                        TMAXLINES,
                        TQUEUED.
 
    MOVE RETURN-CODE TO WS-SWSAPI-RETURN-CODE.
    IF NOT SWS-SUCCESS GOBACK.
 

Top