You can increase the speed of your CPYF replace by changing all of the logical files that are based on the destination physical file to MAINT(*REBLD) and then changing them back to MAINT(*IMMED) after the CPYF completes. I recently did this on a file that had a whopping 55 logicals and the speed increase of 2000% was so large that I just had to let everyone know how I did it.
Code
/*copy FILEA to FILEB with replace*/
CHGLF FILE(lib/logicalfile) MAINT(*REBLD) /*do for each logical that is based on physical file of destination fileb for cpyf*/
CPYF FILE(fileA) TOFILE(fileb) MBROPT(*REPLACE) /*wow this is really fast now*/
CHGLF FILE(lib/logicalfile) MAINT(*IMMED) /*do for each logical that was changed above*/
==================================
MORE INFORMATION ON THIS TOPIC
==================================
The Best Web Links: tips, tutorials and more.
Ask your programming questions--or help out your peers by answering them--in our live discussion forums.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.