The BACKOUT statement restores activity against tables and files accessed by the application to its most recent stable state. If no PDL CHECKPOINT, BACKOUT, TRANSMIT, SQL COMMIT, or ROLLBACK statement was previously executed, all updates in the run are removed.
BACKOUT applies to all CA Datacom/DB, DB2, and all recoverable VSAM files in CICS. (It does not apply to sequential files, panels, non‑CICS VSAM files, panels, working data, or parameter data.)
This statement has the following format:
BACKOUT
Executing a BACKOUT statement executes the following:
In a CICS environment the BACKOUT statement executes a CICS SYNCPOINT ROLLBACK.
In a non‑CICS environment:
Execution of a BACKOUT statement has the same effect on a program as execution of an embedded SQL ROLLBACK and reverse. See the SQL documentation for the particular database for more information.
If a non‑ideal subprogram executes an SQL ROLLBACK (batch) or a CICS SYNCPOINT (online), execute a CA Ideal BACKOUT or SQL ROLLBACK on return to the CA Ideal program.
For SQL Access in all Modes: After the execution of a BACKOUT statement in the logical scope of a FOR EACH or FOR FIRST construct, the set of rows is lost. Therefore, continued iteration of that FOR construct cannot resume. For more information, see the FOR EACH/FIRST Statement (SQL Access) topic in this chapter.
For VSAM: In a CICS environment, only files defined to CICS as recoverable are backed out.
The execution of a FOR EACH or FOR FIRST statement accessing a VSAM file can resume after a BACKOUT statement if the access uses at least one unique key. See the section titled FOR EACH/FIRST Statement (VSAM Files) in this chapter for further information.
PDL statements can continue to reference the columns processed by the last FOR statement after the BACKOUT.
Example
The following example sets a checkpoint after a FOR NEW construct adds records to the database and conditionally backs out the changes at the end of the procedure. Execution of the CHECKPOINT statement applies all modifications up to that point. A subsequent BACKOUT does not affect them. The BACKOUT only affects the FOR NEW insert. If you omit the CHECKPOINT, the BACKOUT rolls back all changes made since the TRANSMIT.
TRANSMIT
FOR EACH x
statements : update of x
ENDFOR
FOR FIRST y
statements : update of y
ENDFOR
FOR NEW z
statements : add new z
ENDFOR
CHECKPOINT :all modifications up to this point are applied
:and not affected by a subsequent BACKOUT
FOR NEW w
statements : add new w
ENDFOR
IF condition
THEN BACKOUT
ELSE CHECKPOINT
ENDIF
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|