MOVE_FILE

This Activity will move file(s) from one directory to another.

You can specify the full path and name of a particular file to be moved or you can specify a pattern in the file and extension portion to move one or more files that match the pattern.

On IBM i servers, this activity operates on the integrated file system–you may be able to move objects in the QSYS file system, but you must use IFS file system notation to do so.

After the move the file will not exist in the original directory and/or with the original name.

When executed on an IBM i platform, this activity is capable of performing data conversion between different CCSIDs during the move operation.  For example, to convert the data in a text file from its original encoding to UTF-8 you could use the parameter values TOCCSID(1208) DTAFMT(*TEXT).

INPUT Parameters:

FROMFULLNAME: Required

This parameter specifies the path and name of the file(s) to be moved.  You can specify the full path and name of a particular file to be moved or you can specify a pattern in the file and extension portion to move one or more files that match the pattern.

Windows server examples:
c:\mydir\my*.*
c:\mydir\myfile.txt

IBM i server examples:
/mydir/my*.*
/mydir/myfile.txt

TODIRECTORY: Optional (*)

This parameter may contain the full directory path of the destination directory.  If specified, the file will be moved to this new location using the same name and extension as the original file.  If not specified, you must provide a value for the TOFULLNAME parameter.

TOFULLNAME: Optional (*)

This parameter specifies the path of the directory the object is to be moved to AND the new name of the object.  If specified, the file will be moved to this new location using the new file name and extension specified.  If not specified, you must provide a value for the TODIRECTORY parameter.

NOTE:  if you specified a pattern in the FROMFULLNAME parameter to move one or more files matching the pattern, you should NOT use this parameter.  You should specify a value for the TODIRECTORY parameter instead.

REPLACE: Optional

This parameter specifies whether the target file(s) is replaced if it already exists.  You may specify one of the following values:

*NO – the target file(s) is not replaced.  If the target file already exists, the MOVE_FILE activity will end in error.

*YES – If the target file(s) already exists, it is replaced.

WARNING: You should NOT specify *YES for the REPLACE parameter if you specify a pattern in the FROMFULLNAME parameter to move one or more files matching the specified pattern.  The MOVE_FILE activity does not support this usage and unexpected results might occur.

FROMCCSID: Optional, IBM i servers only

This parameter specifies the method for obtaining the coded character set identifier (CCSID) for the source of the move operation. This CCSID will be used for data conversion, if requested.

This parameter corresponds directly to the FROMCCSID parameter of the IBM i MOV command and you may use any values that are defined for the MOV command.  At IBM i V7R1 the possible values include *OBJ, *PCASCII, *JOBCCSID or a CCSID value in the range 1-65533.  Refer to the IBM documentation for the MOV command for more information.

The special (default) value *DEFAULT specifies that the FROMCCSID parameter will not be specified.  Note that this parameter applies only when LANSA Composer is running on an IBM i server.

TOCCSID: Optional, IBM i servers only

This parameter specifies the data coded character set identifier (CCSID) for the target of the move operation.

This parameter corresponds directly to the TOCCSID parameter of the IBM i MOV command and you may use any values that are defined for the MOV command.  At IBM i V7R1 the possible values include *OBJ, *CALC, *PCASCII, *STDASCII, *JOBCCSID or a CCSID value in the range 1-65533.  Refer to the IBM documentation for the MOV command for more information.

The special (default) value *DEFAULT specifies that the TOCCSID parameter will not be specified.  Note that this parameter applies only when LANSA Composer is running on an IBM i server.

DTAFMT: Optional, IBM i servers only

This parameter specifies the format of the data in the file to be moved..

This parameter corresponds directly to the DTAFMT parameter of the IBM i MOV command and you may use any values that are defined for the MOV command.  At IBM i V7R1 the possible values are *TEXT and *BINARY.  Refer to the IBM documentation for the MOV command for more information.

The special (default) value *DEFAULT specifies that the DTAFMT parameter will not be specified.  Note that this parameter applies only when LANSA Composer is running on an IBM i server.

OUTPUT Parameters:

FULLNAMEOUT

Upon successful completion, this parameter will contain the full path and file name of the resulting destination file.

NOTE:  if you specified a pattern in the FROMFULLNAME parameter to move one or more files matching the pattern, then this output parameter will contain the pattern you specified qualified with the path to the target directory.  This is usually not useful, and in particular you should note that it should NOT be assumed that the resulting string provides a pattern match for the exact set of files that were moved by the MOVE_FILE activity.