identification division.
program-id. UNSIGNED.
environment division.
data division.
working-storage section.
01 ws-signed pic s9(8) comp-3 value 12345.
01 ws-unsigned pic 9(8) comp-3 value 12345.
procedure division.
display 'signed ' ws-signed ' '
function hex-of(ws-signed)
display 'unsigned ' ws-unsigned ' '
function hex-of(ws-unsigned)
goback
.
signed 00012345 000012345C
unsigned 00012345 000012345F
On Fri, 2 May 2025 at 18:46, Andrew Rowley <
[email protected]> wrote:
> On 2/05/2025 1:22 pm, Tom Ross wrote:
> > Hmm, if you don't want a sign, why have an 'S' in the PICTURE clause?
> > Signed:
> > 05 SIGNED-ITEM PIC S9(x) COMP-3.
> > Unsigned:
> > 05 UNSIGNED-ITEM PIC 9(x) COMP-3.
> >
> > I guess I am too close to COBOL, but signed and unsigned are easy in
> COBOL!
>
> What's the difference in the representation?
> Is unsigned 1234:
> 0x01234F
> or
> 0x001234
>
> --
> Andrew Rowley
> Black Hill Software
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN