Column Heading in DDS Files and DDL tables

Column Heading in DDS Files and DDL tables
Column Heading in DDS Files and DDL tables, dds to ddl, dds to sql, as400, ibmi, database modernization, column heading, dds file, ddl table,db2, db2 for i sql
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.

  • COLHDG('column heading1' 'column heading2' 'column heading3')
  • 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

    Post a Comment

    © AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain