Consultor Eletrônico



Kbase P9386: How to change the field size in the physical file on AS/400?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2008
Status: Verified

GOAL:

How to change the character field size in the physical file on AS/400 ?

FACT(s) (Environment):

IBM AS/400 (RISC)
Progress/400 DataServer

FIX:

In order to change the length of the character field, the physical file on AS/400 corresponding to a Progress table needs to be re-generated.

It can be achieved by:

1. Preserving data in the file (dump or save).
2. Deleting the field (or table).
3. Recreating the field (or table) with required field formats using Progress/400 Data Dictionary on the client side.
4. Restoring data into the table.

Field format in the Progress/400 Data Dictionary is a DISPLAY format and changing it doesn't change the field size of the physical file on AS/400. In such a case the DDS description file is not re-generated and the physical file is not recompiled on AS/400.

There are some other ways of performing this task provided that the database maintenance is done on AS/400. The first one is to change the DDS description manually:

1. Copy the file aside
2. Change the DDS to reflect your requirements
3. Compile DDS
4. Copy the file back (CPYF) - options: MBROPT(*ADD) FMTOPT(*MAP) - the records will be copied to a new table.
5. Run CHGPRODCT,
6. Synchronize or recreate the schema holder.

The way which doesn't require dump and load or copying all records is to modify the physical file using SQL utility (STRSQL). The only steps that need to be performed are:

1. Alter table with strsql (for example: alter table library_name/table_name alter field_name set data type varchar(20)),
2. Run CHGPRODCT,
3. Synchronize or recreate the schema holder.