AS/400 data mapping with CPYFRMIMPF

10 pts.
Tags:
AS/400
Copy From Import File
Copy To Import File
CPYTOIMPF
DB2/400
IBM DB2
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?

Answer Wiki

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

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.

Discuss This Question:  

 
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

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