HP3000-L Archives

June 1997, Week 2

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:
Mark Landin <[log in to unmask]>
Reply To:
Mark Landin <[log in to unmask]>
Date:
Fri, 13 Jun 1997 13:42:02 GMT
Content-Type:
Text/Plain
Parts/Attachments:
Text/Plain (34 lines)
In article <[log in to unmask]>, [log in to unmask] says...
>
>I have a COBOL subroutine that, I wrote about seven or eight years ago.
>It's LINKAGE is:
>
>Abrv Example:
>
>01 LINIKAGE-AREA.
>   02 DATA-ITEM-1  PIC X(20).
>   02 DATA-ITEM-2  PIC X(80).
>   02 DATA-ITEM-3  PIC S9(4) COMP.
>   02 DATA-ITEM-4  PIC XX.
>
>
>OK, I haven't been able to look at the "C" code, and I don't know "C"
>very well, YET! The "C" prog'r doesn't know the "HP" very well, so he
>asked me the following question:
>
>******
>You passed me all the data correctly, I got Item-1, Item-2, and Item-4
>exactly the way I expected to get'em, but Item-3 came to me like this
>"000}" --- Why do ya think that is?
>******

Since item 3 is defined as signed (S9(4)), the sign bit is overlayed onto the
last bit of the number. 3000ers are very familiar with reading "000}" as a
signed 0.

--
Mark Landin
T. D. Williamson, Inc.
UNIX Sys. Admin
"If you take the smooth, you gotta take the rough" -- Rob Halford

ATOM RSS1 RSS2