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.

Important!

  • 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.

Syntax

MOVE_OBJECT (Object Name, Destination Folder)

Parameters

  • MOVE_OBJECT
    Moves an object to a folder
  • Object Name
    Name of the object
    Format: script literal or script variable
  • Destination Folder
    Path of the folder to which you want to move the object
    Format: script literal or script variable

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

Example

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: