5 pts.
 AS/400
How to change the field name in PF?

Software/Hardware used:
ASKED: October 12, 2012  12:19 PM
UPDATED: October 12, 2012  12:58 PM

Answer Wiki:
Thank you for visiting ITKE. We are happy to help you with solving specific IT questions, but need as much information as possible to do so. Let us know about the problem you are trying to solve, how you are approaching it and what work you’ve done so far, and we can help guide you in the right direction.
Last Wiki Answer Submitted:  May 13, 2013  9:57 pm  by  Chris Leonard   2,620 pts.
All Answer Wiki Contributors:  Chris Leonard   2,620 pts. , Ben Rubenstein   2,060 pts. , Michael Tidmarsh   11,410 pts. , CharlieBrowne   32,945 pts. , avslxmnryn   5 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

Sure, this might be a homework or Inverview question but it might not…
 
Warning this may have an adverse impact on existing programs, queries and other uses for this file.
 
1. Change the “DDS” source
 
2. Use the CHGPF prompt it and identify source – this command will change the file and logicals that use the file format
 
or
 
Use the SQL Alter Table Command
 

 44,220 pts.

 

Changing the name of a field is not very different from creating a new file. I would probably use CREATE TABLE … AS … WITH DATA. I don’t know that using CHGPF has any way to retain data from the renamed field. — Tom

 108,330 pts.

 

I would probably create a new field with either DDS or SQL, populate it with data on “old” field, then delete the old field.
Depending on requirement, creating a LF or SQL view might also work, although this doesn’t actually change the PF

 3,115 pts.