by Robert Sample » Sat Apr 06, 2013 4:54 pm
You develop and test everything in the transaction running attached to a terminal. When you have everything working as it should, then you change the transaction to run as a background task and interval started. You then talk to your site support group about getting the transaction added to the CICS region PLT. PLT transactions get started during the CICS start up processing, so an interval started transaction running from the PLT will be executed automatically when the region comes up. However, you will need to develop a way to automatically check that your transaction does not abend; one way I've seen in the past is to have your transaction write a timestamp into a VSAM file and have a second (PLT-started) transaction start up and verify that the last timestamp in the VSAM file is within the acceptable time. This transaction also writes its timestamp into the VSAM file, and your transaction checks that timestamp. If either transaction determines that the timestamp is not within the acceptable time limit, it issues an EXEC CICS START TRANSACTION INTERVAL command to restart the other transaction. While not foolproof (if max tasks is reached, for example), this provides most of the needed recoverability for the transaction.