| Author | Message | 
		
		  | gag_nm | 
			  
				|  Posted: Fri Jul 21, 2017 4:18 am    Post subject: ISO8583 |   |  | 
		
		  | Centurion
 
 
 Joined: 16 Oct 2008Posts: 102
 
 
 | 
			  
				| dears, 
 Trying to build ISO8583 Message using DFDL in Message Broker Version v8.0
 
 bitmap is not generating.
 
 Input Message:
 
 
 
   
	| Code: |  
	| <ISO8583_1987> <MTI_Version>0</MTI_Version>
 <MTI_MessageClass>8</MTI_MessageClass>
 <MTI_MessageFunction>0</MTI_MessageFunction>
 <MTI_MessageOrigin>0</MTI_MessageOrigin>
 <TransmissionDatetime_007>0718162230</TransmissionDatetime_007>
 <SystemsTraceAuditNumber_011>123456</SystemsTraceAuditNumber_011>
 <ResponseCode_039>  </ResponseCode_039>
 <NetworkManagementInformationCode_070>001</NetworkManagementInformationCode_070>
 </ISO8583_1987>
 |  
 output message
 
 0800‚ ..............0720210711123456  001
 
 below is code
 
 
 
   
	| Code: |  
	| CREATE COMPUTE MODULE ISO8583_WMQ_to_TCPIP_Transform_XML_to_ISO8583
 CREATE FUNCTION Main() RETURNS BOOLEAN
 BEGIN
 SET OutputRoot.Properties = InputRoot.Properties;
 SET OutputRoot.Properties.MessageType = '{}:ISO8583_1987';
 CREATE LASTCHILD OF OutputRoot DOMAIN('DFDL');
 DECLARE InRef REFERENCE TO InputRoot;
 CALL RemoveUnrequiredXMLAttributes(InRef);
 SET OutputRoot.DFDL = InRef.XMLNSC;
 CREATE NEXTSIBLING OF OutputRoot.DFDL.ISO8583_1987.MTI_MessageOrigin NAME 'PrimaryBitmap';
 DECLARE DFDLPointer REFERENCE TO OutputRoot.DFDL.ISO8583_1987.PrimaryBitmap;
 
 CALL PopulatePrimaryBitmap(DFDLPointer);
 
 DECLARE SecondaryBitmap BOOLEAN FALSE;
 IF CAST(SUBSTRING(FIELDNAME(OutputRoot.DFDL.ISO8583_1987.*[<]) AFTER '_') AS INT) > 64 THEN
 SET SecondaryBitmap = TRUE;
 END IF;
 
 IF SecondaryBitmap THEN
 -- This means a SecondaryBitmap will be required
 CREATE NEXTSIBLING OF OutputRoot.DFDL.ISO8583_1987.PrimaryBitmap NAME 'SecondaryBitmap';
 MOVE DFDLPointer TO OutputRoot.DFDL.ISO8583_1987.SecondaryBitmap;
 CALL PopulateSecondaryBitmap(DFDLPointer);
 
 -- SecondaryBitmap is present, so set Bit001 to 1
 SET OutputRoot.DFDL.ISO8583_1987.PrimaryBitmap.Bit001 = 1;
 ELSE
 MOVE DFDLPointer TO OutputRoot.DFDL.ISO8583_1987.PrimaryBitmap;
 -- SecondaryBitmap is not present. Bit001 will already be initialised to 0.
 END IF;
 
 -- Having created the Bitmap structures with all bits set to 0, now set the Bit values ...
 CALL UpdateBitmapsBasedOnAvailableFields(DFDLPointer);
 
 
 
 
 RETURN TRUE;
 END;
 
 CREATE PROCEDURE GenerateThreeDigitIndex(IN IndexInt INTEGER, OUT IndexChar CHAR)
 BEGIN
 SET IndexChar =
 CASE
 WHEN IndexInt < 10 THEN ('00' || CAST(IndexInt AS CHAR))
 WHEN IndexInt < 100 THEN ('0' || CAST(IndexInt AS CHAR))
 ELSE CAST(IndexInt AS CHAR)
 END;
 END;
 
 CREATE PROCEDURE RemoveUnrequiredXMLAttributes(INOUT InRef REFERENCE)
 BEGIN
 SET InRef.XMLNSC.*:XmlDeclaration = NULL;
 DECLARE NumberRootAttributes INTEGER CARDINALITY(InRef.XMLNSC.ISO8583_1987.(XMLNSC.Attribute)*[]);
 DECLARE I1 INTEGER 1;
 WHILE I1 <= NumberRootAttributes DO
 SET InRef.XMLNSC.ISO8583_1987.(XMLNSC.Attribute)*[1] = NULL;
 SET I1 = I1 + 1;
 END WHILE;
 END;
 
 CREATE PROCEDURE PopulatePrimaryBitmap(INOUT DFDLPointer REFERENCE)
 BEGIN
 DECLARE I2 INTEGER 1;
 DECLARE IndexChar CHAR;
 -- Create PrimaryBitmap structure, with all bits set to 0
 WHILE I2 < 65 DO
 CALL GenerateThreeDigitIndex(I2,IndexChar);
 CREATE LASTCHILD OF DFDLPointer NAME ('Bit' || IndexChar) VALUE 0;
 SET I2 = I2 + 1;
 END WHILE;
 END;
 
 CREATE PROCEDURE PopulateSecondaryBitmap(INOUT DFDLPointer REFERENCE)
 BEGIN
 DECLARE J INTEGER 65;
 DECLARE IndexChar CHAR;
 WHILE J < 129 DO
 -- Create SecondaryBitmap structure, with all bits set to 0
 CALL GenerateThreeDigitIndex(J,IndexChar);
 CREATE LASTCHILD OF DFDLPointer NAME ('Bit' || IndexChar) VALUE 0;
 SET J = J + 1;
 END WHILE;
 END;
 
 CREATE PROCEDURE UpdateBitmapsBasedOnAvailableFields(INOUT DFDLPointer REFERENCE)
 BEGIN
 -- Loop over the fields which are present to update the Bitmaps ...
 MOVE DFDLPointer NEXTSIBLING;
 WHILE LASTMOVE(DFDLPointer) DO
 DECLARE CurrentFieldName CHAR FIELDNAME(DFDLPointer);
 DECLARE BitName CHAR ('Bit' || SUBSTRING(CurrentFieldName AFTER '_'));
 IF CAST(SUBSTRING(CurrentFieldName AFTER '_') AS INT) < 65 THEN
 -- Current field relates to PrimaryBitmap
 SET OutputRoot.DFDL.ISO8583_1987.PrimaryBitmap.{BitName} = 1;
 ELSE
 -- Current field relates to SecondaryBitmap
 SET OutputRoot.DFDL.ISO8583_1987.SecondaryBitmap.{BitName} = 1;
 END IF;
 MOVE DFDLPointer NEXTSIBLING;
 END WHILE;
 END;
 
 
 
 END MODULE;
 
 
 
 
 |  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | gag_nm | 
			  
				|  Posted: Fri Jul 21, 2017 4:20 am    Post subject: |   |  | 
		
		  | Centurion
 
 
 Joined: 16 Oct 2008Posts: 102
 
 
 | 
			  
				| Issue with Output Message  is "," and bit is not generating. 
 bitmap is not seen on output message.
 
 how to remove this "," and generate bit maps.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | gag_nm | 
			  
				|  Posted: Fri Jul 21, 2017 4:22 am    Post subject: |   |  | 
		
		  | Centurion
 
 
 Joined: 16 Oct 2008Posts: 102
 
 
 | 
			  
				| can we do this with MRM , if so please source for creating BitMaps. |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqjeff | 
			  
				|  Posted: Fri Jul 21, 2017 4:31 am    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 17447
 
 
 | 
			  
				| DFDL is much better at modelling all kinds of message data than MRM. 
 If your DFDL model does not produce the data you want, then use the DFDL tester to adjust your model until.it does.
 
 In general, when you have one field and another field, and there is a character between them, that is a separator.
 
 So if you are getting a separator, it is because your DFDL model specifies one.
 
 DFDL can certainly model bitmaps - whcih MRM can't do.  DFDL lets you model individual bits as part of a field, rather than having to model the whole byte as one block.
 _________________
 chmod  -R ugo-wx /
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | timber | 
			  
				|  Posted: Fri Jul 21, 2017 6:01 am    Post subject: |   |  | 
		
		  |  Grand Master
 
 
 Joined: 25 Aug 2015Posts: 1292
 
 
 | 
			  
				| You have to create the bitmap elements in the message tree using some ESQL. Check out the IBM Github site for some examples. |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | gag_nm | 
			  
				|  Posted: Sat Jul 22, 2017 3:37 am    Post subject: |   |  | 
		
		  | Centurion
 
 
 Joined: 16 Oct 2008Posts: 102
 
 
 | 
			  
				| request Receiving system  finds message is wrong. 
 Message should be as below.
 
 
 
 
   
	| Code: |  
	| |      30 38 30 30 38 32 32 30 30 30 30 30 30 30 30 30 30 30 30 30 08008220000000000000
 |      30 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 37 32 30 04000000000000000720
 |      31 31 33 35 35 34 30 35 38 37 32 38 30 30 31                113554058728001
 |  
 but from when message sent from WMB below message is received.
 
 
 
   
	| Code: |  
	| 30 38 30 30 82 20 00 00--02 00 00 00 04 00 00 00  |0800. ..........|
 00 00 00 00 30 37 32 30--31 38 32 33 32 31 31 32  |....072018232112|
 33 34 35 36 20 20 30 30--31                       |3456  001       |
 |  
 instead bitmap 0 and 1 ,it shown as dot ".".
 
 is this related to Encoding ?
 
 we have used dynamic dfdl encoding and US-ASCII.
 
 let me know, what could be wrong
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | fjb_saper | 
			  
				|  Posted: Sat Jul 22, 2017 6:08 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| The DFDL output for the bitmap is correct. What you really have is a normalized bitmap where each bit is an ascii character so 0 = 0x30 and 1 = 0x31 
 Have fun modelling that...
  _________________
 MQ & Broker admin
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqjeff | 
			  
				|  Posted: Sat Jul 22, 2017 6:21 am    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 17447
 
 
 | 
			  
				| Well.... A bitmap is a set of bits that are contained within one or more bytes... 
 If, instead, the "bitmap" is really a string of bytes, then that's a different model.
 
 I don't know the ISO8583 standard, so I don't know what the field in question should actually be.
 
 Encoding would certainly affect numbers, but I don't believe it would affect raw bytes.  But if your DFDL model says the field is a number, that's a different thing.
 _________________
 chmod  -R ugo-wx /
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | leopucci | 
			  
				|  Posted: Tue Dec 12, 2017 5:17 am    Post subject: |   |  | 
		
		  | Apprentice
 
 
 Joined: 09 Nov 2017Posts: 28
 
 
 | 
			  
				| @gag_nm 
 I had the same problems.
 I think that you are setting the bits before the creation of them bitmap.
 
 You have to set the message code, then the creation of the bitpmaps take place.
 
 If you set the bits before that. the bitmaps will be in the end of the message.
 
 debug at the end of your code and you will find the bitmap on the wrong dfdl position
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |