Previous Topic
Table Of Contents
Parent Topic
Next Topic

High-Level Language SWSPutQueue (SWCPQP) Function

Related Topics

Web Server API Function Index


gfNotSgn.gif (211 bytes) See QUEUE operation
gfNotSgn.gif (211 bytes) Not available from Other REXX Interpreters
HLL entry point name is SWCPQP

SWSPutQueue is the Web Server API function used to write lines to the external data queue associated with the current Web transaction thread. The function writes the next (FIFO order) queued data line from a buffer in the application.

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 SWSPutQueue function takes three 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 PTR PIC X(nnn) CHAR(nnn) Output This argument points to the data buffer from which the queue line will be written. The data buffer length may not exceed the maximum line size for queue entries (752 bytes in this release). The buffer data may be a NULL terminated string.
3 SDWORD PIC S9(5) COMP FIXED BIN(31) Input This argument gives the size of the data to be written to the queue. Specify SWS_NTS if the buffer contains a NULL terminated string.

 

Return Values

SWSPutQueue 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  BUFFER    CHAR(752);           /* Buffer area             */
    DCL  BUFFLEN   FIXED BIN(31);       /* Data length             */
 
    ADDR(TCONN)->DMHX = 0;              /* Clear Connection Handle */
 
    MOVE 'DATA TO WRITE' to BUFFER;     /* put some data there     */
    MOVE 13 to BUFFLEN.                 /* set length of data      */
    CALL SWSPutQueue( TCONN             /* write the data          */
                      BUFFER,
                      BUFFLEN);
 
    RC = PLIRETV();                     /* get return code         */
    IF RC ^= SWS_SUCCESS THEN           /* exit program if bad RC  */
       EXIT;
 

 

C Example


 
    HDBC    tConn     = NULL;           /* Connection Handle       */
    long RC;                            /* return code             */
 
    rc = SWSPutQueue( &tConn,         /* query the queue        */
                      "Hello World.",
                      SWS_NTS );
 
    if (rc ^= SWS_SUCCESS) return;      /* exit program if bad RC  */
 

 

COBOL Example


 
    77  TCONN                USAGE IS POINTER.
    77  TBUFFER              PIC X(752).
    77  TBUFFLEN             PIC S9(5) COMP.
 
    MOVE 'DATA TO WRITE' TO TBUFFER.
    MOVE 13 to TBUFFLEN.
    CALL 'SWCPQP' USING TCONN,
                        TBUFFER,
                        TBUFFLEN.
 
    MOVE RETURN-CODE TO WS-SWSAPI-RETURN-CODE.
    IF NOT SWS-SUCCESS GOBACK.
 

Top