Help with scan

45 pts.
Tags:
RPG
Strings
Please could you submit a sample RPG program to scan specific letters in a string that contains numbers, letters and special characters. Thank you!

Answer Wiki

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

Examples of all operation codes are in the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/books/sc092508.pdf”>ILE RPG Reference manual</a>. That’s where we look up every question like this.

Tom

====================================================

I use this routine for lookup requests on entry fields. The program called is a popup window of valid entries.

d POS S 3 0

C EVAL POS = %SCAN(‘?’: ECUST )
C IF POS <> 0
c call ‘RVEH600W7′
C PARM ECUST
C END

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
  • philpl1jb
    Here are some samples C EVAL findThis = 'bat' C Eval findIn = 'battery' C findThis Scan FindIn C if %found C** do something here C endif C EVAL findThis = 'bat' C Eval findIn = 'battery' C findThis Scan FindIn Location C if %found and Location = 1 C** do something here C endif C EVAL findThis = 'bat' C Eval findIn = 'battery' C Eval Location = %SCAN(findThis:findIn) C if Location = 1 C** do something here C endif But if find in were 'bottle' or 'Battery' string 'bot' would not be found
    49,850 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