RPG %SCAN Question

280 pts.
Tags:
AS/400 Query
RPG
RPG IV
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: June 5, 2008  4:18 PM
UPDATED: June 5, 2008  5:14 PM

Answer Wiki

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

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

Discuss This Question: 1  Reply

 
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
  • DLM2007
    [...] DLM2007 Koohiisan Nanopit [...]
    0 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