250 pts.
 RPG %SCAN Question
I am unable to get all the scanned records for a string in a file. For example, my file itemmast has 1000 records in it. When I use Query 400 and search for 'cable' I get 50 records with the word cable in various positions of a 30 character field. When I use the statement "x = %scan (xcust_pn : cpt#:1);" in RPG I get 15 records. If I replace the field xcust_pn with 'cable' I get all 50 records. What am I missing to get all 50 records in RPG using the %scan and the field xcust_pn. Thank You, Douglas L. McDuffie

Software/Hardware used:
ASKED: June 5, 2008  4:18 PM
UPDATED: June 5, 2008  5:14 PM

Answer Wiki:
Check your field len... If it is more than 5, then you scan for "CABLE " instead of "CABLE" If you still want to use a variable name, use X = %scan (%TRIM(xcust_pn) : cpt#:1) to get your result. Good luck ! _______________________ DanTheMan
Last Wiki Answer Submitted:  June 5, 2008  5:14 pm  by  DanTheMan 2   395 pts.
All Answer Wiki Contributors:  DanTheMan 2   395 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _