Queries the Shift Out/Shift In (SO/SI) processing settings for a column or parameter.
This function is used with the Japanese Conversion Module
(JCM).
COPY SYGWCOB.
01 TDPROC PIC S9(9) USAGE COMP SYNC. 01 RETCODE PIC S9(9) USAGE COMP SYNC. 01 OBJECT-TYPE PIC S9(9) USAGE COMP SYNC. 01 OBJECT-NUMBER PIC S9(9) USAGE COMP SYNC. 01 STRIP-SOSI PIC S9(9) USAGE COMP SYNC.
CALL 'TDSETSOI' USING TDPROC, RETCODE, OBJECT-TYPE, OBJECT-NUMBER, STRIP-SOSI.
(I) Handle for this client/server connection. This must be the same value specified in the associated TDACCEPT call. The TDPROC handle corresponds to the connection and command handles in Open Client Client-Library.
(O) Variable where the result of function execution is returned. Its value is one of the codes listed in Table 3-10.
(I) Type of object to be checked. This argument specifies which type of object is checked by this call: a column in a return row or a return parameter.
Assign OBJECT-TYPE one of the following values:
TDS-OBJECT-COL (1) |
Object is a column in a return row. |
TDS-OBJECT-PARM (2) |
Object is a return parameter. |
(I) Order number of the column or parameter being checked.
If the object is a column, this is the position of the column in the row, counting from left to right. Columns are numbered sequentially with the leftmost column in a row number 1.
If the object is a return parameter, this is the number of the parameter with the value that is being checked. All parameters are counted, whether or not they are return parameters. Parameters are numbered sequentially with the first parameter number 1.
(O) The SO/SI processing setting being used for this column or parameter.
STRIP-SOSI returns one of the following values:
TDS-STRIP-SOSI (0) |
SO/SI codes are stripped before being sent to the client. This is the default. |
TDS-BLANK-SOSI (1) |
SO/SI codes are converted to blanks before being sent to the client. |
The RETCODE argument can contain any of the return values listed in Table 3-10.
Return value |
Meaning |
---|---|
TDS-OK (0) |
Function completed successfully. |
TDS-ENTRY-NOT-FOUND (-8) |
The specified column number, transaction number, or parameter does not exist. |
TDS-INVALID-FLAGS (-176) |
Invalid padding option for a field. |
TDS-INVALID-PARAMETER (-4) |
Invalid parameter value. The value assigned to one or more of the arguments supplied in the call is not valid. The operation failed. |
TDS-INVALID-TDPROC (-18) |
Error in specifying a value for the TDPROC argument. |
The following code fragment uses TDGETSOI to replace SO/SI codes with blanks before retrieving parameters and again before returning data to the client. This example is not included on the Open ServerConnect API tape, but is available to Japanese customers on the Japanese Conversion Module tape.
**************************************************************** PROCEDURE DIVISION. **************************************************************** CALL ‘TDINIT’ USING DFHEIBLK, GWL-RC, GWL-INIT-HANDLE. * CALL ‘TDACCEPT’ USING GWL-PROC, GWL-RC, GWL-INIT-HANDLE, SNA-CONNECTION-NAME, SNA-SUBC. * CALL ‘TDRESULT’ USING GWL-PROC, GWL-RC. * * get the information of sosi * MOVE TDS-OBJECT-PARM TO PRM-01-OBJ-TYPE. MOVE PRM-01-ID TO PRM-01-OBJ-ID. CALL ‘TDGETSOI’ USING GWL-PROC, GWL-RC, PRM-01-OBJ-TYPE, PRM-01-OBJ-ID, PRM-01-STRIP-SOSI. * IF PRM-01-STRIP = TDS-STRIP-SOSI THEN * * specify the embedded blanks to the parameter * MOVE TDS-BLANK-SOSI TO PRM-01-STRIP-SOSI CALL ‘TDSETSOI’ USING GWL-PROC, GWL-RC, PRM-01-OBJ-TYPE, PRM-01-OBJ-ID, PRM-01-STRIP-SOSI * END-IF * MOVE TDSCHAR TO PRM-01-HOST-TYPE. * MOVE LENGTH OF PRM-01-DATA TO PRM-01-MAX-LEN. * CALL ‘TDRCVPRM’ USING GWL-PROC, GWL-RC, PRM-01-ID, PRM-01-AREA, PRM-01-HOST-TYPE, PRM-01-MAX-LEN, PRM-01-ACT-LEN. * CALL ‘TDESCRIB’ USING GWL-PROC, GWL-RC, COL-01-NUM, COL-01-HOST-TYPE, COL-01-HOST-LEN, COL-01-AREA, COL-01-NULL-INDICATOR, TDS-FALSE, COL-01-CLIENT-TYPE, COL-01-CLIENT-LEN, COL-01-NAME, COL-01-NAME-LEN. * * get the information of sosi * MOVE TDS-OBJECT-COL TO COL-01-OBJ-TYPE. MOVE COL-01-NUM TO COL-01-OBJ-ID. CALL ‘TDGETSOI’ USING GWL-PROC, GWL-RC, COL-01-OBJ-TYPE, COL-01-OBJ-ID, COL-01-STRIP-SOSI. * IF COL-01-STRIP-SOSI = TDS-STRIP-SOSI THEN * * specify the embedded blanks to the column * MOVE TDS-BLANK-SOSI TO COL-01-STRIP-SOSI CALL ‘TDSETSOI’ USING GWL-PROC, GWL-RC, COL-01-OBJ-TYPE, COL-01-OBJ-ID, COL-01-STRIP-SOSI END-IF * * PERFORM FETCH-AND-SEND-ROWS UNTIL ALL-DONE.
Use TDGETSOI to determine whether SO/SI codes in double-byte character strings are stripped or converted to blanks before results are returned to the client.
SO/SI codes are used with character datatypes to set off double-byte characters. Graphic datatypes do not use SO/SI codes.
Replacing SO/SI codes with blanks maintains the length of the string. Otherwise, if SO/SI codes are stripped, the result length is shorter than the source length.
For more information about Shift Out and Shift In codes, read “Character sets” and “Processing Japanese client requests”.
Related functions
Related topics
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |