CBL APOST ***************************************************************** * MODULE NAME = YUI0003H * * * * (C) Copyright Matter of Fact Software 2012. * * * * This is a sample program. You are free to copy any part of it.* * However, it serves only as an example and is NOT to be consid-* * ered part of the CICS JS/Server product itself. * * * ***************************************************************** * CHANGE ACTIVITY : * * 01.00 SDM August 2012 Creation * * * ***************************************************************** * CICS Resources Required: * * * * Install RDO G(DFHWEB) * * we will use the alias transaction CWBA in this example * * * * TCPIPService: HTTPNSSL see sample in RDO G(DFH$SOT) * * set Authenticate(Basic) * * chose an available TCPIP Port number * * set Analyser to DTKWBAOX (see sample source supplied) * * * * Program Autoinstall should be active. * * * ***************************************************************** * URL to put into the web browser: * * http://www.xxx.yyy.zzz:port_num/CICS/CWBA/YUI0003H * ***************************************************************** * CICS JS/Server * * ============== * * This sample program demonstrates how the YUI Library can be * * used by simple CICS applications. * * * * The program uses a dedicated TCPIPSERVICE with a customised * * copy of the IBM Supplied sample analyser program, DFHWBAOX. * * * * The customisation to DFHWBAOX simply causes the MF3COM00 prog-* * ram to be linked to if the incoming Web Alias transaction * * specifies 'MF3Z' indicating that it is a call for YUI. * * * * When called, this program constructs a web document * * that contains the YUI and HTML required to display a YUI * * DataTable. The data within the table is hard coded within* * the program. It could come from elsewhere, obviously. * * * * The program uses relative addressing to make the call back for* * YUI through the same TCPIPService as the original call to * * start the program. * * * * The program uses aspects of YUI and so you should ensure * * that the same version of YUI is used at runtime. It was * * developed to use YUI 3.5.1. * * * ***************************************************************** IDENTIFICATION DIVISION. PROGRAM-ID. YUI0003H. DATE-WRITTEN. MAY 2012. DATE-COMPILED. MAY 2012. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 WC-PGM-CONTROL. 05 WC-PGM-CONTROL-VERSION PIC X(4) VALUE '0100'. 05 WL-THIS-PROGRAM-NAME PIC X(8) VALUE 'YUI0003H'. ****************************************************** 01 SITE-DEF-CHARSET PIC X(10) VALUE 'ISO-8859-1'. 01 W-CHARSET PIC X(40) VALUE SPACES. 01 W-DTOKEN-2 PIC X(16). ****************************************************** 01 W-PAGE-START. 02 pic x(06) value ''. 02 PIC X(2) VALUE X'0D25'. 02 pic x(06) value ''. 02 PIC X(2) VALUE X'0D25'. 02 pic x(35) value 'YUI0003H: CICS App using YUI'. 02 pic x(08) value ''. 02 PIC X(2) VALUE X'0D25'. 02 pic x(22) value ''. 02 PIC X(2) VALUE X'0D25'. 02 pic x(23) value ''. 02 PIC X(2) VALUE X'0D25'. ****************************************************** 01 W-YUI-CONFIG. 02 pic x(08) value ''. 02 PIC X(2) VALUE X'0D25'. ****************************************************** 01 W-YUI-SCRIPT. 02 pic x(08) value ''. 02 PIC X(2) VALUE X'0D25'. 02 pic x(07) value ''. ****************************************************** 01 W-PAGE-BODY. 02 PIC X(2) VALUE X'0D25'. 02 pic x(28) value ''. 02 PIC X(2) VALUE X'0D25'. 02 pic x(31) value ''. 02 PIC X(2) VALUE X'0D25'. 02 pic x(15) value '
'. 02 pic x(06) value '
'. 02 PIC X(2) VALUE X'0D25'. 02 pic x(07) value ''. 02 PIC X(2) VALUE X'0D25'. 02 pic x(07) value ''. ****************************************************** LINKAGE SECTION. 01 DFHCOMMAREA. 05 COMMAREA-MAX PIC X(32760). ***************************************************************** PROCEDURE DIVISION USING DFHEIBLK DFHCOMMAREA. 0000-CONTROL SECTION. 0000-CNTL. PERFORM CREATE-DOCUMENT. PERFORM WEB-SEND. * Exit point EXIT-PGM. exec cics return end-exec. GOBACK. 0000-CNTL-EXIT. EXIT. **************************************************************** WEB-SEND. MOVE SITE-DEF-CHARSET TO W-CHARSET. EXEC CICS WEB SEND DOCTOKEN(W-DTOKEN-2) CHARACTERSET(W-CHARSET) END-EXEC. WEB-SEND-EXIT. EXIT. **************************************************************** CREATE-DOCUMENT. PERFORM CREATE-WEB-DOCUMENT. EXEC CICS DOCUMENT INSERT DOCTOKEN(W-DTOKEN-2) FROM(W-YUI-CONFIG) LENGTH(LENGTH OF W-YUI-CONFIG) END-EXEC. EXEC CICS DOCUMENT INSERT DOCTOKEN(W-DTOKEN-2) FROM(W-YUI-SCRIPT) LENGTH(LENGTH OF W-YUI-SCRIPT) END-EXEC. EXEC CICS DOCUMENT INSERT DOCTOKEN(W-DTOKEN-2) FROM(W-PAGE-BODY) LENGTH(LENGTH OF W-PAGE-BODY) END-EXEC. CREATE-DOCUMENT-EXIT. EXIT. **************************************************************** CREATE-WEB-DOCUMENT. DISPLAY 'YUI0003H: In CREATE-WEB-DOCUMENT'. EXEC CICS DOCUMENT CREATE DOCTOKEN(W-DTOKEN-2) END-EXEC. EXEC CICS DOCUMENT INSERT DOCTOKEN(W-DTOKEN-2) FROM(W-PAGE-START) LENGTH(LENGTH OF W-PAGE-START) END-EXEC. CREATE-WEB-DOCUMENT-EXIT. **************************************************************** *End of YUI0003H