+ Reply to Thread
Results 1 to 5 of 5

Thread: CHGPF Problem with field lengths

  1. #1
    Guest.Visitor Guest

    Default CHGPF Problem with field lengths

    fmoldenhauer wrote: > I am noticing that when I use CHGPF to change a field length, the > field length does not change in any logicals that do not use the > physical files record format (fields specified in DDS). Has anyone > seen a solution to this problem? I'm not sure I understand what you are saying, could you show us the relevant DDS code? Bill

  2. #2
    Guest.Visitor Guest

    Default CHGPF Problem with field lengths

    I guess it's just playing safe and not touching any fields that you explicitly define in the LF. For example, you may have specified the field there because you want to change it from how it was defined in the PF, in which case you probably would not want the CHGPF to overwrite your LF definition. I guess there is the argument that CHGPF could look a bit more closely at the LF source to see how you have defined the field and if it could be changed or left alone, but as it is I do not know of a way to "fix" this. Still, at least you're aware of the matter! That's one up on someone who might assume the LF is changed and then finds out some time later that it's not the case and they've then got big problems.

  3. #3
    Guest.Visitor Guest

    Default CHGPF Problem with field lengths

    The probelem occurs when you have a logical (see TESTL1 sample DDS below) where not all fields from the physical are used. When you change the field length of a field, say FIELD1 from 10 char to 12 char, and use command CHGPF FILE(testpf) SRCFILE(MYLIB/QDDSSRC)to recreate the file, the field length for FIELD1 in the physical (TESTPF) and the 2nd logical (TESTL2) is now 12 characters but in logical TESTL1 it is still 10 characters.
    Code

  4. #4
    Guest.Visitor Guest

    Default CHGPF Problem with field lengths

    The reason that the length of Field1 does not changes for TESTL1 is that it has a different record format name than the physical file. From DB2 UDB for iSeries Database Programming V5R1: When you change, add, and delete fields with the Change Physical File (CHGPF) command, the following relationships exist between the physical and logical files that share the same record format: o When you change the length of a field in a physical file, you will also change the length of the logical file's field. o When you add a field to the physical file, the field is also added to the logical file. o When you delete a field in the physical file, the field will be deleted from the logical file unless there is another dependency in the DDS, such as a keyed field or a select or omit statement.

  5. #5
    Guest.Visitor Guest

    Default CHGPF Problem with field lengths

    I am noticing that when I use CHGPF to change a field length, the field length does not change in any logicals that do not use the physical files record format (fields specified in DDS). Has anyone seen a solution to this problem?

+ Reply to Thread

Similar Threads

  1. CODE Designer PF field lengths
    By Guest.Visitor in forum Programming
    Replies: 2
    Last Post: 11-20-2001, 04:54 AM
  2. CHGPF problem
    By Guest.Visitor in forum Application Software
    Replies: 12
    Last Post: 11-15-2000, 02:01 PM
  3. Problem with CHGPF
    By Guest.Visitor in forum Programming
    Replies: 12
    Last Post: 09-28-2000, 07:30 AM
  4. FTP files with large field lengths
    By Guest.Visitor in forum Analysis
    Replies: 3
    Last Post: 09-22-1999, 11:39 AM
  5. Setting field lengths
    By Guest.Visitor in forum Programming
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts