Previous Topic: FIND/OBTAIN WITHIN SET/AREANext Topic: FREE STORAGE (DC/UCF)


FINISH

The FINISH statement commits changes made to the database through an individual run unit or through all database sessions associated with a task. A task-level finish also commits all changes made in conjunction with scratch, queue, and print activity.

If the finish applies to an individual run unit and the run unit is sharing its transaction with another database session, the run unit's changes may not be committed at the time the FINISH statement is executed. For more information on the impact of transaction sharing, refer to CA IDMS Navigational DML Programming Guide.

Run units (and SQL sessions) impacted by the FINISH statement end, and their access to the database is terminated.

The FINISH statement is used in both the navigational and logical record facility environments. The FINISH TASK statement is also used in an SQL programming environment.

Currency

Following the successful execution of a FINISH request, all currencies are set to null; the issuing program or task cannot perform database access through an impacted run unit without executing another BIND/READY sequence.

Syntax
►►─── FINISH ─┬────────┬─ ; ──────────────────────────────────────────────────►◄
              └─ TASK ─┘
Parameters
TASK

Commits the changes made by all scratch, queue, and print activity and all top-level run units associated with the current task and terminates those run units. Its impact on SQL sessions associated with the task depends on whether those sessions are suspended and whether their transactions are eligible to be shared.

Note:

Example

The following statement commits changes made by the run unit through which it is issued and terminates that run unit:

FINISH;
Status Codes

Upon completion of the FINISH function, the ERROR_STATUS field in the IDMS DB communications block indicates the outcome of the operation:

0000

The request has been serviced successfully.

5031

The specified request is invalid; the program may contain a logic error.

5097

An error was encountered processing a syncpoint request; check the log for details.