In a pseudo-conversational 3270 CICS transaction, your code normally begins by checking to see if this is "first time in" by checking to see if EIBCALEN = 0
or if EIBRESP = DFHRESP( CHANNELERR )
after an EXEC CICS GET CONTAINER
if you're using containers instead of a commarea.
If this is "first time in" your code normally does some housekeeping and then an EXEC CICS SEND MAP
to put your BMS map up on the 3270 device. Then your code does an EXEC CICS RETURN TRANSID(EIBTRNID)
and references either your commarea or your channel.
If this is not "first time in" your code normally examines either the commarea or one or more containers in its channel and EIBAID to determine what to do next, often this is an EXEC CICS RECEIVE MAP
to retrieve the field contents of the fields in the map. Your code then performs whatever business function it needs to, possibly modifying fields in the map and doing an EXEC CICS SEND MAP DATAONLY
, makes appropriate modifications to either the commarea fields or fields in your container(s) and an EXEC CICS PUT CONTAINER
and again does an EXEC CICS RETURN TRANSID(EIBTRNID)
and references either your commarea or your channel.
If, as in your case, examining these fields indicates the user wishes to exit the transaction, your code might do an EXEC CICS SEND TEXT ERASE FREEKB
where the FROM and LENGTH refer to fields containing an appropriate message indicating end of transaction. This will erase your map from the screen. Then your code would do an EXEC CICS RETURN
without the TRANSID option, ending your pseudo conversation.
Note that each EXEC CICS RETURN
does an implied EXEC CICS SYNCPOINT
committing resources such as DB2 updates and MQ messages.