Re: Newbie Question



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



.



Relevant Pages

  • Re: Newbie Question
    ... but I am not all that familiar with most of cobol. ... var2 pic 9 ... MOVE VAR2 TO VAR1 is executed, what is actually stored in var1. ... loop through it digit by digit, ...
    (comp.lang.cobol)
  • Re: Newbie Question
    ... can read most of it and decipher what is going on, ... var2 pic 9 ... MOVE VAR2 TO VAR1 is executed, what is actually stored in var1. ... What version of CoBOL are you using? ...
    (comp.lang.cobol)
  • Re: [PHP] string as file
    ... This is an example of $var1 and $var2. ... I think that neither you nor Greg understands what I'm looking for. ... Use regular expressions or straight string replacements - that's the best way to implement mail-merge type behaviour. ...
    (php.general)
  • Re: Newbie Question
    ... var2 pic 9 ... MOVE VAR2 TO VAR1 is executed, what is actually stored in var1. ... loop through it digit by digit, ... Converting the string into a long might get you into problems though. ...
    (comp.lang.cobol)
  • Re: Form variable in query
    ... Dim var1 As Date ... Dim var2 As Date ... Public Function MyVar1() As Date ...
    (microsoft.public.access.queries)