How to identify whether the field values are in particular format

2505 pts.
Tags:
AS 400
I have a file field of type 10A. I need to filter those values in that field which has 8 digits as numeric followed by 9th alpha character. 
Example 
78345687J or
12462446D  
Which opcode I can use here to identify this format ? 


Software/Hardware used:
AS400

Answer Wiki

Thanks. We'll let you know when a new response is added.

Use scan opcode check for mismatched value and than XLATE it with the opcode you want in search string give 0 to 9 digits this will result in successful checking of all numeric values give it in the form ’0123….9′ so as to make it character Coz your field is 10 A

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

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
  • philpl1jb
    RPG or RPGLE (RPG IV)? You want a process to determine if the first 8 are numeric and the ninth is character?
    50,505 pointsBadges:
    report
  • TomLiotta
    I need to filter those values... "Filter"? For what? Selection on a report? Displaying on a screen? Deleting from the file? How do you want to "filter"? With SQL? In some RPG program logic? Tom
    125,585 pointsBadges:
    report
  • RamvishakRamesh
    I want to filter those records and write them to a work file. It is RPGLE.
    2,505 pointsBadges:
    report
  • Builtin
    Use scan opcode check for mismatched value and than XLATE it with the opcode you want in search string give 0 to 9 digits this will result in successful checking of all numeric values give it in the form '0123....9' so as to make it character Coz your field is 10A
    100 pointsBadges:
    report
  • Balact88
    %XLATE(from:to:string{:startpos})
    10 pointsBadges:
    report
  • philpl1jb
    %CHECK might be useful %CHECK compare-value : data-to-search { : start-position } First position in the searched-data that contains a character not in the list of the characters in the compare value. If %check('1234567890' : %SUBST(MYSTRING:1:8) ) = 0 AND %check('ABCDEFGHIJKLMNOPQRSTUVWXYZ' : %SUBST(MYSTRING:9:1) ) = 0
    50,505 pointsBadges:
    report
  • philpl1jb
    Please restate the question / What you have acheived. Show your code. What do you still need to do.
    50,505 pointsBadges:
    report

Forgot Password

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

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

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

Thanks! We'll email you when relevant content is added and updated.

Following