CHECK & SCAN IN AS/400

1485 pts.
Tags:
AS/400
RPG
What would be output of follwing calculations in rpg/400 code? XYZ SCAN ABCXYZ RESULT? XYZ CHECK ABCXYZ RESLT1? I mean to say what would be the values of result fields in above code.

Answer Wiki

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

Hi,

Results would be :-

XYZ SCAN ABCXYZ RESULT? = 4
(Factor 1 String is found starting at position 4 of Factor 2 String)

XYZ CHECK ABCXYZ RESLT1? = 1
(First position of Factor 2 String is not found in Factor 1 String)

You can easily try this sort of code out, just create a small program like this :-

<pre>
C ‘XYZ’ SCAN ‘ABCXYZ’ RES1 3 0
C ‘XYZ’ CHECK ‘ABCXYZ’ RES2 3 0
C RES1 DSPLY
C RES2 DSPLY
C MOVE *ON *INLR
C RETURN
</pre>

Regards,

Martin Gilbert.

Discuss This Question:  

 
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

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