5 Commits

Author SHA1 Message Date
giberta1
79e9c52f34 Initial creation. 2002-05-02 17:31:18 +00:00
giberta1
982b8533a1 Add "message breaks are striped by default". 2002-05-02 17:24:15 +00:00
giberta1
895119edc8 Add -kmb description. 2002-05-02 17:22:48 +00:00
giberta1
a886c59026 Add 1.1.1 entry:
Add Keep Message Break support,
    Add -kmb option.
2002-05-02 17:17:28 +00:00
giberta1
eafca20611 Add Keep Message Break support,
Add -kmb option.
2002-05-02 17:09:35 +00:00
5 changed files with 4277 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
// $RCSfile: MQSLoad.java,v $ // $RCSfile: MQSLoad.java,v $
// $Revision: 1.4 $ // $Revision: 1.5 $
// $Name: $ // $Name: $
// $Date: 2002/04/23 15:07:47 $ // $Date: 2002/05/02 17:09:35 $
// $Author: giberta1 $ // $Author: giberta1 $
/* /*
@@ -43,6 +43,7 @@ public class MQSLoad
private String File_Name; private String File_Name;
private String Field_Break = ""; private String Field_Break = "";
private String Message_Break = "\r\n"; private String Message_Break = "\r\n";
private boolean Keep_Message_Break = false;
@@ -221,6 +222,10 @@ public class MQSLoad
throw new Exception(); throw new Exception();
} }
} }
else if ( args[argc].equals( "-kmb"))
{
Keep_Message_Break = true;
}
else else
{ {
MsgQ_Name = args[argc++]; MsgQ_Name = args[argc++];
@@ -439,6 +444,11 @@ public class MQSLoad
if( next_message <= cur_window_size) if( next_message <= cur_window_size)
{ {
// System.out.println( "* Write Msg CurPos: (" + cur_pos + ")"); // System.out.println( "* Write Msg CurPos: (" + cur_pos + ")");
if( Keep_Message_Break)
{
output_msg.writeString( Message_Break);
}
output_msg.messageId = MQC.MQMI_NONE; output_msg.messageId = MQC.MQMI_NONE;
MQSPut_Msg( output_msg); MQSPut_Msg( output_msg);
output_msg.clearMessage(); output_msg.clearMessage();
@@ -498,8 +508,8 @@ public class MQSLoad
if( ( args.length < 2) || ( args.length > 6)) if( ( args.length < 2) || ( args.length > 6))
{ {
System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] <Output_MsgQueue_Name> <Input_File_Name>"); System.out.println( "Usage: MQSLoad [-fb \"field_break\"] [-mb \"message_break\"] [-kmb] <Output_MsgQueue_Name> <Input_File_Name>");
System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ")"); System.out.println( " Default: Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Keep Message Break: (" + Keep_Message_Break + ")");
} }
else else
{ {
@@ -508,7 +518,7 @@ public class MQSLoad
Arg_Parse( args); Arg_Parse( args);
System.out.println( "Output MsgQueue Name: (" + MsgQ_Name + ") Input File Name: (" + File_Name + ")"); System.out.println( "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) + ")"); System.out.println( "Field Break: (" + Str_UnFormat( Field_Break) + ") Message Break: (" + Str_UnFormat( Message_Break) + ") Keep Message Break: (" + Keep_Message_Break + ")");
MQSInit(); MQSInit();

View File

@@ -1,7 +1,7 @@
# $RCSfile: ReadMe.txt,v $ # $RCSfile: ReadMe.txt,v $
# $Revision: 1.4 $ # $Revision: 1.6 $
# $Name: $ # $Name: $
# $Date: 2002/04/23 18:06:55 $ # $Date: 2002/05/02 17:24:15 $
# $Author: giberta1 $ # $Author: giberta1 $
@@ -32,15 +32,17 @@ Notes:
+ "\t" for tabulation, + "\t" for tabulation,
+ "\\" for \. + "\\" for \.
- Message break are used for message separation in the batch file, and are striped from the sended message, - Message breaks are used for message separation in the batch file,
- Field are striped from the seded message. - Message breaks are striped from the sended message if "-kmb" (keep message break) is not set,
- Field breaks are striped from the sended message.
- Windows text files: newline is specified as "\r\n", - Windows text files: newline is specified as "\r\n",
- Unix text files: newline is specified as "\n". - Unix text files: newline is specified as "\n".
- By default: - By default:
+ There is no field break, + There is no field break,
+ Message break is "\r\n". + Message break is "\r\n",
+ Message breaks are striped.
- This software is under the GNU General Public License. See GNU-GPL.txt. - This software is under the GNU General Public License. See GNU-GPL.txt.
@@ -51,5 +53,7 @@ Usage Examples:
- To load a swift batch file "swift-batch.txt" with "---MESSAGE-BREAK---" message separator into the MQ/Series "SWIFT-QUEUE" use: - To load a swift batch file "swift-batch.txt" with "---MESSAGE-BREAK---" message separator into the MQ/Series "SWIFT-QUEUE" use:
java MQSLoad -mb "---MESSAGE-BREAK---\r\n" SWIFT-QUEUE swift-batch.txt java MQSLoad -mb "---MESSAGE-BREAK---\r\n" SWIFT-QUEUE swift-batch.txt
- To load a raw swift batch file "swift-batch-raw.txt" with "}\r\n" message break into the MQ/Series "SWIFT-QUEUE" and by keeping message break separator use:
java MQSLoad -mb "}\r\n" -kmb SWIFT-QUEUE swift-batch-raw.txt
- To load a csv batch file "batch.csv" with ";" field separator into the MQ/Series "DATA-QUEUE" use: - To load a csv batch file "batch.csv" with ";" field separator into the MQ/Series "DATA-QUEUE" use:
java MQSLoad -fb ";" DATA-QUEUE csv-batch.csv java MQSLoad -fb ";" DATA-QUEUE csv-batch.csv

View File

@@ -1,13 +1,22 @@
# $RCSfile: ReleaseNotes.txt,v $ # $RCSfile: ReleaseNotes.txt,v $
# $Revision: 1.2 $ # $Revision: 1.3 $
# $Name: $ # $Name: $
# $Date: 2002/04/23 16:18:06 $ # $Date: 2002/05/02 17:17:28 $
# $Author: giberta1 $ # $Author: giberta1 $
--------------------------------------------------------------------------------
MQSLoad V 1.1.1 - A. Gibert - 02/05/02
--------------------------------------------------------------------------------
Add Keep Message Break support,
Add -kmb option.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
MQSLoad V 1.1.0 - A. Gibert - 23/04/02 MQSLoad V 1.1.0 - A. Gibert - 23/04/02
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

4200
test-swift-raw-big.txt Normal file

File diff suppressed because it is too large Load Diff

42
test-swift-raw.txt Normal file
View File

@@ -0,0 +1,42 @@
{1:F01BCMAMAMCAXXX0857229951}{2:O1001511000801CICPFRPPAXXX65003436280008011611N}{4:
:20:CIC0001
:32A:000918EUR25062,66
:50:SOCIETE S.A.
PARIS
FRANCE
:57A:BCMAMAMCXXX
:59:I.A.M.
FES
MAROC
:70:/RFB/SOC01901
:71A:BEN
-}{5:{MAC:BCED2F18}{CHK:075B64FB4533}}
{1:F01BCMAMAMC1XXX0000000000}{2:I730BNPAFRPPXXXXN}{4:
:20:ELC00001007
:21:TESTS-DL-003
:30:010629
-}
{1:F01BCMAMAMC1XXX0000000000}{2:I710BCPCMACCXXXXN}{4:
:27:1/1
:40B:IRREVOCABLE TRANSFERABLE
ADDING OUR CONFIRMATION
:20:ELC00001002
:21:POB00001001
:31C:010328
:31D:010528PARIS
:52A:BARCGB22XXX
:50:SOCIETE ABC
AVENUE DES ALPES
CASABLANCA
:59:HUSUM PLASTIC
:32B:MAD100000,00
:41A:BARCGB22XXX
BY PAYMENT
:43P:NOT ALLOWED
:43T:NOT ALLOWED
:44A:GERMANY
:44B:CASABLANCA
:71B:ALL FOREIGN BANK CHARGES ARE FOR
THE ACCOUNT OF THE BENEFICIARY
:49:WITHOUT
-}