Re: Converting numbers to comp fields (Cobol)

From: BeastFish (beastfish_at_for-president.com)
Date: 06/15/04


Date: Tue, 15 Jun 2004 00:51:18 -0400

Comp? Comp-3? Doesn't really matter since COMP is a COBOL thing, VB
doesn't handle any type of COMP format natively. Seems like a box full of
frustration just waiting to be opened. One of those things that even if you
did get something working, you'd always wonder if you're twiddling those
bits accurately. Consider the following...

How COMP format is implemented depends on the specific COBOL compiler.
Different compilers implement it in their own fashion. Usually, COMP is
some form of fixed point BCD (binary-coded decimal), where 2 digits are
stored in each byte (1 per nibble). Also, depending on which compiler, it
can be little-endian or big-endian. Dealing with this in VB (or any other
language besides COBOL) is something I wouldn't even think of doing.

The MicroFocus COBOL compiler I have on my box is a 12 year old DOS one. I
haven't investigated any of the later MicroFocus ones, so I don't know what
they've been up to. Does the version you're using have any Windows support?
Can it create DLLs that can be utilized by Windows programs? If so, perhaps
you can use it to write a DLL that writes the data to file, one that can be
called from VB.

"John" <anonymous@discussions.microsoft.com> wrote in message
news:1c26d01c4525c$6b1c6b70$a301280a@phx.gbl...
> I'm new to Visual Basic. I have written an little program
> that creates a journal entry batch file which gets loaded
> to our Unix box. We then run a utility to convert some of
> the fileds in the batch to comp fields so that our
> Accounting system can read it. We are using Micro Focus
> as our Cobol provider.
>
> My question is can I use VB to generate the same comp
> fields as Cobol. I would love to skip running the batch
> through the conversion utility each time.
>
> Thanks in advance....
>
> John



Relevant Pages

  • Re: Converting numbers to comp fields (Cobol)
    ... >How COMP format is implemented depends on the specific COBOL compiler. ... >The MicroFocus COBOL compiler I have on my box is a 12 year old DOS one. ...
    (microsoft.public.vb.general.discussion)
  • Re: Oracle Indicator Variables
    ... Using DEC VMS COBOL and the Oracle PRO*COBOL precompiler we ended up ... making sure to use RTRIM on both sides of the select - this reduced ... >> indicator variabled have to be comp sync. ... > The major issue with the invalid dates and numbers on the inserts is not on ...
    (comp.lang.cobol)
  • Re: Newbie Question
    ... but I am not all that familiar with most of cobol. ... Probably depends on your COBOL and various compiler options. ... A PIC 9 comp will probably be stored in a halfword (I don't know how much the ... I very rarely bother responding to challenge/response systems, ...
    (comp.lang.cobol)
  • Re: Moving display to computational items
    ... > 05 REC-DATE PIC 9COMP. ... > How to move the content of the display to the comp field? ... COBOL compiler being used, including the version, together with the ... Have you tried using the DISPLAY statement before and after ...
    (comp.lang.cobol)