|
High-Level Language SWSSET (SWCPSO) FunctionRelated Topics
The SWSSET built-in function allows the caller to control various run-time environmental options. Following is a list of functions that may be specified:
CALL ArgumentsThe SWSSET function takes four arguments.
Return ValuesSWSSET always sets a signed numeric return code value. Possible values are:
PL/I ExampleDCL TCONN PTR; /* Connection Handle */ DCL TDATA CHAR(256); /* data buffer area */ DCL TSIZE FIXED BIN(31); /* data length */ DCL RC FIXED BIN(31); /* return code */ DCL DMHX FIXED BIN(31) BASED; /* Dummy Handle field */ ADDR(TCONN)->DMHX = 0; /* Clear Connection Handle */ TDATA = 'SYSTEM/ERROR/500'; /* Set rescan URL value */ TSIZE = 16; /* set length */ CALL SWSSET( TCONN /* Set rescan URL value */ SWS_OPTION_RESCAN, TDATA, TSIZE ); RC = PLIRETV(); /* get return code */ IF RC ^= SWS_SUCCESS THEN /* if bad RC, then go */ GOTO ERROR_LABEL; /* report the error or */ /* abort the transaction */ CALL PLIRETC(0); /* Rescan URL is set up, so*/ RETURN(0); /* let Server do re-match */ Other function call formats: CALL SWSSET( TCONN SWS_OPTION_FLUSH); CALL SWSSET( TCONN SWS_OPTION_NOFLUSH); TSIZE = 3; CALL SWSSET( TCONN, SWS_OPTION_SENDTRACE, SWS_OPTION_YES, TSIZE ); TSIZE = 2; CALL SWSSET( TCONN, SWS_OPTION_PARSETRACE, SWS_OPTION_NO, TSIZE ); TSIZE = 4; CALL SWSSET( TCONN, SWS_OPTION_RESPMODE, SWS_OPTION_NONE, TSIZE ); TDATA = '5' TSIZE = 1; CALL SWSSET( TCONN, SWS_OPTION_DPRTY, TDATA, TSIZE ); TDATA = '100' TSIZE = 3; CALL SWSSET( TCONN, SWS_OPTION_AUTOFLUSH, TDATA, TSIZE ); TDATA = '32000' TSIZE = 5; CALL SWSSET( TCONN, SWS_OPTION_MAXRESPBYTES, TDATA, TSIZE ); TDATA = '55'; TSIZE = 2; CALL SWSSET( TCONN, SWS_OPTION_MAXRESPBUFFERS, TDATA, TSIZE ); TDATA = 'USER DATA MESSAGE'; TSIZE = 17; CALL SWSSET( TCONN, SWS_OPTION_USERDATA1, TDATA, TSIZE ); TDATA = 'SECURED USER DATA MESSAGE'; TSIZE = 25; CALL SWSSET( TCONN, SWS_OPTION_USERDATA2, TDATA, TSIZE ); TDATA = 'FRA2' TSIZE = 4; CALL SWSSET( TCONN, SWS_OPTION_ASCIIEBCDICMAP, TDATA, TSIZE );
C ExampleHDBC tConn = NULL; /* Connection Handle */ char tData[] = "SYSTEM/ERROR/500"; /* rescan URL value */ long RC; /* return code */ rc = SWSSet( &tConn, /* set rescan URL value */ SWS_OPTION_RESCAN, tdata, strlen(tdata) ); if (rc ^= SWS_SUCCESS) return; /* if bad RC from SWSSET */ { /* perform some appl-dep. */ ... /* error recovery or abort */ }; /* processing. */ else /* Otherwise, URL is set so*/ return 0; /* let Server do re-match */ Other function call formats: rc = SWSSet( &tConn, SWS_OPTION_FLUSH); rc = SWSSet( &tConn, SWS_OPTION_NOFLUSH); rc = SWSSet( &tConn, SWS_OPTION_SENDTRACE, SWS_OPTION_NO, strlen(SWS_OPTION_NO)); rc = SWSSet( &tConn, SWS_OPTION_PARSETRACE, SWS_OPTION_NO, strlen(SWS_OPTION_NO)); rc = SWSSet( &tConn, SWS_OPTION_RESPMODE, SWS_OPTION_SERVER, strlen(SWS_OPTION_SERVER)); char tData[] = "-40"; rc = SWSSet( &tConn, SWS_OPTION_DPRTY, tdata, strlen(tdata) ); char tData[] = "50"; rc = SWSSet( &tConn, SWS_OPTION_AUTOFLUSH, tdata, strlen(tdata) ); char tData[] = "2000000"; rc = SWSSet( &tConn, SWS_OPTION_MAXRESPBYTES, tdata, strlen(tdata) ); char tData[] = "80"; rc = SWSSet( &tConn, SWS_OPTION_MAXRESPBUFFERS, tdata, strlen(tdata) ); char tData[] = "USER DATA MESSAGE"; rc = SWSSet( &tConn, SWS_OPTION_USERDATA1, tdata, strlen(tdata) ); char tData[] = "SECURED USER DATA MESSAGE"; rc = SWSSet( &tConn, SWS_OPTION_USERDATA2, tdata, strlen(tdata) ); char tData[] = "FRA2"; rc = SWSSet( &tConn, SWS_OPTION_ASCIIEBCDICMAP, tdata, strlen(tdata) ); COBOL Example77 TCONN USAGE IS POINTER. 77 TDATA PIC X(128). 77 TSIZE PIC S9(5) COMP. MOVE 'SYSTEM/ERROR/500' TO TDATA. MOVE 16 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-RESCAN, TDATA, TSIZE. MOVE RETURN-CODE TO WS-SWSAPI-RETURN-CODE. IF NOT SWS-SUCCESS PERFORM 9999-ABORT-PROCEDURE. MOVE 0 to RETURN-CODE. GOBACK. Other function call formats: CALL 'SWCPSO' USING TCONN, SWS-OPTION-FLUSH. CALL 'SWCPSO' USING TCONN, SWS-OPTION-NOFLUSH. MOVE 3 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-SENDTRACE, SWS-OPTION-YES, TSIZE. MOVE 2 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-PARSETRACE, SWS-OPTION-NO, TSIZE. MOVE 4 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-RESPMODE, SWS-OPTION-NONE, TSIZE. MOVE '-17' TO TDATA. MOVE 3 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-DPRTY, TDATA, TSIZE. MOVE '100' TO TDATA. MOVE 3 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-AUTOFLUSH, TDATA, TSIZE. MOVE '100000' TO TDATA. MOVE 6 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-MAXRESPBYTES, TDATA, TSIZE. MOVE '255' TO TDATA. MOVE 3 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-MAXRESPBUFFERS, TDATA, TSIZE. MOVE 'USER DATA MESSAGE' TO TDATA. MOVE 17 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-USERDATA1, TDATA, TSIZE. MOVE 'SECURED USER DATA MESSAGE' TO TDATA. MOVE 25 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-USERDATA2, TDATA, TSIZE. MOVE 'FRA2' TO TDATA. MOVE 4 TO TSIZE. CALL 'SWCPSO' USING TCONN, SWS-OPTION-ASCIIEBCDICMAP, TDATA, TSIZE. |