See the details of What is the basic difference between a Independant RUN-UNIT and an Extended RUN-UNIT?
A RU (RUN-UNIT) is kept OPEN when a dialog passes control to another dialog, user program or application function by using INVOKE, LINK, TRANSFER or EXECUTE NEXT FUNCTION.
A RU is extended when control passes to
- a user program (LINK)
- a dialog with premap process & no associated subschema
- a dialog with premap process & whose schema and subschema are same as those of issuing dialog & whose usage-modes are equally or less-restrictive than those of linking dialog
- Any lower level dialog, provided that the USING SUBSCHEMA-CONTROL clause of LINK command is used (LINK)
Currencies and record buffers established at higher levels in the application thread are cumulative and automatically passed to lower level dialogs.
Currencies and record buffers established at lower levels are released when the dialog becomes non-OPERATIVE.
Currencies established at lower levels are available to higher levels if
the run-unit is extended and a NOSAVE option is specified in INVOKE/LINK command .
If a USER PROGRAM issues Subschema BIND followed by any DML statement the program can deadlock at run-time. To avoid this, COMMIT should be coded before linking to a user program that issues a BIND/FINISH command
ADS/O suggests that the most efficient way to write user programs is remove BIND/FINISH from user programs and allow Extended RU to handle it. The run-unit is forced to extend by coding USING SUBSCHEMA-CONTROL in the LINK command.