Formatting credit card track II data separator using Cobol

834 Views Asked by At

We have a legacy COBOL program that formats the iso 8583 0100 authorization request. Recently we were told the track II data was invalid due to the separator. The track II data is in a PIC X() field and we simply replace the = with the character D before running the data through a binary intrinsic 2 bytes at a time.

We are told that the character is converting to 4 on their side. My question is: What character should we use to replace the = character? Or do we leave the = character alone?

Thanks for any guidance.

1

There are 1 best solutions below

1
On

Track 2 data is stored on a Credit card as Binary Coded Decimal with parity and the other possible binary values are used for controls.

Hex  ASCII  Meaning
0      0    0
1      1    1
2      2    2
3      3    3
4      4    4
5      5    5
6      6    6
7      7    7
8      8    8
9      9    9
A      :    (not used)
B      ;    Start Sentinel
C      <    (not used)
D      =    Field Separator
E      >    (not used)
F      ?    End Sentinel

I have a feeling that the "binary intrinsic" is simply converting ASCII to BCD, which if you used the standard ASCII characters you would get what you want, as the = is a 0x3D in ASCII and if you strip off the first nibble you are left with a 0xD.