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 ILE RPG Reference manual. 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.
  • 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
    54,090 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.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: