|
High-Level Language SWSEbcdicToAscii (SWCPEB) FunctionRelated Topics
SWSEbcdicToAscii is the Web Server API function used to translate an EBCDIC character string to an ASCII character string.
SWCPEB Call ArgumentsThe SWSEbcdicToAscii (SWCPEB) function arguments are described in the table which follows. Only five of the six parameters are required.
Return ValuesSWSEbcdicToAscii always sets a signed numeric return code value. Possible values are:
PL/I Example%INCLUDE SPCPHD . . . . DCL CONNHDL FIXED BIN(31); /* Connection Handle */ DCL RC FIXED BIN(31); /* RETURN CODE */ DCL INLEN FIXED BIN(31); /* Input String Length */ DCL OUTLEN FIXED BIN(31); /* Output String Length*/ DCL INDATA initial('ABCDEFGH') char(8); DCL OUTDATA char(10); /* Output data area */ DCL LANGCODE initial('ENG ') char(4); CALL SWSEbcdicToAscii(CONNHDL, /* Connection Handle */ INLEN, /* Input String Length */ INDATA, /* Input String Area */ OUTLEN, /* Output String Length*/ OUTDATA, /* Output String Area */ LANGCODE); /* Language Code */ RC = PLIRETV(); /* GET RETURN CODE */ IF RC ,= SWS_SUCCESS THEN /* EXIT PROGRAM IF BAD RC */ EXIT;
C Example#include "sccphd.h" /* Neon headers */ . . . . long RC; /* return code */ long connHDL; /* statement handle */ long inlen = 8; /* input buffer length */ long outlen = 10; /* output buffer length */ char outdata]10(; /* input buffer area */ char indata]( = 'ABCDEFGH'; /* eight byte filler field */ char langcode]( = 'ENG '; /* language code */ CALL SWSEbcdicToAscii(connHDL, /* statement handle */ inlen, indata, outlen, outdata, langcode); if (rc ,= SWS_SUCCESS) return rc;
COBOL ExampleCOPY SBCPHD. Neon Copybook . . . . 77 CONNECTION-HANDLE USAGE IS POINTER. 77 LANGUAGE-CODE PIC X(4) VALUE 'ENG '. 01 INPUT-BUFFER. 05 INPUT-DATA-LENGTH PIC S9(5) COMP VALUE 8. 05 INPUT-DATA PIC X(8) VALUE 'ABCDEFGH'. 01 OUTPUT-BUFFER. 05 OUTPUT-DATA-LENGTH PIC S9(5) COMP VALUE 8. 05 OUTPUT-DATA-AREA. 10 OUTPUT-DATA-LEN PIC S9(3) COMP. 10 OUTPUT-DATA PIC X(8). . . . . CALL 'SDCPEB' USING CONNECTION-HANDLE, INPUT-DATA-LENGTH, INPUT-DATA, OUTPUT-DATA-LENGTH, OUTPUT-DATA-AREA, LANGUAGE-CODE. MOVE RETURN-CODE TO WS-SWSAPI-RETURN-CODE. IF NOT SWS-SUCCESS GOBACK. |