DDS to DDL Modernization - Level Check Error |
Introduction
When the DDS file gets converted to the DDL table then Level Check Error is very common. And, one can remove this error by just re-compiling all the dependent programs on the file.
But, what if the dependency of the file is huge and can't compile all of them at once.
Level Check Error comes due to a change in the Format Level Identifier of the file.
Then the concept of surrogate LF comes into the picture. Surrogate LF is the PF's that are now converted to LF's.
Here, a new DDL table is created with the same fields as in the DDS PF file. We can add new fields also in the new DDL table but can't remove the fields that are present in the DDS PF file. Further after the creation of the DDL table, the DDS PF file is converted to LF pointing to the newly created DDL table.
DDS to DDL Modernization
Existing PF and LF files structure
DDS PF file
A R RDDS9 A FLD1 10A TEXT('FIRST TEXT FLD') A COLHDG('FIRST' 'TEXT' 'FLD') A FLD2 2P 0 TEXT('FIELD2') A COLHDG('FIELD2')
DDS LF file
A R RDDS9 PFILE(DDL9) A K FLD1
Newly Created DDL Table
CREATE TABLE LONGNAMETABLEDDL12( LONGNAMECOLUMN_FLD1 FOR COLUMN FLD1 CHAR(10) NOT NULL WITH DEFAULT, LONGNAMECOLUMN_FLD2 FOR COLUMN FLD2 DECIMAL(2) NOT NULL WITH DEFAULT, LONGNAMECOLUMN_FLD3 FOR COLUMN FLD3 DECIMAL(2) NOT NULL WITH DEFAULT ) RCDFMT RDDS9; LABEL ON LONGNAMETABLEDDL12( FLD1 IS 'FIRST TEXT FLD', FLD2 IS 'FIELD2', FLD3 IS 'FIELD3' ); LABEL ON LONGNAMETABLEDDL12( FLD1 TEXT IS 'FIRST TEXT FLD', FLD2 TEXT IS 'FIELD2', FLD3 TEXT IS 'FIELD3' ); RENAME LONGNAMETABLEDDL12 TO SYSTEM NAME DDL12;
Conversion of DDS PF file to surrogate LF
A R RDDS9 PFILE(DDL12) A FLD1 10A TEXT('FIRST TEXT FLD') A COLHDG('FIRST' 'TEXT' 'FLD') A FLD2 2P 0 TEXT('FIELD2') A COLHDG('FIELD2')
Code Changes in DDS LF file
A R RDDS9 PFILE(DDL12) A FORMAT(DDS9) A K FLD1
Conclusion
Related Post
- CRTPF and Create Table in IBM i
- Primary Key in DDS and DDL tables
- Data Validation in DDS and DDL tables
- Column Heading in DDS Files and DDL tables
- Column Text in DDS and DDL tables
- Attributes of DDL table
- Auto-update Timestamp Column using ROW CHANGE TIMESTAMP in DDL table
- ADD Constraint in DDL tables
- Create Index and LF keyed in IBM i
- Create View and LF Non-Keyed in IBM i
- Identity column in DDL table
- QSQGNDDL API - IBM to convert DDS file into DDL table
- QSQGNDDL API - IBM to convert DDS file into DDL table (Continuing...)