Single record selection out of multiple records by using CPYF command

280 pts.
Tags:
AS/400
AS400 CLP
CPYF

In my physical file i have multiple records with same data. Now i want to use the CPYF command to copy only single record which was last updated in the file. I searched all the options in CPYF command but i didn't get anything related to it. Please advice on this. I am using this procedure in CL program



Software/Hardware used:
As400

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: 4  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
  • philpl1jb

    CPYF doesn't have a feature like that.

    If you know the Relative Record Number of the record that you want to copy then CPYF can be used.

    49,980 pointsBadges:
    report
  • philpl1jb

    If there is an update time stamp, maybe you could use Sql to copy the record you want.

    49,980 pointsBadges:
    report
  • CharlieBrowne
    Use SQL with the3 MAX keyword for the timestamp field
    OR
    Create a LF with the TIMESTAMP in the key (Descending)., Then use CPYF and say NBRRCDS(1)
    41,380 pointsBadges:
    report
  • WoodEngineer
    SQL is your best bet if there is an update date in your record.

    Another option is to delete the record and re-write so that it is the last record in the file.  If you do this, be sure the file is not re-using deleted records.
    6,680 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