Create a format

You can only create formats by using a detailed specification file.

Use the syntax shown in Specification-file conventions to create a format by using a detailed specification file.

Use the following syntax to create a fixed-format object from a specification file:
BEGIN OBJECT FIXEDFORMAT formatname 

# Compulsory Attributes 
PROJECT projectname 
CHARACTERSET data_codeset 
MACHINE machine_type 
BEGIN SEQUENCE 
FIELDNAME fieldname 
DATATYPE datatype 
BYTES field_bytes 
DECIMALS decimal_places 
OFFSET offset_bytes 
END SEQUENCE 

END OBJECT  
The following table lists the attributes and their values.
Attribute Attribute value
data_codeset Code set used to translate data in the data table

For more information about data code sets, see the following file on your product CD: $INFORMIXDIR/gls/cm3/registry

datatype Type of field data

See Data types allowed in a fixed format.

decimal_places Number of decimal places for Float and Double data types
field_bytes Number of bytes that the field occupies in the record
fieldname Field name in the format
formatname Format name
machine_type Type of computer that produced the data, such as a SPARCstation

See List all existing machine types.

offset_bytes Number of bytes of the field offset in the record
projectname Name of existing project
Use the following syntax to create a COBOL-format object from a specification file:
BEGIN OBJECT COBOLFORMAT formatname 

# Compulsory Attributes 
PROJECT projectname 
CHARACTERSET data_codeset 
MACHINE machine_type 
DRIVER driver_type 
BEGIN SEQUENCE 
FIELDNAME fieldname 
PICTURE picture_description 
USAGE usage_description 
END SEQUENCE 

END OBJECT  
The following table lists the attributes and their values.
Attribute Attribute value
data_codeset Code set used to translate data in the data table

For more information about data code sets, see the following file on your product CD: $INFORMIXDIR/gls/cm3/registry

driver_type Type of driver: COBOL (default) or COBOL_b
fieldname Field name in the format
formatname Format name
machine_type Type of computer that produced the data, such as a SPARCstation
picture_description Picture description that matches the record FD from the COBOL program

See Picture strings.

projectname Name of existing project
usage_description Number of bytes that the field occupies in the record
Use the following syntax to create a delimited-format object:
BEGIN OBJECT DELIMITEDFORMAT formatname 

# Compulsory Attributes 
PROJECT projectname 
CHARACTERSET data_codeset 
RECORDSTART recordstart_delimit_character 
RECORDEND recordend_delimit_character 
FIELDSTART fieldstart_delimit_character 
FIELDEND fieldend_delimit_character 
FIELDSEPARATOR fieldseparator_delimit_character 
BEGIN SEQUENCE 
FIELDNAME format_fieldname 
FIELDTYPE field_datatype 
END SEQUENCE 

END OBJECT  
The following table lists the attributes and their values.
Attribute Attribute value
data_codeset Code set used to translate data in the data table

For more information about data code sets, see the following file on your product CD: $INFORMIXDIR/gls/cm3/registry

field_datatype Type of field data

See Data types allowed in a delimited format.

fieldend_delimit_character Delimiting character that specifies the end of the field, in hexadecimal or decimal format

Begin a hexadecimal character with 0x.

fieldstart_delimit_character Delimiting character that specifies the start of the field, in hexadecimal or decimal format

Begin a hexadecimal character with 0x.

fieldseparator_delimit_character Delimiting character that specifies the field separator, in hexadecimal or decimal format

Begin a hexadecimal character with 0x.

format_fieldname Format field name
formatname Format name
recordend_delimit_character Delimiting character that specifies the end of the record, in hexadecimal or decimal format

Begin a hexadecimal character with 0x.

recordstart_delimit_character Delimiting character that specifies the start of the record, in hexadecimal or decimal format

Begin a hexadecimal character with 0x.

projectname Name of existing project

Copyright© 2019 HCL Technologies Limited