Returning the Work Unit ID

The DMSRETWU routine (Return Work Unit ID) returns a work unit ID to CMS that was previously obtained with the DMSGETWU routine. Returning the work unit ID informs CMS that your application has completed all work on the specified work unit and that the system can commit all outstanding work and free its storage associated with that work unit. You should explicitly commit all work before returning the work unit. DMSRETWU does not check or modify the work unit stack. Therefore, you should use the DMSPOPWU (Pop Default Work Unit ID) routine to remove the work units from the stack before returning them.

You need to return only those work unit IDs obtained by DMSGETWU. DMSRETWU closes all SFS files and directories that are open under the work unit and commits any outstanding work on the work unit. For more information on committing work, see Committing and Rolling Back Changes in Application Programs.

The workunitid parameter is a 4-byte numeric field for specifying the work unit ID.

Example: To return the work unit ID previously obtained using DMSGETWU, code:
CALL DMSCSL (DMSRETWU, RETCODE, REASCODE, WORKUNITID)