|
It appears that the problem is that binary 4,0 is a two-byte field, which by definition limits the maximum decimal value to 9999. The field's uninitialized state of X'4040' (blanks because it is a data structure subfield) is 16448 decimal. The high-order 1 is being dropped, resulting in decimal 6448. Here is the relevant text from the ILE-RPG reference manual (works the same in "classic" RPG/400). Every ... binary format is assigned a field length (number of digits) by the compiler. A length of 4 is assigned to a 2-byte binary field;...the highest decimal value that can be assigned to a 2-byte binary field is 9999... This discussion assumes zero decimal positions.... Because a 2-byte field in binary format is converted by the compiler to a decimal field with 1 to 4 digits, the input value may be too large. If it is, the leftmost digit of the number is dropped. For example, if a four digit binary input field has a binary value of hexadecimal 6000, the compiler converts this to 24 576 in decimal. The 2 is dropped and the result is 4576.... you can avoid this conversion problem by defining integer fields instead of binary fields. Mel Rothman IBM AS/400 Custom Technology Center 3605 Highway 52 North Rochester, MN 55901 -----Original Message----- From: Buck Calabro/commsoft [mailto:mcalabro@commsoft.net] Sent: Friday, January 22, 1999 9:25 AM To: RPG400-L@midrange.com Subject: RE: RPG400 to RPG IV conversion - INFDS Jon Erikson wrote: >They compiled just fine, but when you actually >reference them, the program fails with an MCH1210, >(Receiver value too small to hold result) and >RNQ0103, (The target for a numeric operation is >too small to hold the result (C G D F)). > >Here is the DS source & Dumped values: > >0025.00 D Prnt DS >0026.00 D Curln 367 368b 0 >+++++++++++++++++++++ >PRNT DS > CURLN BIN(4,0) 6448. '4040'X ...snip, snip * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the RPG/400 Discussion Mailing List! To submit a new * * message, send your mail to "RPG400-L@midrange.com". To unsubscribe * * from this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe RPG400-L' in the body of your message. Questions should * * be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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.