Copy Stream File (QHFCPYSF) API


  Required Parameter Group:

1 Source file path name Input Char(*)
2 Source file path name length Input Binary(4)
3 Copy information Input Char(6)
4 Target file path name Input Char(*)
5 Target file path name length Input Binary(4)
6 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Copy Stream File (QHFCPYSF) API copies an existing stream file into another stream file and optionally renames the copy. The existing file being copied is called the source file. The copy, or the file that the source is copied into, is called the target file.

All file attributes except the revision date and time are copied from the source file to the target file. The file revision date and time are set to the current date and time. The file creation date and time stay as they are--that is, the source file's creation date and time.

For restrictions about using the QHFCPYSF API with distributed data management (DDM), see the information on hierarchical file system support in the Distributed Data Management book.


Authorities and Locks

None.


Required Parameter Group

Source file path name
INPUT; CHAR(*)

The path name of the source file (the file being copied). The last element of the path name is the source file name.

The source file must be accessible. No other job can have the source file open with a deny read or deny read/write lock.

Source file path name length
INPUT; BINARY(4)

The length of the source file path name, in bytes.

Copy information
INPUT; CHAR(6)

The type of copy operation being performed. The 6 characters of this parameter are:

1 The action to take if the target file already exists. Valid values are:
0 Do not replace the existing file.
1 Replace the existing file with the copy.
2 Add the copy to the end of the existing file.
2-6 Reserved. These characters must be blank.

Target file path name
INPUT; CHAR(*)

The path name of the target file (the copy or the file that the source is copied into). The last element of the path name is the target file name.

If the target file has a different name from the source file, it can be in the same path as the source.

The target file must be accessible in write mode. It cannot be a read-only file, and another job cannot have it open with a deny write or deny read/write lock.

Target file path name length
INPUT; BINARY(4)

The length of the target file path name, in bytes.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error Code Parameter.


Error Messages

Message ID Error Message Text
CPF1F01 E Directory name not valid.
CPF1F02 E Directory not found.
CPF1F06 E Directory in use.
CPF1F07 E Authority not sufficient to access directory.
CPF1F08 E Damaged directory.
CPF1F2A E Number of open files exceeds limit.
CPF1F2E E Range of bytes in file in use.
CPF1F21 E File name not valid.
CPF1F22 E File not found.
CPF1F23 E New file name same as old file name.
CPF1F24 E File name already exists.
CPF1F26 E File in use.
CPF1F27 E Authority not sufficient to access file.
CPF1F28 E Damaged file.
CPF1F29 E Use of reserved file name not allowed.
CPF1F34 E Attempted write operation beyond file size limit.
CPF1F35 E Read file operation failed.
CPF1F36 E Write file operation failed.
CPF1F37 E File is a read-only file.
CPF1F41 E Severe error occurred while addressing parameter list.
CPF1F42 E Attribute information table not valid.
CPF1F43 E Attribute name not valid.
CPF1F44 E Attribute value is not valid.
CPF1F46 E Use of reserved attribute name not allowed.
CPF1F48 E Path name not valid.
CPF1F51 E Copy information value not valid.
CPF1F52 E Error code not valid.
CPF1F61 E No free space available on media.
CPF1F62 E Requested function failed.
CPF1F63 E Media is write protected.
CPF1F66 E Storage needed exceeds maximum limit for user profile &1.
CPF1F71 E Exception specific to file system occurred.
CPF1F72 E Internal file system error occurred.
CPF1F73 E Not authorized to use command.
CPF1F74 E Not authorized to object.
CPF1F75 E Error occurred during start-job-session function.
CPF1F81 E API specific error occurred.
CPF1F82 E Function not supported.
CPF1F83 E File system name &1 not found.
CPF1F84 E Operation across file systems not allowed.
CPF1F85 E Not authorized to file system &1.
CPF1F87 E Missing or damaged exit program &2.
CPF1F97 E File system &1 in use.
CPF3C90 E Literal value cannot be changed.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V2R1
Top | Hierarchical File System APIs | APIs by category