HP3000-L Archives

October 1997, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Rick Brooks <[log in to unmask]>
Reply To:
Rick Brooks <[log in to unmask]>
Date:
Wed, 15 Oct 1997 11:13:39 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (41 lines)
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

ATOM RSS1 RSS2