Re: COBOL file dump...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Cor Ligthert (notfirstname_at_planet.nl)
Date: 09/16/04


Date: Thu, 16 Sep 2004 08:09:03 +0200


"Stephany Young"
> Hmmmmmmmmmm ....

> It seems that a few peoples have forgotten their COBOL Core skills :)

Pardon, I thought that I had given almost the same answer as you, the only
thing I was not sure of that MPF had to look for was the character for the
zeros, because than can be translatted in every EBCDIC to ASCII way in a
different way. That it is with you {} is not a default, maybe a lost of your
EBCDIC COBOL skills, because those signs are not the representant for the
same in EBCDIC place. That means Hex C0 and D0 in EBCDIC. Where C=zero plus
and D= zero minus.

With a one to one transaltion this would result in for the C0 the @ Sign
however that exist in EBCDIC as 7C and therefore there should be taken non
existing EBCDIC characters. What is in your case the {} however as far as I
know for sure not a default.

Therefore I asked to MDF was in what are the EBCDIC C0 (+0) and D0 (-0)
translated, because that depends on the converter.

Than the procedure is easy to do.

First copy the string except the last postiton,
If the last character not is the equivalent for -0 you can set the the
boolean IsMinus
For +0 and - 0 concatenate as a char "0" to the made string.
If not than for the values from A to R you can do a subtract in the byte
with 16 to get the last character which you can do for the J to R as well
with the value 25.
Concatenate that value as ASCW to the string.

Than when the it is minus subtract the string from an integer with the value
zero and otherwise make from it an integer.

That is all,

So what is this different from my previous message?

Cor



Relevant Pages

  • Re: Will standard C++ allow me to replace a string in a unicode-encoded text file?
    ... >> You really should check that the other bytes are zero, as well, and give ... >> normal string, unless you're on an implementation with 16 bit or more ... >> to an error character ('?' ... > byte-order mark is \0 for all chars in the file). ...
    (comp.lang.cpp)
  • Re: Admired designs / designs to study
    ... instructions to try to pack together a whole word ... resort to using one of the string or bit move ... Get the next character from the ... if the number isn't zero yet. ...
    (comp.arch)
  • Re: Adding a leading zero to a SSN
    ... I haven't notice that the request was simply to display a SSN ... formatted string. ... "I need a have a formula that will add a zero to the begging of a 8 ... character length. ...
    (microsoft.public.excel.misc)
  • Re: DEC-C: Null string constant ?
    ... To be a bit more precise, a null character is a valid character. ... > a valid character within the body of that string. ... >>A null string is a string with no characters, zero length. ...
    (comp.os.vms)
  • Re: COBOL file dump...
    ... If the last character not is the equivalent for -0 you can set the the ... Concatenate that value as ASCW to the string. ... Than when the it is minus subtract the string from an integer with the value ... zero and otherwise make from it an integer. ...
    (microsoft.public.dotnet.languages.vb)