|
High-Level Language SWSAsciiToEbcdic (SWCPAI) FunctionRelated Topics
SWSAsciiToEbcdic is the Web Server API function used to translate an ASCII character string to an EBCDIC character string.
SWCPAI Call ArgumentsThe SWSAsciiToEbcdic (SWCPAI) function arguments are described in the table which follows. Only five of the six parameters are required.
Return ValuesSWSAsciiToEbcdic 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 SWSAsciiToEbcdic(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 SWSAsciiToEbcdic(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. |