space
Previous Page | Next Page

ADABAS Essentials

ADABAS Data Fields


Data Field Types

You can group logically related ADABAS data fields into one ADABAS file, which consequently can be accessed by one NATURAL DDM. Up to 926 data fields can be contained in a single logical record. Data fields have assigned types, formats, and lengths.

The SAS/ACCESS interface to ADABAS supports the ADABAS data fields as described below.


Elementary Field

An elementary field is limited to one value per record. For example, LASTNAME could be an elementary field.


Multiple-value Field

A multiple-value field can have 0 to 191 values per record. For example, JOBTITLE could be a multiple-value field because each employee at a company could have multiple job titles during their employment.


Group Field

A group field is several consecutive data fields combined into one for efficient access and ease of reference. Defining a group field enables you to reference a series of data fields by using a group name. For example, a group field named EDUCATION could consist of these data fields: COLLEGE, DEGREE, and YEAR.

A group field can also consist of other groups. In conjunction with grouping, you can assign level numbers 01 to 07 to define a group.


Periodic Group Field

A periodic group field is a group of data fields that repeat. A periodic group can be repeated up to 191 times and can contain one or more elementary fields and multiple-value fields. Groups can be nested, but periodic groups cannot. One periodic group cannot contain another. However, a record can have several periodic groups.


Subfield

A subfield is a data field defined from a portion of another data field. For example, a subfield named AREA-CODE could be defined for the first three digits from the PHONE data field.

You use subfields for read operations only; they cannot be used for updating directly.


Superfield

A superfield is a data field composed of several data fields, portions of fields, or combinations thereof. For example, a superfield could be STATE-AREA-CODE accessing such values as TX512, NM505, and CA213.

You use superfields for read operations only; they cannot be used for updating directly.


Mapping Data between SAS and ADABAS

When you access ADABAS data through the SAS/ACCESS interface, the interface view engine maps the ADABAS data into SAS observations. You need to be aware of how the interface view engine maps multiple-value fields and periodic groups. That is, multiple-value field occurrences are mapped to multiple SAS variables, and periodic group occurrences are mapped to multiple SAS observations.

For example, suppose an ADABAS file has the data fields and values shown in the following output. LASTNAME is an elementary field, JOBTITLE is a multiple-value field, and EDUCATION is a periodic group consisting of the data fields COLLEGE, DEGREE, and YEAR.

ADABAS Data

______________________________________________________________|
| LASTNAME  | JOBTITLE          |  EDUCATION                  |
|___________|___________________|_____________________________|
| Reid      | Systems Analyst   |  Purdue   | BA   | 1973     |
|___________|-------------------|-----------------------------|
            | DBA               |  Harvard  | MBA  | 1975     |
            |___________________|_____________________________|

The interface view engine would map the ADABAS data into two SAS observations, as shown in the following output.

ADABAS Data Mapped into SAS Observations

LASTNAME   JOBTITL1          JOBTITL2   COLLEGE   DEGREE   YEAR
Reid       Systems Analyst   DBA        Purdue    BA       1973
Reid       Systems Analyst   DBA        Harvard   MBA      1975

If you were browsing the ADABAS data, such as with the FSVIEW procedure, the results would be similar to ADABAS Data Mapped into SAS Observations, with LASTNAME, JOBTITL1, and JOBTITL2 repeated for each set of COLLEGE, DEGREE, and YEAR values. Actually though, the value Reid is stored in the ADABAS file only once. For retrievals, the results are straightforward. When updating, however, you need to keep in mind how the interface view engine maps multiple-value fields and periodic groups.

Suppose you want to change the spelling of a last name using the FSVIEW procedure. To change Reid to Reed, all you need to do is type REED over one of the REID values, and, with a single update operation, the last names are all changed. On the other hand, suppose you want to delete an observation for Reid using the FSEDIT procedure. Each observation for his job titles and education data would display his last name. If you deleted an observation, for example, the one for Purdue, the deletion would not affect the last name or the job title data, but the Purdue observation would be gone. For more information and an example of deleting an observation from ADABAS data, see Browsing and Updating ADABAS Data.


Data Field Formats and Lengths

Data definition statements enable you to define data field formats and lengths for both ADABAS files and NATURAL DDMs. The standard format of a data field is specified with a one-character code shown next in the following table. The standard length of a data field is specified in bytes; the maximum length is also given.

ADABAS Standard Data Field Formats and Lengths
Data Type Standard Format Standard Length Description
Alphanumeric A (ADABAS) A (DDM) 253 byte maximum Left-justified, with trailing blanks removed
Binary B (ADABAS) B (DDM) 126 byte maximum Right-justified, unsigned, with leading zeros removed
Fixed Point F (ADABAS)

B (DDM)

Must be 4 bytes Right-justified, signed, with twos complement notation
Floating Point G (ADABAS) F (DDM) Must be 4 or 8 bytes In normalized form and signed
Packed Decimal P (ADABAS) P (DDM) 15 byte maximum Right-justified and signed
Unpacked Decimal (Zoned) U (ADABAS) N (DDM) 29 byte maximum Right-justified and signed

If the standard length of a data field is specified as zero, the data field is a variable length field, which has no maximum or required length.

Note that when creating SAS/ACCESS descriptor files, you can specify SAS formats for ADABAS data to change the way the data appears. For example, you can add decimal points. Also, you can specify a SAS date format in your SAS/ACCESS descriptor files to designate a date representation.

space
Previous Page | Next Page | Top of Page