Re: Newbie Question



On 31 May 2006 08:27:26 -0700 the_tragic_hip@xxxxxxxxx wrote:

:>I had this small cobol routine dropped on my desk and need to convert
:>it into a vb app, but I am not all that familiar with most of cobol. I
:>can read most of it and decipher what is going on, but having trouble
:>with this move.

:>var1 pic 9 comp.
:>var2 pic 9(10)

:>If var2 had the value of 138755482 and

:>MOVE VAR2 TO VAR1 is executed, what is actually stored in var1.

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
COBOL standard allows the size of a COMP to be implementer defined).

It may take the last digit and store it as binary.

It may take the whole number, convert it to binary, truncate to halfword and
store that (IBM TRUNC option).

The best thing is too look at the generated code or try it out with the same
compiler options and see what happens.

:>I apologize if this is a no brainer.

Not at all.

--
Binyamin Dissen <bdissen@xxxxxxxxxxxxxxxxxx>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
.



Relevant Pages

  • Re: Converting numbers to comp fields (Cobol)
    ... Doesn't really matter since COMP is a COBOL thing, ... 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: 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: Mainframe programming vs the Web
    ... I believe that I wrote it in assembler, not COBOL - but it could have ... I very rarely bother responding to challenge/response systems, ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: Sha-1 on cobol2
    ... Any sugestions? ... Does COBOL have shift instructions? ... I very rarely bother responding to challenge/response systems, ...
    (comp.lang.cobol)