|
High-Level Language SWSPutQueue (SWCPQP) FunctionRelated Topics
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 ArgumentsThe SWSPutQueue function takes three arguments, all of which are required.
Return ValuesSWSPutQueue always sets a signed numeric return code value. Possible values are:
PL/I ExampleDCL 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 ExampleHDBC 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 Example77 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. |