Common Ground 2000 Format Specification

The objective is to represent all digital data in a single format that is accessible to humans and Adams.

Collins Software gives you the right to freely use this format, however Collins Software retains the right to ownership of this standard and retains the right to all publications of this format


*CG2 statement

Defines the file as being in the CG2 format. This statement MUST be the first line in the file.

Format: *CG2;


*SECTION statement

Defines the hierarchical section name of  the data records that follow 

Format:   *SECTION, name [:name...];

         name

Defines the names of the section. any level of hierarchical leveling can be specified. Records are grouped by their hierarchical parentage. 


*DEFINE statement

Defines the structure of a data record and the format of each of its values.

Format:   *DEFINE[:object], [record-id],   [value-def [,value-def...]];

object

Defines the type of record. A 1 to 255 character identifier.

record-id

Defines the name of the record.  This value is the record prefix which will be used as the first value of the data
records.  If the identifier has been previously used the record is redefined. The identifier may be specified by both
an internal and an external name “external:internal”.  If a blank internal name (i.e. “external-name:”) is used, then all data
records are unlabeled.

value-def

Defines the name and characteristics of a column in the record

Format:  value_id[(size)][:descr]

or

value_id[(size)][:(descr_list)]
value_id

1 to 255 character identifier.

(size)

An optional array size which specified the maximum number of elements in a record. The first value in the
list is the number of elements to follow.

:(descr_list)

Specifies a structure of 2 to more values. Each value is separated on the data record by a plus sign "+".

format:  :(name[:descr]+name[:descr]+...)

name

1 to 32 character identifier.

descr

Defines the original format and characteristics of a value.

format:  fmt[:char:...]

fmt
 Defines the original storage format of the value.

An ALPHA value of length n bytes
In 1, 2, 4 or 8 byte signed integer value
Rn 4, 8 or 16 byte real (floating point) value
Bn Unsigned integer of length n BITS

char
Defines the original characteristics of the value. System specific
 (i.e. “:PACKED”, “:DATE”, “:RIGHT”, others).


RAW DATA statement

Introduces a record of the specified number of bytes in length that is read as a block
of binary information.

Format:     *RAW n ;

n The number of bytes that follow this record until the start of the next record.


DATA RECORDS

The records containing database information.

Format:  [record-id,]  [value-list] ;

record-id

The internal record identifier assigned by a DEFINE statement. This value is not required if
only one record is defined and it has a blank internal identifier.

value-list

The values to be assigned to the identified record structure.