Home
mqftrcv (receive file on server)
Purpose
The mqftrcv command is available with the File Transfer Application on WebSphere MQ for Windows, and WebSphere MQ for Linux (x86 platform) servers only.
Use the mqftrcv command to do one of the following:
- Receive a file.
- Extract a file.
- Delete a file.
- View sent files.
Syntax
>>-mqftrcv-- -q --QueueName--+----------------+-----------------> '- -m --QMgrName-' >--+----------------+--+-------------+--+----------------+------> '- -c --CorrelId-' '- -u --MsgId-' '- -s --UserData-' .- -a -----------. >--+------+--+----------------+--+----------------+-------------> '- -v -' +- -l -----------+ '- -r --FileName-' +- -i -----------+ +- -o -----------+ +- -d -----------+ +- -g --+------+-+ | '- -y -' | '- -e --+------+-' '- -y -' >--+----------------+------------------------------------------>< '- -f --FileName-'
Required parameters
- -q QueueName
- The local name of the destination queue.
Optional parameters
- -m QMgrName
- The name of the queue manager that hosts the destination queue. A queue manager that does not have the File Transfer Application installed can be specified. If you omit this parameter, the default queue manager is used.
- -c CorrelId
- Select all files matching CorrelId. Selection can be combined with -s UserData, and -f FileName.
- -u MsgID
- Select the message that has a message ID that matches MsgID. Used to select other messages.
- -s UserData
- Select files by locating any occurrence of the character string UserData, in part or all of the file's UserData. The comparison is case sensitive, and wildcard characters cannot be used.
Selection can be combined with -c CorrelId, and -f FileName.
- -v
- Return the CorrelId, and MsgId of the file.
- -a
- List all files and messages, in the following order:
- Complete files, ordered by queue name
- Incomplete files, ordered by queue name
- Other messages, ordered by queue name
This is the default value. For more information on file status see File status.
- -l
- List all complete files, ordered by queue name.
- -i
- List all incomplete files, ordered by queue name.
- -o
- List all other messages, ordered by queue name.
- -d
- Delete the specified file, or the group of messages. If more than one file matches the selection criteria, no files are deleted and a return code is returned.
- -g
- Receive a complete file. Message associated with the file are removed. If a file already exists of the same name, do one of the following:
- Specify the -y parameter, so that the existing file is overwritten.
- Specify the -r FileName parameter, so that the file is renamed.
- -e
- Extract a complete, or incomplete file. Messages associated with the file are not removed. If a file already exists of the same name, do one of the following:
- Specify the -y parameter, so that the existing file is overwritten.
- Specify the -r FileName parameter, so that the file is renamed.
- -y
- Replace an existing file of the same name. Used with optional parameters -g, and -e.
- -r FileName
- Assign new file name and/or file location.
Used to rename, or to relocate a file. The file is assigned the name specified in FileName. A fully qualified file name can be specified to relocate the file. If the file name, or path, contains embedded spaces, it must be specified in double quotes. One file can be specified only, and we cannot use wildcard characters.
- -f FileName
- Select all files matching FileName. The fully qualified file name can be specified. If the file name contains embedded spaces, it must be specified in double quotes. We cannot use wildcard characters.
Selection can be combined with -c CorrelId, and -s UserData.
Return codes
0 Successful operation 36 Invalid arguments supplied 40 Queue manager not available 69 Storage not available 71 Unexpected error 163 Queue name required 164 Cannot open queue 165 Cannot open file 166 Cannot put to queue 167 No file name specified (Send) 168 Message length is too small to send data 169 Sending file has changed 170 Cannot get from queue 171 Cannot write to file 172 CorrelId is invalid 173 MsgId is invalid 174 No messages to receive 175 File for delete is not unique
Examples
This command lists all files and messages on the queue, MY.QUEUE, located on the default queue manager:
mqftrcv -q MY.QUEUE -aThis command gets the first complete file on the queue, MY.QUEUE, located on queue manager QM1:
mqftrcv -q MY.QUEUE -m QM1 -gThis command gets the complete file, named My document.txt, on the queue, MY.QUEUE, located on the default queue manager:
mqftrcv -q MY.QUEUE -g -f "My document.txt"This command gets the complete file, named My document.txt, also marked URGENT, on the queue, MY.QUEUE, located on queue manager QM1 :
mqftrcv -q MY.QUEUE -m QM1 -g -f "My document.txt" -s "URGENT"
Related commands
mqftapp Run File Transfer Application mqftrcvc Receive file on client mqftsnd Send file from server mqftsndc Send file from client
Parent topic:
The control commands
fa15830_
Home