Duplicate value using RPG

145 pts.
Tags:
AS/400
How to read the second duplicate value using RPG?

Answer Wiki

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

Discuss This Question: 3  Replies

 
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
  • deepu9321
    Am not sure, whether you can directly Read the Second duplicate Record. But, You can set the Pointer using SETLL and you can read the records sequentially(Second Read Record would be the Required Second duplicate).
    KFLD      SETLL        FILENM
    KFLD      READE       FILENM
    Or, If you want to Read the Last Duplicate Record, You can set the pointer using SETGT and read the Prior Records using READP
    KFLD      SETGT        FILENM
    KFLD      READP       FILENM
    Pradeep.
    4,290 pointsBadges:
    report
  • TomLiotta
    Issue the READ instruction twice after positioning to the desired value with SETLL. If the value from the second READ matches the value that you saved from the first READ, you know you have the second duplicate. You could also use CHAIN instead of SETLL and the first READ. A CHAIN instruction can do both functions in a single operation. Then issue a READ and compare its value to the one you saved from CHAIN. Again, if it matches, you know you have read the second of duplicate values. Tom
    125,585 pointsBadges:
    report
  • Splat
    Input primary, level indicators, and a counter.
    7,665 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