Friday, August 11, 2006

Quick log-off from CICS

A colleague recently made the following request, having just converted from ACF/2 to RACF. ACF/2 allowed a quick log-off and disconnect from CICS by typing the transaction LOGO (as in LOGOFF). While the same function can be performed by typing the transaction CESF LOGOFF, users still wanted to be able to use the shortened command. As an exercise in using some of the new features introduced in CICS Version 4.1, as well as an exercise in using the SPI, the following programs were quickly developed. The programs are associated with the transaction LOGO, but could just as well be associated with a PF key to speed log-off. The first example uses the RETURN IMMEDIATE feature to process the request, and demonstrates how a message may be passed to the program so that the program receiving control treats the input message as if it were typed at the terminal.
PRINT NOGEN DFHEISTG DSECT MSG DS CL11 , AREA TO HOLD MESSAGE LEN DS H , LENGTH OF MESSAGE LOGO CSECT LOGO AMODE 31 LOGO RMODE ANY MVC MSG,=C'CESF LOGOFF' MOVE LOGOFF TEXT TO MSG MVC LEN,=AL2(L'MSG) SET LENGTH OF MESSAGE EXEC CICS RETURN TRANSID(=C'CESF') X IMMEDIATE INPUTMSG(MSG) INPUTMSGLEN(LEN) END LOGO The second program uses the SIGNOFF command and the SPI command INQUIRE TERMINAL, together with the CICS API command ISSUE DISCONNECT, to obtain the same results. Note: because this program was written as an exercise rather than as a production application, error handling is less than complete. PRINT NOGEN DFHEISTG DSECT DISC DS F MSG DS CL18 LOGO CSECT LOGO AMODE 31 LOGO RMODE ANY EXEC CICS INQUIRE TERMINAL(EIBTRMID) DISCREQST(DISC) CLC DFHVALUE(NODISCREQ),DISC BE SEND EXEC CICS SIGNOFF NOHANDLE EXEC CICS ISSUE DISCONNECT B RETURN SEND DS 0H MVC MSG,=C'LOGOFF NOT ALLOWED' EXEC CICS SEND FROM(MSG) LENGTH(=H'18') RETURN DS 0H EXEC CICS RETURN END LOGO
Donald H Blake Systems Programmer Key Services (USA) This article was reprinted with permission.©2006

0 Comments:

Post a Comment

<< Home