Rational Developer for System z, Version 7.5

Segment

A Segment is a structured collection of Data Elements. It must belong to a Data Structure. Segments are used by different files. Some Segments represent the common part of the record (sort criteria and keys) in a file, and other Segments represent the specific part of the record in a file.

Concept

Each Segment, described only once, can be called into any entity that uses Segments (Programs, Segments, Database Blocks). In Programs (specific to the use of the Batch function), Segments represent the files which constitute the external resources. In Database Blocks (specific to the use of the Database Description function), Segments represent SQL Tables or Views. A lot of information specified at the Segment level is used according to the way the Segment is used in these entities.

Segment definition

The Segments defined in the Definition tab of the Segment editor are used by standard files (multi-record files) or transaction files. Each file may have several types of records; some Segments represent the common part of the record, and others represent the specific part of the record. These Segments are identified by their name. A Segment name contains the name of the Data Structure it belongs to and a number:
  • '00' identifies the Segments representing the common part of records in a file, the information entered in a '00' Segment definition are used by transaction files.
  • numbers different from '00' identifies the specific Segments, the information entered in the definition of these Segments are used by standard files.

A transaction file is made of records that update a permanent file. The type of update (Creation, Modification, Deletion, or other cases) is called the action code. Validations and updates are automatically associated with each update type. In the common part of the file, a Data Element, called the 'Action Code Data Element', represents the action code. You must associate six values with this Data Element, one for each type of update. Each value will represent the input that the user will have to indicate in the application to carry out the appropriate update. This Data Element code and values are indicated on the Definition of the ’00’ Segment in the fields dedicated to the action code.

A standard file may have several types of records. The specific part of each record is described in a Segment number 'nn'. In generated programs, a record description will be made of the concatenation of the '00' and the appropriate 'nn' segment descriptions. A Data Element is used to identify the specific record type. This Data Element code is specified on the definition of Segment number '00'; the appropriate value is coded on the definition of the specific part Segment. For a file that has only one type of record, only a '00' Segment is described.

Related tasks
Creating a Segment
Related reference
New Segment wizard

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)