The number looks like a Mainframe Cobol Zoned decimal number (certainly EBCDIC Cobol which would also include AS400 Cobol). The last digit represents the numeric sign and the last numeric digit digit (i.e { = +0; } = -0; A = 1; J=-1; B=2; k=-2 etc). The {, A, B are consecutive characters in the EBCDIC format.
- {, A, B .. H represent positive 0 .. 9
- }, J, K .. R represent negative 0 .. 9
So 123B is +1232 and 123K is -1232.
Biztalk almost certainly has code to decifer these numbers. Alternatively it could be easily translated to a normal number on the mainframe by a number of utilities (i.e. sort, easytrieve etc).
If you can not get the file translated, it is probably worth getting the Cobol Copybook.
Here is Java Code to decifer the number (It should not should not be to hard to convert to c#):
private static int positiveDiff = 'A' - '1';
private static int negativeDiff = 'J' - '1';
public static String fromZoned(String numZoned) {
String ret;
String sign = "";
char lastChar;
if (numZoned == null || numZoned.equals("") || numZoned.equals("-")) {
// throw ...
return "";
}
ret = numZoned.trim();
lastChar = ret.substring(ret.length() - 1).toUpperCase().charAt(0);
switch (lastChar) {
case '}' : sign = "-";
case '{' :
lastChar = '0';
break;
case 'A':
case 'B':
case 'C':
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
lastChar = (char) (lastChar - positiveDiff);
break;
case 'J':
case 'K':
case 'L':
case 'M':
case 'N':
case 'O':
case 'P':
case 'Q':
case 'R':
sign = "-";
lastChar = (char) (lastChar - negativeDiff);
default:
}
ret = sign + ret.substring(0, ret.length() - 1) + lastChar;
return ret;
}
As a side note the format comes from the old Punch-Cards. To save space they over-typed the last numeric digit with the sign; Overtyping a 0 with a minus (or whatever they used) generates a } in EBCDIC etc).