Tony Furnivall wrote:
>>Cynthia Redick ([log in to unmask]) wrote:
>>: We are looking for a "C" language routine that would format a c
data ty=
>>: pe in
>>: such a way that it could be used to update a cobol comp-3 field,
or an =
>>: image
>>: P(x) field. Thanks in advance!
>>
>
And Bary kindly supplied a lot of C code (snipped)
and I repeat my ealier (private) reply to Cynthia:
Why not a COBOL routine?
LINKAGE SECTION
01 C-PARM PIC S9(9) COMP. ;Putatively an integer
01 COBOL-PARM PIC S9(9) COMP-3. ;A packed variable
PROCEDURE DIVISION
<stuff>
MOVE C-PARM TO COBOL-PARM.
I believe that event though an S9(9) COMP and a C int are both 32 bit
(or sign+31 bit) integers, COBOL still relies on the number of digits
listed in the
PICTURE. Therefore, the full range of a signed C int extends to 10
digits
and can't be fully represented in COBOL-which will truncate the item
unless care is taken with ON SIZE ERROR phrases.
--
Rick Brooks
Database Systems Services Legacy Team Leader
Prevue Networks, Inc. [log in to unmask]
See what's on! www.prevue.com