I would guess the intermediate result field used by the compiler was 8,0 to
allow for overflow.
Paul
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Buzz
Fenner
Sent: Wednesday, August 12, 2020 2:26 PM
To: Discussion RPG (rpg400-l@xxxxxxxxxxxxxxxxxx)
<rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Odd %editc Behavior
Noticed an interesting result while using the edit character BIF and
wondered if anyone could explain it. BTW, V7R3M0.
Here's the relevant code; the field chkNbr is in a DB file defined as
packed(7) & beginChk# = 117156 at the time the if statement gets evaluated:
dcl-s beginChK# like(chkNbr);
dcl-c IOD_VOIDED_COMMENT 'IOD VOIDED #';
if pIODGCR = IOD;
trnDsc = IOD_VOIDED_COMMENT + %editc(beginChk#:'X') + '-'
+ %editc(beginChk# + 4:'X');
trnCde = 3;
else;
trnCde = 6;
trnDsc = GCR_VOIDED_COMMENT + %editc(beginChk#:'X') + '-'
+ %editc(beginChk# + 4:'X');
endif;
The resulting value for trnDsc was this (plus a leading date):
120/07/07 IOD VOIDED #0117156-00117160
Notice that the first edited check number is 7 characters and the second
edited check number is 8 characters. Why?
--
Buzz Fenner, Information Systems Administrator
+1 (870) 930.3374
+bfenner@xxxxxxxxxxxxxxxx<mailto:bfenner@xxxxxxxxxxxxxxxx>
City Water and Light of Jonesboro
Office: +1 (870) 935.5581 / Fax: +1 (870) 930.3301
Physical: 400 East Monroe Ave., Jonesboro, AR 72401
Mailing: PO Box 1289, Jonesboro, AR 72403-1289
This e-mail message may contain confidential or legally privileged
information and is intended only for the use of the intended recipient(s).
Any unauthorized disclosure, dissemination, distribution, copying or the
taking of any action in reliance on the information herein is prohibited.
E-mails are not secure and cannot be guaranteed to be error free as they can
be intercepted, amended, or contain viruses. Anyone who communicates with us
by e-mail is deemed to have accepted these risks. City Water and Light of
Jonesboro is not responsible for errors or omissions in this message and
denies any responsibility for any damage arising from the use of e-mail. Any
opinion and other statement contained in this message and any attachment are
solely those of the author and do not necessarily represent those of the
company.
________________________________
This electronic mail transmission may contain confidential or privileged
information. If you believe that you have received this message in error,
please notify the sender by reply transmission and delete the message
without copying or disclosing it.
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.