195 pts.
 How to identify whether the field values are in particular format
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
ASKED: Jan 31, 2012  6:12 PM GMT
UPDATED: March 17, 2012  5:19:55 AM GMT
100 pts.

Answer Wiki:
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
Last Wiki Answer Submitted:  Feb 1, 2012  3:55 AM (GMT)  by  Builtin   100 pts.
To see other answers submitted to the Answer Wiki View Answer History.
Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _




 

RPG or RPGLE (RPG IV)?
You want a process to determine if the first 8 are numeric and the ninth is character?

 36,420 pts.

 

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

 66,935 pts.

 

I want to filter those records and write them to a work file. It is RPGLE.

 195 pts.

 

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 pts.

 

%XLATE(from:to:string{:startpos})

 10 pts.

 

%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

 36,420 pts.

 

Please restate the question / What you have acheived. Show your code. What do you still need to do.

 36,420 pts.