The program shown next illustrates one way to call Finalist CICS from another application. In this case, one program passes control to Finalist CICS and instructs Finalist CICS to pass control back to the same program calling it. You can also set up Finalist CICS to pass control to any other program. When finished, the Finalist CICS system passes control to any program per your instructions.
EXAMPLEX TITLE '- CICS WINDOWING APPLICATION DRIVER'
DFHEIGBL ,
COMMDSCT DSECT
COMMDATA DS 0D
* COPY MAPDS (MAPSET DSECT)
* :
* (MISCELLANEOUS DATA)
* :
DS 2048C
COPY LPWN030D (PASS CONTROL BLOCK)
COPY LPWN020D (EXIT COMMAREA IMAGE)
PASSLEN EQU *-PASSCNTL
COMMLEN EQU *-COMMDATA
EJECT
DFHEISTG DSECT
DFHEISTG
* :
* (WORK FIELDS USED ONLY WITHIN 1 PASS THRU THIS PROGRAM)
* :
ABCODE DS CL4 HOLD ABEND CODE FOR ABEND COMMAND
DS 0D
DFHEIEND
EJECT
REGEQU
EJECT
EXAMPLEX DFHEIENT CODEREG=(3),DATAREG=(13),EIBREG=(11)
USING COMMDSCT,R5
* :
* (USER APPLICATION LOGIC)
* :
CLC EIBCALEN,=H'0' IF NO COMMON AREA PRESENT,
BNE NOTFIRST GET SPACE TO PUT IT IN.
MVC ABCODE,USR1 SET ABEND CODE JUST IN CASE
EXEC CICS HANDLE CONDITION NOSTG(ABENDIT)
EXEC CICS GETMAIN SET(R5) FLENGTH(=A(COMMLEN)) INITIMG(X'00')
MVI PASSWCRI,C'N' RESET WINDOWS RETURN SWITCH
B NOTRETN
NOTFIRST DS 0H
L R5,DFHEICAP A(COMMAREA)
CLI PASSWCRI,C'Y' IF RETURNING FROM WINDOWS
BE PROCRETN PROCESS RETURNED DATA
NOTRETN DS 0H
* :
* (USER APPLICATION LOGIC)
* :
* (FILL IN ADDRESS DATA TO PASS TO WINDOWS)
* :
* (FILL IN EXIT CONTROL BLOCK TO PASS TO WINDOWS)
* :
MVC PASSPGM,=C'EXAMPLEX' RETURN TO EXAMPLEX PROGRAM AFTER WINDOWS
MVC PASSTRAN,=C'LPCF' WINDOWS TRAN CODE IS LPCF
MVI PASSEX1L,C'L' LOCK INPUT EXIT
MVI PASSEX2L,C'L' LOCK OUTPUT EXIT
MVI PASSEXCP,C'N' NO EXCEPTION TABLE
MVC PASSTALR,=CL13' ' BLANK TAILORING GETS DEFAULTS
SPACE
EXEC CICS XCTL PROGRAM(=C'LPWN511C') COMMAREA(COMMDSCT) X
LENGTH(=Y(COMMLEN))
EJECT
PROCRETN DS 0H PROCESS RETURN FROM WINDOWS
* :
* (PROCESS DATA RETURNED FROM WINDOWS)
* :
MVI PASSWCRI,C'N' RESET WINDOWS RETURN SWITCH
* :
* (PROCEED WITH USER APPLICATION LOGIC)
* :
* USUAL RETURN FOR A PSEUDO-CONVERSATIONAL PROGRAM
* EXEC CICS RETURN TRANSID(EIBTRNID) COMMAREA(COMMDSCT) X
* LENGTH(=Y(COMMLEN))
EXEC CICS SEND FROM(UNLOCK) LENGTH(1) ERASE WAIT
EXEC CICS RETURN
* :
* (THE REST OF THE PROGRAM)
* :
DFHEIRET
ABENDIT DS 0H ABEND DELIBERATELY
EXEC CICS ABEND ABCODE(ABCODE)
USR1 DC CL4'USR1' ABEND CODE LITERAL
UNLOCK DC C' '
END