From 04960749516f83a94c65a02dc98d8135a2a28258 Mon Sep 17 00:00:00 2001 From: agibert Date: Fri, 12 Dec 2008 00:00:31 +0000 Subject: [PATCH] - Add character convert option "-cc" --- MQSLoad.java | 25 +++++++++++++++++-------- ReleaseNotes.txt | 5 +++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/MQSLoad.java b/MQSLoad.java index 7626937..98443cd 100644 --- a/MQSLoad.java +++ b/MQSLoad.java @@ -1,7 +1,7 @@ // $RCSfile: MQSLoad.java,v $ -// $Revision: 1.17 $ +// $Revision: 1.18 $ // $Name: $ -// $Date: 2008/12/11 14:17:18 $ +// $Date: 2008/12/12 00:00:31 $ // $Author: agibert $ /* @@ -35,15 +35,16 @@ import com.ibm.mq.*; public class MQSLoad { - private String MQSLoad_Revision = "$Revision: 1.17 $"; + private String MQSLoad_Revision = "$Revision: 1.18 $"; private String MQSLoad_Tag = "$Name: $"; - private String MQSLoad_Date = "$Date: 2008/12/11 14:17:18 $"; + private String MQSLoad_Date = "$Date: 2008/12/12 00:00:31 $"; private String MQSLoad_Author = "$Author: agibert $"; private MQQueueManager QMng = null; private String QMng_Name = ""; private MQQueue MsgQ; private String MsgQ_Name; private int MsgQ_Open_Options = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING; + private boolean Character_Convert = false; private int Character_Set = 1208; private int Sleep_Time = 0; private String Field_Break = ""; @@ -223,6 +224,10 @@ public class MQSLoad throw new Exception(); } } + else if ( args[argc].equals( "-cc")) + { + Character_Convert = true; + } else if ( args[argc].equals( "-cs")) { if( argc < ( args.length + 1)) @@ -646,7 +651,11 @@ public class MQSLoad try { - output_msg.format = MQC.MQFMT_STRING; + if( Character_Convert) + { + output_msg.format = MQC.MQFMT_STRING; + } + output_msg.characterSet = Character_Set; work_win_size = 1024 * 64; @@ -774,8 +783,8 @@ public class MQSLoad private void Usage_Print( ) throws Exception { - System.out.println( "Usage: MQSLoad [-qm \"Output_QueueMng_Name\"] [-cs \"character_set\"] [-st \"sleep_time\"] [-fb \"field_break\"] [-mb \"message_break\"] [-mt \"message_tail\"] [-kmb] [-ms \"message_skip\"] [-mc \"message_count\"] [-rc \"repeat_count\"] "); - System.out.println( " Default: Output QueueMng Name: (" + QMng_Name + ") Character Set: (" + Character_Set + ") Sleep Time: (" + Sleep_Time + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")"); + System.out.println( "Usage: MQSLoad [-qm \"Output_QueueMng_Name\"] [-cc \"character_convert\"] [-cs \"character_set\"] [-st \"sleep_time\"] [-fb \"field_break\"] [-mb \"message_break\"] [-mt \"message_tail\"] [-kmb] [-ms \"message_skip\"] [-mc \"message_count\"] [-rc \"repeat_count\"] "); + System.out.println( " Default: Output QueueMng Name: (" + QMng_Name + ") Character Convert: (" + Character_Convert + ") Character Set: (" + Character_Set + ") Sleep Time: (" + Sleep_Time + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")"); } @@ -789,7 +798,7 @@ public class MQSLoad private void Args_Print( ) throws Exception { System.out.println( "Output QueueMng Name: (" + QMng_Name + ") Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")"); - System.out.println( "Character Set: (" + Character_Set + ") Sleep Time: (" + Sleep_Time + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")"); + System.out.println( "Character Convert: (" + Character_Convert + ") Character Set: (" + Character_Set + ") Sleep Time: (" + Sleep_Time + ") Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Message Tail: (" + Str_UnFormat( Message_Tail) + ") Keep Message Break: (" + Keep_Message_Break + ") Message Skip: (" + Message_Skip + ") Message Count: (" + Message_Count + ") Repeat Count: (" + Repeat_Count + ")"); } diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 3ba272e..b0f64e5 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,7 +1,7 @@ # $RCSfile: ReleaseNotes.txt,v $ -# $Revision: 1.13 $ +# $Revision: 1.14 $ # $Name: $ -# $Date: 2008/12/11 14:17:18 $ +# $Date: 2008/12/12 00:00:31 $ # $Author: agibert $ @@ -17,6 +17,7 @@ MQSLoad V 2.0.0 - A. Gibert - 2008/12/11 - Add message count option "-mc", - Add repeat count option "-rc", - Add character set option "-cs", +- Add character convert option "-cc", - Fix Java 1.4 compatibility.