On Sat, 2013-02-16 at 16:14 -0500, zMan wrote:
> If this was supposed to be asking "What is it that's awkward to do in
> COBOL?", try calculating the offset between two data elements.
It's possible. Not pretty, but IMO beats resorting to an assembly
language subroutine.
01 POINTER-ARITHMETIC.
05 FIELD1-ADDRESS POINTER.
05 FIELD1-ADDRESSD REDEFINES FIELD1-ADDRESS
PIC 9(8) COMP-5.
05 FIELD2-ADDRESS POINTER.
05 FIELD2-ADDRESSD REDEFINES FIELD2-ADDRESS
PIC 9(8) COMP-5.
SET FIELD1-ADDRESS TO ADDRESS OF FIELD1.
SET FIELD2-ADDRESS TO ADDRESS OF FIELD2.
COMPUTE FIELD-OFFSET = FIELD2-ADDRESSD - FIELD1-ADDRESSD.
--
David Andrews
A. Duda & Sons, Inc.
[email protected]
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN