I write a program like following to link to another program.
PROCEDURE DIVISION.
PERFORM P2000-SEND-INIT-MAPS.
EVALUATE TRUE
WHEN EIBAID = DFHPF5
PERFORM P1000-DO-PROG-ACCTOP
WHEN EIBAID = DFHPF6
MOVE 'PRG FOR CREDIT IS NOT READY' TO M1ERORMESGO
PERFORM G1000-SEND-MSGS-MAPS
END-EVALUATE.
EXIT.
GOBACK.
*************************************************************************
P1000-DO-PROG-ACCTOP SECTION.
EXEC CICS LINK PROGRAM ('ACCTOPEN')
COMMAREA (ACCTOPEN-COMMAREA)
LENGTH (ACCTOPEN-COMMAREA-LENGTH)
END-EXEC.
EXIT.
PERFORM P2000-SEND-INIT-MAPS.
EVALUATE TRUE
WHEN EIBAID = DFHPF5
PERFORM P1000-DO-PROG-ACCTOP
WHEN EIBAID = DFHPF6
MOVE 'PRG FOR CREDIT IS NOT READY' TO M1ERORMESGO
PERFORM G1000-SEND-MSGS-MAPS
END-EVALUATE.
EXIT.
GOBACK.
*************************************************************************
P1000-DO-PROG-ACCTOP SECTION.
EXEC CICS LINK PROGRAM ('ACCTOPEN')
COMMAREA (ACCTOPEN-COMMAREA)
LENGTH (ACCTOPEN-COMMAREA-LENGTH)
END-EXEC.
EXIT.
So when I press PF5 I will link to a program called ACCTOPEN by EXEC CICS LINK PROGRAM ('ACCTOPEN') command.
Now in the ACCTOPEN i have following code:
PROCEDURE DIVISION.
IF EIBAID = DFHPF2 THEN
PERFORM P2000-SEND-EMPT-MAPS.
IF EIBAID = DFHPF3 THEN
PERFORM X0000-EXIT-TO-LASTPG.
EXIT.
GOBACK.
*************************************************************************
X0000-EXIT-TO-LASTPG SECTION.
EXEC CICS RETURN TRANSID('AC00')
END-EXEC.
EXIT.
IF EIBAID = DFHPF2 THEN
PERFORM P2000-SEND-EMPT-MAPS.
IF EIBAID = DFHPF3 THEN
PERFORM X0000-EXIT-TO-LASTPG.
EXIT.
GOBACK.
*************************************************************************
X0000-EXIT-TO-LASTPG SECTION.
EXEC CICS RETURN TRANSID('AC00')
END-EXEC.
EXIT.
(AC00 is the major program transaction)
When I want to return to major program I must press PF3 two times or press PF3 and then another key. THIS IS MY PROBLEM!!! How I can return to last program by pressing PF3 only once. OR when I press PF3 then PF2 I want to do "PERFORM P2000-SEND-EMPT-MAPS" but I returned to last program (or map linked to it).