Re: Newbie Question
- From: "Michael Mattias" <michael.mattias@xxxxxxx>
- Date: Wed, 31 May 2006 16:50:30 GMT
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.
I apologize if this is a no brainer.
MOVE= assignment
MOVE A TO B (cobol) ===> [ LET] B = A (BASIC)
DIM VAR1 AS LONG, VAR2 AS LONG
VAR1 = VAR2
WARNING: a long integer will not hold Var2, where PIC 9(10) specifies a
numeric data item with ten digits before the decimal. You may need to go to
a SINGLE or DOUBLE here.
I say "may" because.......
WARNING 2: the MOVE statement shown is also invalid, since a PIC 9 COMP (1
digit integer) won't hold it either. If this is the actual code and not
just an example you made up for posting purposes, it looks as though someone
has done something "cute" and if you don't know COBOL you are in for a VERY
long day.
BUT.... if you want to learn about COBOL datatypes, download my free text
and graphics tutorial at http://www.flexus.com/download.html, get file
COBDATA.ZIP
If you want to learn more specifically about using COBOL-created data in
non-COBOL programs, read the free tutorial on my web site at
http://www.talsystems.com, click on "Tech Corner" and then select file
"C2IEEE.HTML"
Of course, there's always the option to engage outside assistance from
someone who knows both BASIC and COBOL....
--
Michael Mattias
Tal Systems, Inc.
Racine WI
mmattias@xxxxxxxxxxxxxx
.
- Follow-Ups:
- Re: Newbie Question
- From: Binyamin Dissen
- Re: Newbie Question
- From: Oliver Wong
- Re: Newbie Question
- References:
- Newbie Question
- From: the_tragic_hip
- Newbie Question
- Prev by Date: Re: PIC P put to real use
- Next by Date: Re: Newbie Question
- Previous by thread: Re: Newbie Question
- Next by thread: Re: Newbie Question
- Index(es):
Relevant Pages
|