title: C#: Convert COMP-3 Packed Decimal to Human-Readable Value
body: <p>I have a series of ASCII flat files coming in from a mainframe to be processed by a C# application. A new feed has been introduced with a Packed Decimal (COMP-3) field, which needs to be converted to a numerical value.</p>
  
  <p>The files are being transferred via FTP, using ASCII transfer mode. I am concerned that the binary field may contain what will be interpreted as very-low ASCII codes or control characters instead of a value - Or worse, may be lost in the FTP process.</p>
  
  <p>What's more, the fields are being read as strings. I may have the flexibility to work around this part (i.e. a stream of some sort), but the business will give me pushback.</p>
  
  <p>The requirement read "Convert from HEX to ASCII", but clearly that didn't yield the correct values.  Any help would be appreciated; it need not be language-specific as long as you can explain the logic of the conversion process.</p>