Configuring packager for a variable length subfield like Mastercard Field 126.7

Skip to first unread message

Dec 29, 2022, 9:38:13 AM12/29/22
to jPOS Users
The last subfield (126.7) of Mastercard Field 126 is a variable length subfield. But it doesn't contain length bytes at the start of the subfield. How can I configure a packager for this?

Below is what I have configured, but it creates problem in parsing when the length of Field-126.7 is less than 26. Please guide.

<isofieldpackager id="126" length="50" class="org.jpos.iso.IFA_LLLCHAR" packager="org.jpos.iso.packager.GenericSubFieldPackager" emitBitmap="false" maxValidField="7" name="Switch Private Data">
<isofield id="0" length="1" class="org.jpos.iso.IF_NOP" name="NOT PRESENT" />
<isofield id="1" length="3" class="org.jpos.iso.IF_CHAR" name="Settlement Service Data" />
<isofield id="2" length="10" class="org.jpos.iso.IF_CHAR" name="Single Message System Private Data 1" />
<isofield id="3" length="1" class="org.jpos.iso.IF_CHAR" name="Cross-Border Transaction Indicator" />
<isofield id="4" length="1" class="org.jpos.iso.IF_CHAR" name="Currency Indicator" />
<isofield id="5" length="3" class="org.jpos.iso.IF_CHAR" name="Fraud Score" />
<isofield id="6" length="6" class="org.jpos.iso.IF_CHAR" name="Fraud Risk Indicator" />
<isofield id="7" length="26" class="org.jpos.iso.IF_CHAR" name="Single Message System Private Data 2" />

Jan 4, 2023, 8:17:28 AMJan 4
to jPOS Users
Can anyone help on this?

Mark Salter

Jan 4, 2023, 1:58:30 PMJan 4
It is a private field, can you correct the definition of this field to include a length?

Can you share why the field will be shorter than defined? Perhaps it is absent rather than shorter?

If you cannot change/correct the whole field structure, then you can deal with the field as a whole instead of the subfield and breaking up manually based on the number of bytes available.


Sent from Proton Mail mobile

-------- Original Message --------
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact:
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages