CL Command Reference - RCVNETF
CL Command List > RCVNETF Reference
Description:
The Receive Network File (RCVNETF) command receives a network file and copies the records into a physical database file or a save file. Once the file has been received, it is removed from the queue of network files.
If the original file is a save file, it must be received into a save file. Before a file can be received, the file specified by the TOFILE parameter must already exist.
When a source physical file is sent, the source sequence number and change date in positions 1 through 12 of the record are sent with the file. These are kept if the file is received into a source physical file, and are truncated if the file is received into a nonsource physical file. When a file that was originally a nonsource physical file is received into a source physical file, the source sequence numbers are created and placed in front of the records.
If the file is a physical file, the record length of the to-file must be at least as large as the record length of the original file. If the record length of the to-file is larger than that of the original file, the records are padded to the end with the default record value for the to-file.
This command does not perform any CCSID translation on the contents of the file. However, the user ID and address of both the recipient and the originator are translated from the multinational character set 697/500 to the current job CCSID.
Restrictions:
1. A user with security officer authority can receive the files sent to any user. Users with other than security officer authority can receive only files sent to them or to their group profile.
2. The user must have read authority to the library containing the to-file, and use and add authority to the to-file. The following additional authority may be required:
. Object management authority, if a member is added to the file.
. Object management authority and delete authority, if a save file or existing physical file member is cleared.
Examples:
Example 1: Receiving a Member
RCVNETF FROMFILE(FILEA) TOFILE(FILEB/FILEA) FROMMBR(PAYROLL)
This command receives member PAYROLL of file FILEA into member PAYROLL of file FILEA in library FILEB. If there is an existing member of that name, the records in the member are replaced. If multiple members of that name are available, the last one to arrive at the destination system is received.
Example 2: Receiving a Network File
RCVNETF FROMFILE(PERSONNEL) NBR(*LAST) USER(USR1)
This command receives a network file named PERSONNEL, which was sent to user USR1, into a file with the same name. Because the FROMMBR parameter is not specified, there must be only one member name available for this file. Because USR1 is specified, only someone with a user profile of USR1, someone with a group profile of USR1, or someone with security officer authority can use this command.
Example 3: Receiving a Source File
RCVNETF FROMFILE(FILEA) TOFILE(FILEB/FILEA)
FROMMBR(PAYROLL) FROMTYPE(*SRC)
This command specifies that the file being received is a source file and the sequence numbers and date fields are not added to the file being received.