Ask the Expert

'TESTN ' RPG command is not working

'TESTN ' RPG command is to indicate that char value is present in variable. In RPG400 this command is not working if the char value occurs in the last position. For example: Assume Field1(5)='123F4' then TESTN command works fine. Whereas if field1(5)='1234F' then TESTN command is not working.

This Operations code has never worked properly. I use xlate to check for numerics:

 
D CN              C                   CONST('0123456789')
D CB              C                   CONST('          ')
...
C     CN:CB         XLATE     TA0COD        WKCOD  
C     TA0COD        IfNe      WKCOD   
...Not a numeric             
C                   Else
...Numeric
C                   End 

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.


This was first published in May 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: