Author |
Message
|
Yanghui |
Posted: Thu Jan 16, 2003 3:58 am Post subject: Utility to write multiple files as separate msgs on queue |
|
|
Disciple
Joined: 08 May 2002 Posts: 151 Location: Dublin, Ireland
|
Hi,
We have a urgent requriement to write all files (more than 500 ) under one directory as separate msgs on queue. One file, one msg. Is there easy way to do it in one go by feeding directory name and queue name of course?
Any suggestion would be highly appreciated. Thanks in advance.
Regards
-Yanghui |
|
Back to top |
|
 |
zpat |
Posted: Thu Jan 16, 2003 4:33 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Without much programming, you could write a .BAT file and use AMQSPUTC in a loop |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Jan 16, 2003 4:55 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well amqsputc wont work it will make one message for each line in the file
Are the files text or binary ??? if text you could modify the amqsput0.c source to do what you want. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
Yanghui |
Posted: Thu Jan 16, 2003 5:34 am Post subject: |
|
|
Disciple
Joined: 08 May 2002 Posts: 151 Location: Dublin, Ireland
|
Thanks for your response.
We have to treat all file as binary and keep intact. I hate to do it manually.
Any more ideas? Thanks.
-Yanghui |
|
Back to top |
|
 |
fschofer |
Posted: Thu Jan 16, 2003 7:06 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
You can use the programm mqputs of the support pack ih03:
MQSeries Integrator V2 - Message display, test and performance utilities
http://www-3.ibm.com/software/ts/mqseries/txppacs/ih03.html
There you can add the names of your files after the parameter
[filelist] in the config file. Don't know if there is a limit how much
files you can add, never used more then 20.
Important: You have to set the parameter 'msgcount' to the exact number
of messages which you added to the filelist
To get the names of your files do a
dir /b > list.txt in a DOS window or
ls > list.txt from a UNIX shell |
|
Back to top |
|
 |
nimconsult |
Posted: Fri Jan 17, 2003 12:22 am Post subject: |
|
|
 Master
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
|
There is a sample of "PutFileClient" and "PutFileServer" in the JASMQ package (free), that you can retrieve in the software repository
http://www.mqseries.net/pafiledb203/pafiledb.php?action=viewfile&fid=57
The sample puts one file in one MQ message. The server retrieves the message and recreates the file.
You can either write a simple shell script calling the sample for each file in the directory, or extend the sample to process all the files of a directory.
Nicolas _________________ Nicolas Maréchal
Senior Architect - Partner
NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be |
|
Back to top |
|
 |
zpat |
Posted: Mon Jan 27, 2003 1:47 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You could append the output of AMQSPUTC using the >> filename format.
command >> filename
Means append output to the end of the file. |
|
Back to top |
|
 |
leongor |
Posted: Mon Jan 27, 2003 8:42 am Post subject: |
|
|
 Master
Joined: 13 May 2002 Posts: 264 Location: Israel
|
|
Back to top |
|
 |
|