| Author | 
		  Message
		 | 
		
		  | sboucher | 
		  
		    
			  
				 Posted: Tue Jan 14, 2003 12:15 pm    Post subject: IH03 - Putting Messages from a Q to file and vice versa | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 27 Oct 2002 Posts: 52
  
  | 
		  
		    
			  
				Can't seem to tweak the parameters correctly to read a file and populate a Q with the contents of the file. Whether the file has 1 or 100 messages in it, I want the entire contents of the file to be written to the Q. Any ideas?!!  
 
 
Can get the Q to File(MQCAPTURE) portion to work with no problem.
 
 
Thanks _________________ Scott A. Boucher
 
Database Administartor | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mrlinux | 
		  
		    
			  
				 Posted: Tue Jan 14, 2003 12:46 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA 
  | 
		  
		    
			  
				Is this a text file or a binary file ?????
 
 
If it is just a text file the sample program  amqsput QUEUE_NAME QMGR_NAME  < FILE_NAME  will work otherwise you could take the 
 
source file and tweak that to ignore the LINE_FEEDS.  
 
Source FileName amqsput0.c 
 
 
This assumes you installed the sample programs
 
 
MQM_ROOT\tools\c\Samples      (NT)
 
MQM_ROOT/samp                  (UNIX  HPUX/LINUX/SUN) _________________ Jeff 
 
 
IBM Certified Developer MQSeries
 
IBM Certified Specialist MQSeries
 
IBM Certified Solutions Expert MQSeries | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mrlinux | 
		  
		    
			  
				 Posted: Tue Jan 14, 2003 12:49 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | TonyD | 
		  
		    
			  
				 Posted: Tue Jan 14, 2003 1:16 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Knight
 
 Joined: 15 May 2001 Posts: 540 Location: New Zealand 
  | 
		  
		    
			  
				| Are you referring to the RFHUTIL component of this supportpac...if so, I believe it is designed to write the contents of a designated file as a single message... and vice versa. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sboucher | 
		  
		    
			  
				 Posted: Tue Jan 14, 2003 4:36 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 27 Oct 2002 Posts: 52
  
  | 
		  
		    
			  
				The file I'm using is a text file.  I want to write the contents of this file as a single message to a Q.
 
 
Wouldn't the amqsput write individual messages to the Q?
 
 
Isn't the RFHUTIL  GUI based.  I need to do this from the command line via a triggered process.
 
 
Thanks _________________ Scott A. Boucher
 
Database Administartor | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mrlinux | 
		  
		    
			  
				 Posted: Tue Jan 14, 2003 6:30 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA 
  | 
		  
		    
			  
				You could modify the source of amqsput0.c to do what you want. _________________ Jeff 
 
 
IBM Certified Developer MQSeries
 
IBM Certified Specialist MQSeries
 
IBM Certified Solutions Expert MQSeries | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | RogerLacroix | 
		  
		    
			  
				 Posted: Tue Jan 14, 2003 9:32 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 15 May 2001 Posts: 3265 Location: London, ON  Canada 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sboucher | 
		  
		    
			  
				 Posted: Wed Jan 15, 2003 3:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 27 Oct 2002 Posts: 52
  
  | 
		  
		    
			  
				What differentiates whether a file is written as a single message or individual messages.  I'm just trying to get this all straight in my head so if I have to modify source code I'll have an idea what to look for.
 
 
Thanks for everyones contribution to my questions _________________ Scott A. Boucher
 
Database Administartor | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mrlinux | 
		  
		    
			  
				 Posted: Wed Jan 15, 2003 6:09 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA 
  | 
		  
		    
			  
				well the sample code reads one line from stdin and writes a message.
 
 
The end of the line is a linefeed _________________ Jeff 
 
 
IBM Certified Developer MQSeries
 
IBM Certified Specialist MQSeries
 
IBM Certified Solutions Expert MQSeries | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | sboucher | 
		  
		    
			  
				 Posted: Wed Jan 15, 2003 6:51 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 27 Oct 2002 Posts: 52
  
  | 
		  
		    
			  
				Jeff,
 
 
So if I strip out the line feeds then do one put to a Q this makes the contents of file appear as one message on a Q _________________ Scott A. Boucher
 
Database Administartor | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fschofer | 
		  
		    
			  
				 Posted: Wed Jan 15, 2003 7:06 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Knight
 
 Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany 
  | 
		  
		    
			  
				My favorite tools to put files to queues are from support pack ih03:
 
MQSeries Integrator V2 - Message display, test and performance utilities
 
 
http://www-3.ibm.com/software/ts/mqseries/txppacs/ih03.html
 
 
rfhutil / rfhutilc (with gui) for single files
 
 
mqputs / mqputsc (command line) for several files / several puts | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |