MOVE_OBJECT

Use the MOVE_OBJECT script function to move an object to a folder. It is irrelevant in which folder the object you want to move is located because it is retrieved automatically. Existing object links are ignored and are not moved.

Syntax

MOVE_OBJECT (Object NameDestination Folder)

Parameters

Parameter Description Format Allowed Values
Object Name Name of the object. Script literal or script variable n.a.
Destination Folder Path of the folder to which you want to move the object. Script literal or script variable n.a.

Important Considerations

Keep the following rules and behaviors in mind when using this script function:

  • A runtime error occurs if you use an :ON_ERROR statement with the ABEND parameter, but the object or the folder does not exist. The object remains in its original folder if the folder does not exist. For more information, see :ON_ERROR.
  • You need write access (W) to the object and the target folder, as a runtime error will occur otherwise. For more information, see Granting Automation Engine Authorizations.
  • This script function writes all open transactions of the script to the AE database. For more information, see Script Processing.

Return Codes

The script function returns the following codes:

  • 0: The object was successfully moved.
  • 20645: This object does not exist.
  • 20657: The target folder does not exist.

Examples

The following example moves the object VIENNA to the sub-folder OBJECTS of the folder TIME_ZONES:

:ON_ERROR ABEND

:SET &RET# = MOVE_OBJECT("VIENNA""TIME_ZONES/OBJECTS")

See also: