|
High-Level Language SWSGetQueue (SWCPQG) FunctionRelated Topics
SWSGetQueue is the Web Server API function used to read lines from the external data queue associated with the current Web transaction thread. The function returns the next (FIFO order) queued data line, if any, to 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 SWSGetQueue function takes four arguments, all of which are required.
Return ValuesSWSGetQueue 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) INIT(752); /* Size of buffer */ DCL LINELEN FIXED BIN(31) INIT(0); /* Actual line size */ ADDR(TCONN)->DMHX = 0; /* Clear Connection Handle */ CALL SWSGetQueue( TCONN /* read the queue */ BUFFER, BUFFLEN, LINELEN ); RC = PLIRETV(); /* get return code */ IF RC = SWS_NO_DATA_FOUND THEN /* queue is empty */ do something else IF RC ^= SWS_SUCCESS THEN /* exit program if bad RC */ EXIT;
C ExampleHDBC tConn = NULL; /* Connection Handle */ char tbuffer[752]; /* buffer area */ SDWORD tbufflen = 752; /* buffer length */ SDWORD tLineLen = 0; /* actual line length */ long RC; /* return code */ rc = SWSGetQueue( &tConn, /* query the queue */ &tbuffer, tbufflen, &tLineLen ); 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 VALUE 752. 77 TLINESIZE PIC S9(5) COMP VALUE 0. CALL 'SWCPQG' USING TCONN, TBUFFER, TBUFFLEN, TLINESIZE. MOVE RETURN-CODE TO WS-SWSAPI-RETURN-CODE. IF SWS-NO-DATA-FOUND THEN do something else END-IF. IF NOT SWS-SUCCESS GOBACK. |