Results 1 to 7 of 7

Thread: Built in Function for Testing Numeric Data

  1. #1
    Code400 Newbie
    Join Date
    Jun 2006
    Location
    Thane Mumbai
    Posts
    2
    Rep Power
    0

    Built in Function for Testing Numeric Data

    We want to Test numeric data in Our application program.We don't want to use indictor in this case .We want to use built in Error functionality of RPGIV. Can we have built in function for Testing numeric data which is having similar functionality of TESTN opcode used in RPG/400?


    Regards,
    Omkar Pradhan

  2. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

  3. #2
    Analyst Zdenko's Avatar
    Join Date
    Jun 2005
    Location
    Ziri, Slovenia
    Age
    57
    Posts
    195
    Rep Power
    1172

    Re: Built in Function for Testing Numeric Data

    LP Zdenko

  4. #3
    Experienced Forum Member arrow483's Avatar
    Join Date
    Oct 2004
    Location
    New Hampshire
    Posts
    1,741
    Rep Power
    4217

    Re: Built in Function for Testing Numeric Data

    Or, you could do this. Not the most efficient code, but simple and works. Note, however, that this allows a decimal point and blanks.


    MONITOR
    EVAL WorkField = %dec(Anyfield:9: )
    ON-ERROR
    ...... do whatever
    ENDMON

  5. #4
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12604

    Re: Built in Function for Testing Numeric Data

    PHP Code:
    ~
          
         
    C                   Eval      Pos = %Check'0123456789' SomeString )
         
    C                   If        Pos > *Zero
          
    Process information
         C                   
    EndIf 
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  6. #5
    Analyst JonBoy's Avatar
    Join Date
    Jun 2005
    Location
    Mississauga, Ontario, Canada
    Posts
    392
    Rep Power
    1892

    Re: Built in Function for Testing Numeric Data

    Quote Originally Posted by arrow483
    Or, you could do this. Not the most efficient code, but simple and works. Note, however, that this allows a decimal point and blanks.


    MONITOR
    ....
    Actually it should be pretty efficient because MONITOR is a relatively lightweight function. It doesn't add much overhead and it is probably a lot more efficient to do it this way than scanning for valid characters and then converting.

  7. #6
    Sr. Product Specialist FaStOnE's Avatar
    Join Date
    Nov 2005
    Location
    Phoenix, AZ
    Age
    51
    Posts
    2,611
    Rep Power
    3991

    Re: Built in Function for Testing Numeric Data

    @#%@#%@#%@#% Jamie... are you going to take that standing up?



    *** GOD I love this place... ***
    -Rick

    _____________________________

    Need a Managed File Transfer Solution -OR- iSeries Encryption?
    GoAnywhere and Crypto Complete by Linoma Software


  8. #7
    Analyst Red's Avatar
    Join Date
    Mar 2005
    Location
    Ontario, Canada
    Posts
    391
    Rep Power
    1446

    Re: Built in Function for Testing Numeric Data

    [QUOTE=FaStOnE]@#%@#%@#%@#% Jamie... are you going to take that standing up?

    QUOTE]

    Not Jamie. He always strikes back. Just the other day he was saying how someone out in Arizona had pissed him off and he was going to hack into their computer in the middle of the night and...
    The again maybe you're not suppose to know about that FastOne

    JUST KIDDING!!!!

  9. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

Facebook Comments


Similar Threads

  1. Add-in for Excel to pull data from AS400
    By jamief in forum Tips for the Iseries/AS400
    Replies: 2
    Last Post: February 3rd, 2012, 09:59 AM
  2. Replies: 0
    Last Post: May 24th, 2006, 03:39 PM
  3. Replies: 8
    Last Post: June 17th, 2005, 02:44 PM
  4. rpgle
    By mohans in forum RPG/RPGLE
    Replies: 4
    Last Post: May 21st, 2005, 11:50 PM
  5. Cpytoimpf
    By joan400 in forum DDS
    Replies: 5
    Last Post: October 26th, 2004, 10:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •