<commit_before># IBM MQ Managed File Transfer - Many to one file transfer using Ant script

## Introduction
This sample demonstrates how to transfer many files present at source end as one file at destination. This script also demonstrates how to run dependent transfers i.e, the second transfer runs only if the first transfer is successful. 

To achive "Many to one file" transfer, this solution first runs a "File to Message" transfer followed by "Message to File" transfer. In the first step all files at source are transferred as messages to a queue. In the second step messagesfrom that queue are transferred as one file.

## Required Configuration
1) The script requires a queue "MFT.MANY.TO.ONE.Q" to be defined in destination agent's queue manager.
   Use runmqsc to create the queue: 
	define ql(MFT.MANY.TO.ONE.Q)
   
2) Set access authority to queue for the user under which destination agent runs. This sample assumes the destination agent runs under use "samantha"
		setmqaut -m MFTDEMO -n "MFT.MANY.TO.ONE.Q" -t q -p "samantha" -remove
		setmqaut -m MFTDEMO -n "MFT.MANY.TO.ONE.Q" -t q -p "samantha" +browse +get +put

3) Copy the cleanq.bat or cleanq.sh file to a directory on the file system. On Windows copy the cleanq.bat file to say, "C:\MFTCommands" directory. For Unix/Linux platforms, copy the cleanq.sh to a directory say "/usr/mftcmds".

4) Add the following properties to destination agent properties file. 

	On Windows
	  commandPath=C:\\MFTCommands 
	  enableQueueInputOutput=true
	  
	On Unix/Linux
	  commandPath=/usr/mftcmds 
	  enableQueueInputOutput=true
5) Stop and Start the agent for the changes to get applied.

6) Copy the manyfiletoonefile.xml file to any folder on file system, say C:\MFTCommands on Windows

## Run the script to initiate transfer. Here is an example:

	fteAnt -f manyfiletoonefile.xml -DTIMEOUT=120 -DSRCFOLDER="C:\SRCFILES\" -DDESTINATIONFILE=C:\DESTINATION\many2one.txt -DSRC=SRC@MFTDEMO -DDEST=DEST@MFTDEMO -DCMDQM=MFTDEMO<commit_msg>Formatted<commit_after># IBM MQ Managed File Transfer - Many to one file transfer using Ant script

## Introduction
This sample demonstrates how to transfer many files present at source end as one file at destination. This script also demonstrates how to run dependent transfers i.e, the second transfer runs only if the first transfer is successful. 

To achive "Many to one file" transfer, this solution first runs a "File to Message" transfer followed by "Message to File" transfer. In the first step all files at source are transferred as messages to a queue. In the second step messagesfrom that queue are transferred as one file.

## Required Configuration
1) The script requires a queue "MFT.MANY.TO.ONE.Q" to be defined in destination agent's queue manager.
   Use runmqsc to create the queue: 
	define ql(MFT.MANY.TO.ONE.Q)
   
2) Set access authority to queue for the user under which destination agent runs. This sample assumes the destination agent runs under use "samantha"

		setmqaut -m MFTDEMO -n "MFT.MANY.TO.ONE.Q" -t q -p "samantha" -remove
		setmqaut -m MFTDEMO -n "MFT.MANY.TO.ONE.Q" -t q -p "samantha" +browse +get +put

3) Copy the cleanq.bat or cleanq.sh file to a directory on the file system. On Windows copy the cleanq.bat file to say, "C:\MFTCommands" directory. For Unix/Linux platforms, copy the cleanq.sh to a directory say "/usr/mftcmds".

4) Add the following properties to destination agent properties file. 

	On Windows
	
	  commandPath=C:\\MFTCommands 
	  enableQueueInputOutput=true
	  
	On Unix/Linux
	
	  commandPath=/usr/mftcmds 
	  enableQueueInputOutput=true
5) Stop and Start the agent for the changes to get applied.

6) Copy the manyfiletoonefile.xml file to any folder on file system, say C:\MFTCommands on Windows

## Run the script to initiate transfer. Here is an example:

	fteAnt -f manyfiletoonefile.xml -DTIMEOUT=120 -DSRCFOLDER="C:\SRCFILES\" -DDESTINATIONFILE=C:\DESTINATION\many2one.txt -DSRC=SRC@MFTDEMO -DDEST=DEST@MFTDEMO -DCMDQM=MFTDEMO
{'fraction_non_alphanumeric': 0.06912096168294515, 'fraction_numerical': 0.005008765339343852, 'mean_word_length': 4.107416879795396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3492655', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1189, 'n_words': 543}