Universal Data Mover Subroutines

Universal Data Mover Subroutines

The Universal Data Mover scripting language provides support for subroutines.

Subroutines are portions of the script code that can be called, by name, at any point. This provides a convenient way to reuse common script code.

Usage

There are two parts to a subroutine:

Definition

Names the subroutine and defines the script code that becomes associated with that subroutine name.

Invocation

Carries out the work of lines of script associated with a subroutine.

Defining a Subroutine

Invoking a Subroutine

Sequence of Defining / Invoking a Subroutine

A subroutine must be physically defined before the callsub to the routine is used.

For example, the following subroutine will function correctly:


However, this subroutine will fail:

 

Nesting / Recursion of Subroutines

UDM allows subroutine nesting (one subroutine calls another subroutine) and recursion (a subroutine calls itself).

For example, the following illustrates subroutine nesting:

Example

Output