Store data in physical file

350 pts.
Tags:
AS/400
AS400 physical file
Data storage management
Physical File
i have a pf name is emp,in this not unique key,so i am enter duplicates records in that pf,now i want to find out the what records are repeated eno that record find out after store into other file,how to do

Software/Hardware used:
software

Answer Wiki

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

Is this a one-time check?
Is there only one program doing the update?
*
If it is a one time check, you can do a summary sort and get counts by whatever field(s) you are using to check for uniqueness.
Else, create an LF with your key.
Write a routine that will check the file after the update. This routine can either do an SQL COUNT(*) or CHAIN & READE, to see how many records have the value you just had in the record that was written/updated.
Now if there is only one program doing the update, insert this routine in that program.
If there are multiple programs doing the update, create a trigger program with this routine.

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
  • madhuchowdary
    but one record is repeated ,that records only copy to other file,if record come one time that records leave it,which record is repeated in that records only copy to other file,same process continue till end of the file,how do it in sql i try to do select * from emp where count(eno)>1 order by eno but count is not working
    350 pointsBadges:
    report
  • BigKat
    try with counts as(select eno, count(*) as rcds from emp group by eno), enos as (select eno from counts where rcds > 1) select * from emp where eno in (select * from enos)
    8,010 pointsBadges:
    report
  • BigKat
    with counts as(select eno, count(*) as rcds from emp group by eno),
    enos as (select eno from counts where rcds > 1)
    select * from emp where eno in (select * from enos)
    order by eno
    
    8,010 pointsBadges:
    report
  • RonKoontz
    are them time stamped? If so use a logical and sort it. Then use SQL or a program to delete/change the ones you want.
    1,780 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