结合使用 CICS 和 DB2 pureXML
2010-06-24 00:00:00 来源:WEB开发网将清单 7 中所示的 COBOL 程序复制到 z/OS,并利用集成的 DB2/CICS/COBOL 编译器编译它。下载 部分的样例代码包含样例编译作业。
清单 7. COBOL 程序
******************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. WEBSLCT.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
*
DATA DIVISION.
*
WORKING-STORAGE SECTION.
*
01 WSRESP PIC S9(8) COMP VALUE 0.
01 WSRESP2 PIC S9(8) COMP VALUE 0.
01 WSFLENGTH PIC S9(8) COMP VALUE 1024.
01 XMLDATA PIC X(1024) VALUE SPACES.
EXEC SQL INCLUDE SQLCA END-EXEC.
LINKAGE SECTION.
PROCEDURE DIVISION.
MAINLINE SECTION.
* Get DB2 data
EXEC SQL
SELECT XMLSERIALIZE(SOAP AS CLOB)
INTO :XMLDATA
FROM REDBOOK.PUREXML
END-EXEC.
* Respond with the XML data by deleting DFHREQUEST
* container and returning DFHRESPONSE container
EXEC CICS DELETE CONTAINER('DFHREQUEST') END-EXEC.
EXEC CICS PUT CONTAINER('DFHRESPONSE')
FROM(XMLDATA)
FLENGTH(WSFLENGTH)
RESP(WSRESP)
RESP2(WSRESP2)
END-EXEC.
* Exit program
EXEC CICS RETURN END-EXEC.
MAINLINE-EXIT.
EXIT.
*----------------------------------------------------------------*
更多精彩
赞助商链接