Column Heading in DDS Files and DDL tables |
The column heading is the name provided to each file field, which makes the file fields easy to understand.
Column Heading in DDS
In DDS files column heading can be added using COLHDG at field level.
We can define column heading in two ways
Column heading in one row in DDS files
To define the column heading in one row we should use the COLHDG('column heading') with the file field.
A R RDDS3 A FLD1 2P 0 COLHDG('FIELD2') A K FLD1
And when we see the above code column heading
Column heading in multiple rows in DDS files
To define the column heading in multiple rows we should use the following with the file field.
A R RDDS3 A FLD1 10A COLHDG('FIRST' 'TEXT' 'FLD') A K FLD1
And when we see the above code column heading
Column Heading in DDL
In DDS files column heading can be added using LABEL ON at field level.
We can define column heading in two ways
Column heading in one row in DDL tables
To define the column heading in one row we should use the FieldName IS 'Column Name' with the file field.
CREATE TABLE DDL4 ( FLD1 DECIMAL(2) NOT NULL WITH DEFAULT ) RCDFMT RDDL4; LABEL ON DDL4( FLD2 IS 'FIELD2' );
And when we see the above code column heading
Column heading in multiple rows in DDL tables
To define the column heading in multiple rows we should use the FieldName IS 'Column Name1 Column Name2 Column Name3 with the file field.
CREATE TABLE DDL4 ( FLD1 CHAR(10) NOT NULL WITH DEFAULT ) RCDFMT RDDL4; LABEL ON DDL4( FLD1 IS 'FIRST TEXT FLD' )
And when we see the above code column heading
NOTE: The size of all the column headings in DDL tables should be 20 characters Even if the size is less than 20 characters then also blanks should be provided in place of those characters and only then a second column heading should be given.
Related Post
- CRTPF and Create Table in IBM i
- Primary Key in DDS and DDL tables
- Data Validation in DDS 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
- DDS to DDL Modernization : Level Check Error
- 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...)