|
OK
But why is 0 + 81 = -5915 ???
-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx [mailto:
cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S Waterbury
Sent: Friday, July 20, 2012 12:57 PM
To: COBOL Programming on the iSeries/AS400
Subject: Re: [COBOL400-L] variable length field - how to rewrite a record
Joel:
COMP-4 means binary. PIC S9(4) is equivalent to PIC S9999 ... that's
four decimal digits ... that fits into two bytes in binary ... aka. a
halfword.
HTH,
Mark S. Waterbury
> On 7/20/2012 1:11 PM, Stone, Joel wrote:
coming from?? I think it should show 81, correct?From COPY statement:
06 A0403X-MEMO-TEXT.
(Variable length field)
49 A0403X-MEMO-TEXT-LENGTH
PIC S9(4) COMP-4.
49 A0403X-MEMO-TEXT-DATA
PIC X(1619).
A0403X MEMO TEXT
In debug, the length field (comp-4) is zero
I have the following line incrementing the length:
add 81 to A0403X-MEMO-TEXT-LENGTH
in debug after this add stmt executes, the value is shown as
Variable . . . . . . . . . . . . . . . : 49 A0403X-MEMO-TEXT-LENGTH
Type . . . . . . . . . . . . . . . . : SIGNED BINARY
Length . . . . . . . . . . . . . . . : 2
' -5915'
How do I properly increment the length of the field?? Where is -5915
Skyscan service.
Should the 81 be coded as x'00000081' or x'00000051' or something else???
I tried
add X'00000051' to A0403X-MEMO-TEXT-LENGTH
but get compiler error
234 MSGID: LBL1447 SEVERITY: 30 SEQNBR: 022100
Message . . . . : Statement incomplete; last valid item found
before 'X"00000051"'. Statement ignored.
234 MSGID: LBL0018 SEVERITY: 00 SEQNBR: 022100
Message . . . . : Input ignored starting with 'X"00000051"'.
Thanks
______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing
list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.
________________________________________________________________________
This inbound email has been scanned for all viruses by the MessageLabs
SkyScan
service.
________________________________________________________________________
______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs
Skyscan service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
--
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing
list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.