How does RC/Migrator avoid overwriting analysis DDL that is still being executed but, may not have been completed yet?
When an Analysis is produced the Analysis Output is either placed onto a selected dataset(member) or written to Managed Output. When using a dataset(member) this always has the potential to be accidentally overwritten by another user performing an analysis.
If the original Analysis Output was still in the process of being executed in DB2 or for some reason had failed to be completed then it should be preserved at least till execution has been completed. The user of the original Analysis DDL would probably want to continue execution at some point hence the need to preserve the original DDL. If the original DDL had in the meantime been overwritten by a new analysis the original analysis DDL would be lost. If the original execution was to be restarted then this ability would be lost too unless the users own operating system could restore it from a backup. Even then the restart information on the restart table has been lost.
When RC/Migrator produces an Analysis Output the user has the option in the users PROFILE, Update Output Specifications to choose to send the output either to a dataset(member) or to Managed Output. When the analysis output is executed by Batch Processor it must store restart information in the batch processor log table PTI.BPLOG_0203 in case the execution must be restarted.
In order to identify a specific execution, Batch Processor stores the restart information using a "Batch Processor ID" or BPID. It generates this BPID from the DATASET(MEMBER) name or in the case of Managed output a combination of the Creator-strategy name-executor-timestamp. Regardless of the destination type a BPID is always created upon generation of analysis output and also when there is an execution. There may be multiple log records for the same BPID. The log records can be viewed via the "EXECUTION DISPLAY" facility found on the RCM main menu. Use the BPID, Strategy name or creator to find the record. For a dataset the BPID will be in a format like this:
Dataset name : CREATOR.RCM.ANALYSIS(TESTING)
BPID : CREATOR.RCM.ANALYSIS-TESTING
An analysis using Managed Output always creates a new uniquely named "time stamped" output where as an analysis written to a DATASET(MEMBER) will normally OVERWRITE the same DATASET(MEMBER) each time thereby overlaying the previous output. This accidental overlay or overwriting of the analysis output is the issue. It's only a problem with output to a DATASET(MEMBER) because only one BPID is ever used for each DATASET(MEMBER) no matter how many times it's executed. If the analysis output in the DATASET(MEMBER) has been executed then the "EXECUTION DISPLAY" facility will show a changed status of that execution. The TYPE "A" log record is a fresh analysis, "S" means its a SYNC point from from an execution. Each execution has a status column. If the execution has not been completed then the analysis output on the DATASET(MEMBER) should not be allowed to be overwritten by another analysis task before the previous one has completed execution.
On the Analysis screen look for the OVERRIDE field:
EXECUTION MODE ===> ( O - Online, B - Batch )
OVERRIDE ===> N
OVERRIDE in analysis tells RCM whether to reuse the analysis output dataset that was used previously. "Y" if you want to overwrite the last analysis and set the log record back to a fresh start. Upon analysis it checks to see if there is a BPID in the restart table which has the same name as the BPID it is trying to analyze. If there is one there already and it's not completed it stops execution from completing the analysis so that previously unfinished SQL is not overwritten. When an analysis override "Y" is specified a new restart record is added to indicate that it's yet to be executed and the previous restart information is lost.
This is the analysis error message returned:
RMA004E BPID IS INCOMPLETE AND OVERRIDE WAS NOT SPECIFIED
MIGRATOR ANALYSIS COMPLETED, RETURN CODE = 16
Note that Analysis Override is NOT the same thing as Restart Override!!
Restart Override is about restarting an execution only.