RPG %SCAN Question
110 pts.
0
Q:
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
ASKED: Jun 5 2008  4:18 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
395 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
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 Answered: Jun 5 2008  5:14 PM GMT by DanTheMan 2   395 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0