Logo: TUG TORONTO USERS GROUP for Midrange Systems
TUG
e -server magazine

March 1997: Volume 12, Number 6


"New and Improved" CHGPF

By Thibault Dambrine

his article was started before I had a chance to read "Tips from Jackie" in our May 1997 issue. It was started on the basis of an internal presentation and it is now here for your perusal. It is a little bit more detailed than Jackie’s piece but essentially covers the same material.

As Programmers, most of us like to think we are good enough systems designers. When we decide to put “n” number of fields in a file, we usually don’t expect to have to change that in the immediate future. Of course, in the real world, business requirements change, legacy applications are a fact of programming life, and changes in file format is something we will have to face sooner or later.

Changing the format of a widely used file, with a number of logical views and a few more bells and whistles can be a lot of work. In the most complicated case, the to-do list involved in the change of a physical file would look like this:

For those who are not yet aware (I was part of that bunch until recently), CHGPF has changed a lot. Figure 1 shows what the “old” CHGPF did in V3R1.


(Figure 1)
Change Physical File (CHGPF)    (V3R1)                     
                                                                               
 Type choices, press Enter.                                                    
                                                                               
 Physical file  . . . . . . . . . > FILENAME      Name                         
   Library  . . . . . . . . . . . >   LIBNAME     Name, *LIBL, *CURLIB         
 System . . . . . . . . . . . . .   *LCL          *LCL, *RMT, *FILETYPE        
 Expiration date for member . . .   *NONE         Date, *SAME, *NONE           
 Maximum members  . . . . . . . .   1             Number, *SAME, *NOMAX        
 Access path maintenance  . . . .   *SAME         *SAME, *IMMED, *REBLD, *DLY  
 Access path recovery . . . . . .   *SAME         *SAME, *NO, *AFTIPL, *IPL    
 Force keyed access path  . . . .   *SAME         *SAME, *NO, *YES             
 Member size:                                                                  
   Initial number of records  . .   10000         1-2147483646, *NOMAX, *SAME  
   Increment number of records  .   1000          0-32767, *SAME               
   Maximum increments . . . . . .   3             0-32767, *SAME               
 Allocate storage . . . . . . . .   *NO           *NO, *YES, *SAME             
 Preferred storage unit . . . . .   *ANY          1-255, *SAME, *ANY           
 Records to force a write . . . .   *NONE         Number, *SAME, *NONE         
 Maximum file wait time . . . . .   *IMMED        Number, *SAME, *IMMED, *CLS  
                                                                                
Maximum record wait time . . . .   60            Number, *SAME, *IMMED, *NOMAX 
Share open data path . . . . . .   *SAME         *SAME, *NO, *YES              
Max % deleted records allowed  .   *NONE         1-100, *NONE, *SAME           
Reuse deleted records  . . . . .   *NO           *SAME, *YES, *NO              
Record format level check  . . .   *YES          *SAME, *YES, *NO              
Text ‘description’ . . . . . . .   ‘Text for Filee.
Coded character set ID . . . . .   37            *SAME, *HEX

Starting at Version V3R2 however, CHGPF can do a lot more for you. If you are changing a physical file with a lot of logical views, specific authorities and special features attached; CHGPF can now help you in a big way. With the new features offered in CHGPF, there is no need to delete and re-create physical files or any of the associated logical files when changing the number of fields or altering fields in an existing physical file. Authorities are taken care of, trigger programs are automatically re-attached, as are journals and everything else that was hooked up to the old file.

All you have to do now, is to change the DDS, call CHGPF and stand back! First, lets review the DDS changes supported by CHGPF:

How is it all done?

Simply by providing CHGPF with the modified DDS source file and member, with the file creation parameters. (See shaded area in figure 2).

With these new parameters in the CHGPF command, the to-do list to modify a file becomes:

Note: The File Level Identifier will change when the following features change:



(Figure 2) 
Change Physical File (CHGPF)   (V3R7)                        
                                                                               
Type choices, press Enter.                                                     
                                                                               
Physical file  . . . . . . . . . > FILENAME      Name                          
  Library  . . . . . . . . . . .     LIBNAME     Name, *LIBL, *CURLIB          
System . . . . . . . . . . . . .   *LCL          *LCL, *RMT, *FILETYPE         
Source file  . . . . . . . . . .   *NONE         Name, *NONE                   
  Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB          
Source member  . . . . . . . . .   *FILE         Name, *FILE                   
Source listing options . . . . .                 *SRC, *NOSRC, *SOURCE...      
               + for more values                                               
Generation severity level  . . .   20            0-30                          
Flagging severity level  . . . .   0             0-30                          
Delete dependent logical file  .   *NO           *NO, *YES                     
Remove constraint  . . . . . . .   *RESTRICT     *RESTRICT, *REMOVE            
Expiration date for member . . .   *SAME         Date, *SAME, *NONE            
Maximum members  . . . . . . . .   *SAME         Number, *SAME, *NOMAX         
Access path size . . . . . . . .   *SAME         *SAME, *MAX4GB, *MAX1TB       
Access path maintenance  . . . .   *SAME         *SAME, *IMMED, *REBLD, *DLY
Access path recovery . . . . . .   *SAME         *SAME, *NO, *AFTIPL, *IPL     
Force keyed access path  . . . .   *SAME         *SAME, *NO, *YES              
Member size:                                                                   
  Initial number of records  . .   *SAME         1-2147483646, *NOMAX, *SAME   
  Increment number of records  .   *SAME         0-32767, *SAME                
  Maximum increments . . . . . .   *SAME         0-32767, *SAME                
Allocate storage . . . . . . . .   *SAME         *NO, *YES, *SAME              
Preferred storage unit . . . . .   *SAME         1-255, *SAME, *ANY            
Records to force a write . . . .   *SAME         Number, *SAME, *NONE          
Maximum file wait time . . . . .   *SAME         Number, *SAME, *IMMED, *CLS   
Maximum record wait time . . . .   *SAME         Number, *SAME, *IMMED, *NOMAX 
Share open data path . . . . . .   *SAME         *SAME, *NO, *YES              
Max % deleted records allowed  .   *SAME         1-100, *NONE, *SAME           
Reuse deleted records  . . . . .   *SAME         *SAME, *YES, *NO              
Sort sequence  . . . . . . . . .   *SAME         Name, *SAME, *SRC, *JOB...    
  Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB
Language ID  . . . . . . . . . .   *SAME         Character value, *JOB, *SAME
Record format level check  . . .   *SAME         *SAME, *YES, *NO            
Node group . . . . . . . . . . .   *SAME         Name, *NONE, *SAME          
  Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB        
Partitioning Key . . . . . . . .   *SAME         Name, *SAME                 
               + for more values                                             
Text ‘description’ . . . . . . .   *SAME
Coded character set ID . . . . .   *SAME         *SAME,  *HEX...                                    

A change to any of the above, causes the data map to change and therefore programs using the file have to be re-compiled.

All this sounds pretty good, but there are still considerations to watch out for. Do not attempt to use CHGPF without reading these:

In Conclusion:

Although the new CHGPF feature does not do EVERYTHING you need when changing fields in an existing file, it will significantly reduce the tedious parts of the job. Proper planning, backups, and program re-compiling is still part of the job. Also, there is no substitute for reading the specifics in the manual. This article is more of an introduction than a detailed technical example, but I hope it helps. [Note: I would like to give credit to Skip Marchesani of Lexel-Custom Systems Corp. (Newton, NJ) for his contribution to this article.] T < G