Re: EBCDIC to ASCII file conversion



Nothing to do with ASCII/EBCDIC: You're looking at overpunched decimal signed numbers.
postive 120 comes out as 12{. Negative 120 comes out as 12}
see http://www.discinterchange.com/TechTalk_signed_fields_.html for an overview



Aidan Whitehall wrote:
We've been sent an EBCDIC file containing some sample data and an ASCII file containing (supposedly) the same data.

I've used cygwin and UnixUtils' dd (with the conv=ASCII option) to verify that we can routinely convert further EBCDIC files, and (perhaps unsurprisingly)both apps generate the same output for the EBCDIC file supplied. However, that output doesn't match the ASCII file they supplied.

Their e-mail came with the line "He created them as "fixed length" format (I am sorry I don't know what he exactly means)."

All lines in the ASCII file they supplied (except the last) contain 451 characters, most of which contain zeroes for the 2nd half of the line. Every character (again, execpt the square block in the very last line, viewing it in Notepad) is a digit. In the output from dd, there are numerous instances of a left brace, followed by nine 0's, followed by another left brace.

Does this sound like a familiar conversion problem to anyone? Is there an option in 'dd' that will rectify this? If anyone's feeling charitable, I can supply the data files we received.

I'm posting to this, and not a Linux forum, in the hope that it's more valuable to know about EBCDIC than dd :-) Thanks!

.



Relevant Pages

  • EBCDIC to ASCII file conversion
    ... We've been sent an EBCDIC file containing some sample data and an ASCII file ... that output doesn't match the ASCII file they supplied. ... characters, most of which contain zeroes for the 2nd half of the line. ... of a left brace, followed by nine 0's, followed by another left brace. ...
    (comp.sys.ibm.as400.misc)
  • Re: Whats wrong with that code(II)?
    ... "missing '}'" is ONE word and the interpreter should not look "inside" the string. ... then the word is terminated by the matching close brace. ... No substitutions are performed on the characters between the braces ... ... The word ends at the close-brace that is enclosed in single-quotes, and is the string “return "missing '”. ...
    (comp.lang.tcl)
  • Re: Whats wrong with that code(II)?
    ... for each additional open brace there must be an additional close brace. ... No substitutions are performed on the characters between the braces except for backslash-newline substitutions described below, nor do semi-colons, newlines, close brackets, or white space receive any special interpretation. ... And since in Tcl-Rule there is no talk about braces being treated as ordinary characters within a quoted string, it's obvious that Tcl-Rule takes precedence as there was a word opened with '{' first ...
    (comp.lang.tcl)
  • Re: Bosworth and London, or what do we call the tacks?
    ... brace, and now being confident that I have truly gotten the story right ... although I also am certain I have the positions of the two tack symbols ... left square bracket [ ... pretend you were going to push these characters into a piece ...
    (comp.lang.apl)
  • Merge errors
    ... We are getting errors when we try to do a mail merge in Word 2003 SP1 ... with an ASCII file generated in a custom database. ... name to 39 or less by removing the spaces, ... The "#%$" are actually displayed as chinese characters?. ...
    (microsoft.public.word.mailmerge.fields)