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...

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

are there any useful c runtime apis that I can call from rpg iv?

700


Q:Hi all,i want accurate answer with code using in built functions.please sent me code as soon as posible. I have program nmed PGM1 which '' RETRIEVE Current production date''should correctly default the production date for the user who is issuing raw materials to the manufacturing.The production date can be different from the celendra date. However, the program does not make the correct adjustment for all manufacturing plants. there is a parameter which determines the production start time e.g. 07:00 if the system time precedes this,the program subtracts one from the celendra day.This work fine when the celendar day starts after production day as it does in England,the system should be adding one to the celendar day during the overlap. unfortunately the program was desined to assumed the celendar day always starts before the production day. Change required in the program: Change the PROGRAM PGM1 to use the new parrameter to decide whether to add or subtract 1 from the celendar day when determining the production date.

1761


1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?

2373


What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?

2519


What is the purpose of record level identifier?

728






what is program status data structure?

1388


Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?

1462


what is the difference between do while and do until?

706


how do I preserve and clean the array?

675


how do I play {insert rpg system here}?

585


can any one help in hawkeye and turnover or any change management system plzzzzz or send the documents to my mail id :gvsp.as4@gmail.com

1968


do you use message subfiles? What are the necessary keywords required coding a message subfile?

687


during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.

755


Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?

1455


explain sflclr, sflend, sfldlt, and sflcsrrrn?

889