title: ISO 8583 Rev 93 Alphabetic & Numeric Characters Packing/Unpacking
body: <p>I am faced with the task of sending ISO 8583 Rev 93 messages and am using openiso8583.net.  The company that is consuming my messages gave message samples and I am unclear about the following Field attributes:</p>
  
  <p>Special Characters
  Alphabetic &amp; Numeric Characters
  Alphabetic &amp; Special Characters
  Number &amp; Special Characters
  Alphabetic, Numeric, &amp; Special Characters</p>
  
  <p>Here is the example:</p>
  
  <pre><code>Signon Reply
  0810822000000200000004000000000000000501130427000005F0F00001
  NUM  |FLDNAME |FIELD DESCRIPTION              |LEN |T|FIELD VALUE
  -----|--------|-------------------------------|----|-|--------------------------
  N/A  |MSGTYPE |MESSAGE TYPE                   |F2  |H|0810`
  N/A  |BITMAP1 |FIRST BITMAP                   |B8  |H|8220000002000000`
  1    |BITMAP2 |SECOND BITMAP                  |B8  |H|0400000000000000`
  7    |MISDTMDT|TRANSMISSION DATE AND TIME     |F5  |H|0501130427`
  11   |MISDSTAN|SYSTEM TRACE AUDIT NUMBER      |F3  |H|000005`
  39   |MISDRSPC|RESPONSE CODE                  |F2  |C|00`      &lt;------?
  70   |MISDNMIC|NETWORK MANAGEMENT INFO CODE   |F2  |H|0001`
  </code></pre>
  
  <p>First, take a look at the message bytes:
  0810822000000200000004000000000000000501130427000005*<em>F0F0</em>*0001</p>
  
  <p>My question is how the two bytes { 0xF0, 0xF0 } translates to "00".  If the company was sending ASCII, I would expect "00" to be { 0x30, 0x30 }.  BCD is used for Numeric values but I can't seem to figure out how character values are being encoded.</p>
  
  <p>Here is the description for field 39:</p>
  
  <pre><code>039:
  Network Response Code
  
  Attributes: 
  an 2*
  
  Description:
  A field that indicates the result of a previous related request. It will indicate
  approval or reason for rejection if not approved. It is also used to indicate to the
  device processor whether or not machines that are capable of retaining the customer's
  card should do so.
  
  Format:
  In transaction replies, the response code must contain one of the following values
  with their corresponding meanings. For debit/host-data-capture 0220 / 0420 messages, a
  response code of '00' must be returned to indicate the transaction was approved. For
  EBT transactions, please refer to section 4.8 EBT Transaction Receipt Requirements.
  </code></pre>
  
  <p>an2 means Alphabetic &amp; Numeric Characters</p>
  
  <p>Bitmap 1 is 64 bits</p>
  
  <p>Bitmap 2 is 64 bits</p>
  
  <p>Msg Type is 4 bytes</p>
  
  <p>Field 7 is Numeric 4-bit BCD (Packed unsigned) 10, 5 bytes</p>
  
  <p>Field 11 is Numeric 4-bit BCD (Packed unsigned) 6, 3 bytes</p>
  
  <p>Field 39 is an 2, I assume 2 bytes</p>
  
  <p>Field 70 is Numeric 4-bit BCD (Packed unsigned) 3, 2 bytes</p>
  
  <p>Any clues or pointers would be greatly appreciated.  Maybe someone knows of some encoding I clearly do not or can give a general explenation of how characters are encoded for ISO 8583 Rev 93.  I do realize that each company can have different implementations though.</p>