From d882d2a6a18f5602f470a423b8fa35d9651c3f61 Mon Sep 17 00:00:00 2001 From: agibert Date: Tue, 5 Jun 2007 09:22:43 +0000 Subject: [PATCH] Add queue manager name option "-qm". --- MQSLoad.java | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/MQSLoad.java b/MQSLoad.java index 4d8e4c2..fd5c1e0 100644 --- a/MQSLoad.java +++ b/MQSLoad.java @@ -1,14 +1,14 @@ // $RCSfile: MQSLoad.java,v $ -// $Revision: 1.8 $ +// $Revision: 1.9 $ // $Name: $ -// $Date: 2002/05/21 15:48:09 $ -// $Author: giberta1 $ +// $Date: 2007/06/05 09:22:43 $ +// $Author: agibert $ /* * MQSLoad.java - Data file to MQ/Series queue loader - * Copyright (C) 2001-2002 Arnaud G. Gibert - * arnaud.gibert@misys.com - * www.miys-ibs.fr + * Copyright (C) 2001-2006 Arnaud G. Gibert + * mailto:arnaud@rx3.net + * http://www.rx3.org/dvp/MQSLoad * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -45,10 +45,10 @@ public class MQSLoad private String Message_Break = "\r\n"; private String Message_Tail = ""; private boolean Keep_Message_Break = false; - private String MQSLoad_Revision = "$Revision: 1.8 $"; + private String MQSLoad_Revision = "$Revision: 1.9 $"; private String MQSLoad_Tag = "$Name: $"; - private String MQSLoad_Date = "$Date: 2002/05/21 15:48:09 $"; - private String MQSLoad_Author = "$Author: giberta1 $"; + private String MQSLoad_Date = "$Date: 2007/06/05 09:22:43 $"; + private String MQSLoad_Author = "$Author: agibert $"; @@ -203,7 +203,19 @@ public class MQSLoad { while( argc < args.length) { - if( args[argc].equals( "-fb")) + if( args[argc].equals( "-qm")) + { + if( argc < ( args.length + 1)) + { + QMng_Name = Str_Format( args[++argc]); + } + else + { + System.out.println( "Invalid number of command line options..."); + throw new Exception(); + } + } + else if( args[argc].equals( "-fb")) { if( argc < ( args.length + 1)) { @@ -540,8 +552,8 @@ public class MQSLoad if( ( args.length < 2) || ( args.length > 6)) { - System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] [-mt \"message_tail\"] [-kmb] "); - System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ")"); + System.out.println( "Usage: MQSLoad [-qm \"Output_QueueMng_Name\"] [-fb \"field_break\"] [-mb \"message_break\"] [-mt \"message_tail\"] [-kmb] "); + System.out.println( " Default: Output QueueMng Name: (" + QMng_Name + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ")"); System.exit( 1); } @@ -551,7 +563,7 @@ public class MQSLoad Arg_Parse( args); - System.out.println( "Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")"); + System.out.println( "Output QueueMng Name: (" + QMng_Name + ") Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")"); System.out.println( "Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ")"); MQSInit();