|
Vijosh, Because of the way RPG handles signed numbers, the right-most character of the field may contain the EBCDIC representation of A-R and still be considered numeric, since thses are the same representations as signed (+or-) digits 0-9. I would suggest a constant definition of '0123456789' and use the CHECK opcode against your field. Sue -----Original Message----- From: Vijosh A [SMTP:VijoshA@alfuttaim.co.ae] Sent: Wednesday, April 28, 1999 3:31 AM To: 'Forum RPG' Subject: Bug in opcode TESTN!!! Hi, I have come across the following problem while using the opcode TESTN. Prob: While testing a character field entry for Numeric, it so happens that if all the contents of the field are numbers except the last one which may be an alphabet, still TESTN shows it as numeric. Possible Reason : After doing some trials on this, I came to the conclusion that, in the case of a negative number DB2 stores the negative sign in the PF with a character at the end which indicates the sign. E.g.: },R,H...etc. So if this alphabet figures in the earlier mentioned value given to TESTN then it shows it as Numeric. For testing this you may add values -1...-9 into a database and then do a DSPPFM. Question: I wanted to know whether the reason for wrong result given by TESTN is the same as the one I have mentioned above or is there something else to it. For solving my problem I had to write certain extra lines of code to avoid TESTN. Is there any solution which will avoid my extra lines of code, and do it with one opcode? Thanks & Regards Vijosh * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 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-2025 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.