How to get only unique records from a file which contains duplicate data using CPYF command ?

Example : FILEA has duplicate records and FILEB is a UNIQUE defined.... and I want to get the data from FILEA to FILEB by eliminating all the duplicate records...

Answers were Sorted based on User's Feedback



How to get only unique records from a file which contains duplicate data using CPYF command ? Exa..

Answer / murali

First read PF and use pass data to the key fields of LF and check if record already find then skip if not then add record to LF.

Is This Answer Correct ?    0 Yes 0 No

How to get only unique records from a file which contains duplicate data using CPYF command ? Exa..

Answer / sandey243

There is an option in CPYF command which says " Error Allowed", making that as *NOMAX will trigger IGNORE option instead of CANCEL in CPYF processing; whenever there is duplicate record encountered.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More RPG400 Interview Questions

HOW TO DEBUG A BATCH JOB WHEN IT IS IN MESSAGEWAIT(MSWG) STATUS.I KNOW THE STEPS FOR BATCH DEBUGGING,BUT IM CONFUSING WITH WHEN WE SUBMIT ANY JOB FOR BATCH DEBUG WE PUT IN HELD STATE.SO HERE ALSO DO SAME THING OR ANY OTHER WAY,PLEASE HELP ME....

1 Answers   HCL, Mind Tree,


Can anybody tell me, does CL/400 handle LEVEL check while running the CL program....? plz share your experience...

4 Answers  


two types of read performed in dataqueue?????

4 Answers   CTS,


HI, 1: WHAT IS THE FUNCTION OF %KDS?WITH PROGRAMMING CODES EXAMPLE 2: WHAT IS THE FUNCTION OF Z-ADD AND Z-SUB ? WITH PROGRAMMING CODES EXAMPLE

1 Answers   IBM,


Can we possible to key with the date field?

1 Answers   IBM,






I have to change a program. This program is calling a subroutine mor than 100times within it. so will it have any performance issue? if yes than what changes i can make. Thanx for ur valuable answer.

2 Answers  


How would display prime numbers using CL program?

0 Answers   Hexaware,


Can we used ovrdbf command after the opnqry file if yes then What will be out put of your program?

4 Answers   IBM,


How to code Page up and Page down in RPG for Single page subfile without using ROLLUP/ROLLDOWN in DSPF ?

3 Answers   HCL,


Hi, Can anybody give me real sinario for SFLRCDNBR?with example?

2 Answers  


Let?s consider a variable X of length 20. Move value ?ABC? to it.How to determine how many characters does X have?

1 Answers  


Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?

1 Answers  


Categories