MainframeSupports
tip week 37/2006:

Maybe you have experienced that you were unable to perform a newcopy of a program in CICS. This problem frequently occurs after an abend in that particular program. How you solved the problem I do not know for obvious reasons, but this tip will describe an easy solution.

In 99% of all cases where a newcopy fails the problen is that the residency count is greater than zero. The actual residency count for a program you can find using a CEMT I PROG('MYBADPGM'). One of the listed informations is RES(999) where 999 is the residency count. This must be 000 in order to perform a newcopy. RES is incremented with one when a program is being executed by a task. When a task has finished executing a program RES is decremented by one. Sometimes RES is not decremented by CICS when a program abends.

If you are authorised to execute the CECI transaction you are able to decrement RES. Just issue a CECI RELEASE PROGRAM('MYBADPGM'). At first CECI announces that you are ABOUT TO EXECUTE COMMAND. Hit Enter to make CECI tell you that COMMAND EXECUTION COMPLETE. On the bottom of the screen there is a field called RESPONSE, and it says NORMAL if RES was greater than 0 before you executed the command. If RES was 0 when you executed the command, it says INVREQ (meaning invalid request) instead of NORMAL. You cannot perform a RELEASE of a program having RES(0). It may also return INVREQ when RES > 0 if the program is in use by a running task.

If you are not authorised to execute the CECI transaction on the CICS where you are having the problem you have to get help from your technical personnel, typical a systems programmer or someone in operations. You may also write a small CICS program doing an EXECUTE CICS RELEASE PROGRAM(pgmName) so you are able to perform a RELEASE whenever it suits you. By the way it is possible to list all programs having a certain residency count by issuing a CEMT I RES(X), where X is the residency count you are interested in.

You have to know that RES is also incremented when a program is loaded into storage using EXEC CICS LOAD PROGRAM. When the task performing the LOAD terminates the residency count for the loaded program is decremented by one, but if the program was loaded with HOLD option then the residency count is unchanged. You are also able to define programs as resident. Their residency count is only decremented when the residency count is greater than one. You must be careful not to RELEASE those kind of programs because they are supposed to have a residency count greater than 0.

Previous tip in english        Sidste danske tip        Tip list