× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Bug in opcode TESTN!!!
  • From: NigsRpgId@xxxxxxx
  • Date: Wed, 28 Apr 1999 07:33:41 EDT


Vijosh, you are correct,  the manual says the following for TESTN:

"To be considered numeric, each character in the field, except the low-order 
character, must contain a hexadecimal F zone and a digit (0 through 9).  The 
low-order character is numeric if it contains a hexadecimal C, hexadecimal D, 
or hexadecimal F zone, and a digit (0 through 9).  Note that the alphabetic 
characters J through R, should they appear in the low-order position of a 
field, are treated as negative numbers by TESTN. "

It also says for the indicator in Positions 71 and 72:  Either the result 
field contains numeric characters, or it contains a 1-character field that 
consists of a letter from A to R.

I guess this means you will need to do further or different testing if the 
data is likely to meet these conditions.

Rgds
Nigel.

In a message dated 4/28/99 10:04:39 AM GMT Daylight Time, 
VijoshA@alfuttaim.co.ae writes:

<< 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?
  >>

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.