|
Try edit code J. When an zoned decimal number is displayed in character format, the low order digit shows up as a character value between J and R plus one character. In packed and zoned decimal numeric values on the AS/400, the sign is stored in the low order digit. If the whole number is zoned and positive, then the upper four bits of the low-order byte are 1111 - hex F. If the whole number is zoned and negative, then the upper four bits of the low-order byte are 1110 - hex E. For all other positions in the number, the high-order four bits contain 1111 (hex F) and the digit value is stored in the low order 4 bits. Why J through R plus one character? Because the hex value for negative 1 is E1. When printed, hex E1 is capital J. Minus 2 is hex E2 and that is hex for capital K. Capital R is coded hex E9. Why don't the other positions print as alpha letters? No, there is no sign bits above the low-order byte. The bytes above the low order one are coded F1 and F2 and F3 and these always print as the digits 1, 2, and 3. There are never hex Es up here. What does minus 25 look like? In a 4 digit field it will look like F0, F0, F2, E5, and will print as zero zero two capital N. What about this mystery "one extra character"? Hex E0 isn't printable. Does packed do this? No. If you try to print packed decimal without converting it to zoned decimal, the hex characters usually aren't printable. For example, let's look at minus twenty five again. It will look like X'00 02 5E'. Normally hex 00 is a null or fault code. Hex 02 is something like start of block or end of block. And hex 5E is something in the special characters. Why should edit code J work? Edit code J puts commas between every three digits left of the decimal, places a decimal point and uses the trailing dash as a minus sign instead of no sign or CR. I hope that leads to a solution. Richard Jackson mailto:richardjackson@richardjackson.net http://www.richardjacksonltd.com Voice: 1 (303) 808-8058 Fax: 1 (303) 663-4325 -----Original Message----- From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On Behalf Of Justin Kiteley Sent: Friday, September 08, 2000 1:50 PM To: RPG400-L@midrange.com Subject: Re: Hex codes showing up when field minus used. I've tried all the numeric signed edit codes. I keep getting the hex values. "George J. Vitek" wrote: > > Use an edit code when displaying or printing the number. > > Justin wrote: > > > Hi there! > > > > Quick question, hope somebody has the answer. I have an 11.3 input/output > > field in a display file. It is used for positive and negative quantity > > adjustments. The only check I have on the field is FE and there are no edit > > codes. The problem occurs when the field minus key is used to input a > > negative quantity. Instead of showing for example a 25- I get a 25}. When > > I use CHECK(RB) and put in 25- I get a 2N, or for 14- I get a 1M. These > > seem like hex codes. The actual program data I'm getting from the fields is > > correct, but the hex interpretation is annoying and possibly confusing to > > the user. Curious if anyone's had this problem. > > > > Justin Kiteley > > justin@asiwms.com > > www.asiwms.com > > > > +--- > > | This is the RPG/400 Mailing List! > > | To submit a new message, send your mail to RPG400-L@midrange.com. > > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > > | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. > > | Questions should be directed to the list owner/operator: david@midrange.com > > +--- > > +--- > | This is the RPG/400 Mailing List! > | To submit a new message, send your mail to RPG400-L@midrange.com. > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: david@midrange.com > +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | 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.