10 pts.
 AS/400 data mapping with CPYFRMIMPF
We have an application in which we need to expand the size of several fields within the record, ie the Amount field need to be larger. In the past I would create DDS for the new expanded file, create the file, then write an RPG or Cobol program to copy the data from the old file to the new expanded file. I was looking to see if the CPYTOIMPF/CPYFRMIMPF would accomplish the same task without having to write a program to move each file. The number of fields would be the same and in the same order within the record. I'm not sure if I could use this command to copy directly from the old file to the new file, or if I would need to copy it out to a Stream delimited file, then copy it back into the new file structure. Any recommendations?

Software/Hardware used:
ASKED: May 7, 2009  2:10 AM
UPDATED: May 7, 2009  1:02 PM

Answer Wiki:
Gary, You still need to chang the DDS for the file. But then use CHGPF. This will create a file according to the new specs, and will also keep any existing data. (As long as you do not change the field names) You will however still need to recompile every program that uses this file and/or any logicals on this physical. HTH, Rudolf >>>>>>>>>>> Hi, Make sure you take a backup copy before you do the CHGPF in case it doesn't work correctly. Normally shouldn't be any problem, but you never know.... Regards, Martin Gilbert.
Last Wiki Answer Submitted:  May 7, 2009  9:51 am  by  r.otto   810 pts.
All Answer Wiki Contributors:  r.otto   810 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _