ISO8583 Field 43 format

1,083 views
Skip to first unread message

Jeff Lanzarotta

unread,
Sep 21, 2007, 1:40:36 PM9/21/07
to jpos-...@googlegroups.com
Hello,

I am very new to using jPOS and ISO8583.

I have a question about Field 43 - Merchant/Location Name.

The processor I am will be talking to has specified that the field be formatted like:

Positions 1 - 25 contains Merchant/Location Name
Positions 26 - 38 contains the City Name
Positions 39 - 40 contains 'US'

How does one format Field 43? This does not seem as straight forward as a simple:

msg.set(43, "location city US");

Thanks.

Alejandro Revilla

unread,
Sep 21, 2007, 1:46:58 PM9/21/07
to jpos-...@googlegroups.com
>
> How does one format Field 43? This does not seem as straight forward as a
> simple:
>
If you can live with some minor string manipulation, the easiest way
would be to just call:

>
> msg.set(43, "location city US");
>

msg.set (43, "LOCATION.................CITY.........CC");
(with blanks instead of dots)

As an alternative, you could configure field 43 as a constructed data
element containing three IF_CHAR fixed length fields.

Jeff Lanzarotta

unread,
Sep 21, 2007, 1:57:54 PM9/21/07
to jpos-...@googlegroups.com
OK, I see... I will try both methods and see which one I like the best...

Thanks.

Andy Orrock

unread,
Sep 21, 2007, 2:21:09 PM9/21/07
to jpos-...@googlegroups.com

Our code looks like this for one interface:

 

        // Field 43 - Acceptor Name

        Store store = (Store) ctx.tget (STORE);

        if (store != null) {

            StringBuffer sb = new StringBuffer ();

            sb.append (padOrTruncate (store.getName(), 25));

            sb.append (padOrTruncate (store.getCity(), 13));

            sb.append (padOrTruncate (store.getState(), 2));

            m.set (43, sb.toString());        

        }   

    

Where padOrTruncate does this:

 

            private String padOrTruncate (String s, int len) {

               if (s == null)

                   s = "";

           return s.length() > len ? s.substring(0,len) : ISOUtil.strpad(s,len);

            }

 

 


<br

Reply all
Reply to author
Forward
0 new messages