Access Files

Access Files store database access information used to translate report requests into the required ADABAS direct calls.

In the MVS environment, the Access File is located in a PDS allocated to the ddname FOCADBS or ACCESS. Each member is a separate Access File. In the CMS environment, each Access File is stored with the filetype FOCADBS or ACCESS.

An Access File consists of 80-character records in comma-delimited format. A record in an Access File contains a list of attributes and values, separated by commas and terminated with a comma and dollar sign (,$). This list is free-form and spans several lines if necessary. You can specify attributes in any order.

FOCUS reads blank lines and lines starting with a dollar sign in column one as comments.

Every Access File contains a release declaration and at least one segment declaration. Release declarations and segment declarations each have their own set of attributes. These attributes are discussed in the following sections.

The following is a sample Access File:


$$$ CREATED BY AUTOADBS ON 04/17/95 AT 15.04.22 BY PMSMJB
$$$ FILENAME=EMPFILE1,SUFFIX=ADBSINX,$
RELEASE=6,OPEN=YES,$
$ ADABAS FILE = EMPLOYEES                         DICTIONARY =
SEGNAM=S01 ,ACCESS=ADBS,FILENO=001,DBNO=1,CALLTYPE=RL,
SEQFIELD=PERSONNEL_ID,$
FIELD= DEPT_PERSON ,TYPE=SPR,$
FIELD=DEPT ,TYPE=DSC,NU=YES,$
FIELD=NAME ,TYPE= ,NU=NO,$
FIELD= LEAVE_LEFT ,TYPE=SPR,$
FIELD=LEAVE_DUE ,TYPE= ,NU=YES,$
FIELD=LEAVE_TAKEN ,TYPE= ,NU=YES,$
FIELD= DEPARTMENT ,TYPE=NOP,NU=NO,$
SEGNAM=AI0101,ACCESS=MU ,FILENO=001,$ ADDRESS_LINE
SEGNAM=AQ0201,ACCESS=PE ,FILENO=001,DBNO=1,$ INCOME
SEGNAM=AT0301,ACCESS=MU ,FILENO=001,DBNO=1,$ BONUS
SEGNAM=AW0401,ACCESS=PE ,FILENO=001,$ LEAVE_BOOKED
SEGNAM=AZ0501,ACCESS=MU ,FILENO=001,$ LANG

Top of page

Release Declaration

The release declaration must be the first uncommented line of the Access File. It identifies the release of ADABAS and indicates whether the ADABAS Interface issues ADABAS OPEN and CLOSE calls for each report request.

The syntax is

RELEASE= relnum [,OPEN={YES|NO}] ,$

where:

relnum
Is the ADABAS release number.

OPEN
Specifies whether the ADABAS Interface issues ADABAS OPEN and CLOSE calls to ADABAS in each report request. Possible values are:

YES indicates that ADABAS OPEN and CLOSE calls are issued. This value is the default.

NO indicates that ADABAS OPEN and CLOSE calls are not issued.


Top of page

RELEASE

The first declaration in the Access File contains the ADABAS release number with the attribute RELEASE. Specify the full release number. The value is for documentation only.

The following example illustrates the use of the RELEASE attribute to specify the ADABAS release number:

RELEASE=6 ,$

Top of page

OPEN

The OPEN attribute specifies whether the ADABAS Interface issues ADABAS OPEN and CLOSE calls to ADABAS in each report request. Specifying YES or NO achieves the following results:

Value

Result

YES

The ADABAS Interface issues an OPEN call to ADABAS at the start of a call set initiated by a retrieval request. An ADABAS CLOSE is issued at the end of retrieval for the request. YES is the default value.

RELEASE=6 , OPEN=YES ,$

NO

ADABAS OPEN and CLOSE calls are not issued for any retrieval request.

RELEASE=4.1, OPEN=NO ,$

Accept the default value (YES) unless you are using an ADABAS release lower than 5.0.


Top of page

Segment Attributes

Segment declarations contain detailed information about each segment of an ADABAS file. The segment declaration attributes specify the segment name, the file and database numbers, and the ADABAS password, as well as retrieval options.

The syntax is

SEGNAM=segname, ACCESS=access, FILENO=file_number [,DBNO=database_number]
[,CALLTYPE={FIND|RL}] [,SEQFIELD=seqfield] [,PASS=password]
[,FETCH = {ON|OFF}] [,FETCHSIZE = {n|MAX}] ,$

where:

segname
Is the SEGNAME value from the Master File.

access
Specifies the segment type that the ADABAS Interface uses for each segment. Possible values are:

ADBS for a segment that contains only non-repeating fields. This value is the default.

PE for a segment that is a periodic group in the same file as the parent segment.

MU for a segment that is a multi-value field in the same file as the parent segment.

file_number
Is the number that identifies an ADABAS file.

database_number
Is the number that identifies an ADABAS database.

CALLTYPE
Indicates the type of data retrieval call constructed by the ADABAS Interface. Possible values are:

FIND call is issued when there are one or more WHERE or IF statements in a retrieval request detected against fields defined with INDEX=I. This is the default value.

RL (Read Logical) call is issued when there are one or more WHERE or IF statements against fields defined with INDEX=I.

Note: See your database administrator for the most efficient CALLTYPE to be used at your site.

seqfield
Provides a default index which controls Read Logical (RL) retrieval when there are no IF or WHERE selection tests.

password
Is the ADABAS password for the file.

FETCH
Indicates whether to use the Fetch feature. Possible values are:

ON sets the Fetch feature on for the user session. This is the default value.

OFF sets the Fetch feature off for the user session.

If you include this attribute, you must also include FETCHSIZE (see below).

FETCHSIZE
Sets the number of records per buffer. Possible values are:

n is the number of records per buffer (1-999). Ten records per buffer is the default.

MAX is automatically calculated by the ADABAS Interface to allow the maximum number of records that fit in a 32K buffer.

Note: FETCH and FETCHSIZE are applicable only to segments described as ACCESS=ADBS. FETCH and FETCHSIZE can be set dynamically to override the Access File settings. See Environment Commands, for more information.

Special attributes that apply to embedded JOINs are explained in Implementing Embedded JOINs: KEYFLD and IXFLD. Attributes that apply to superdescriptors and subdescriptors are explained in Describing Descriptors in the Access File.


Top of page

SEGNAM

The SEGNAM attribute specifies the name of the segment being described. It is the same name as the SEGMENT value in the Master File.


Top of page

ACCESS

The ACCESS attribute specifies the segment type that the ADABAS Interface uses for each segment. The values are:

Note: All three access values use the attributes FILENO and DBNO.

The following is the partial Access File for EMPLOYEES with the specification of PE and MU fields.

  $$$ FILENAME=EMPFILE1,SUFFIX=ADBSINX,$
RELEASE=6,OPEN=YES,$
  $ ADABAS FILE = EMPLOYEES                         DICTIONARY = 
SEGNAM=S01 ,ACCESS=ADBS,FILENO=001,DBNO=1,CALLTYPE=RL,
SEQFIELD=PERSONNEL_ID,$
SEGNAM=AQ0201,ACCESS=PE ,FILENO=001,DBNO=1,$ INCOME
SEGNAM=AT0301,ACCESS=MU ,FILENO=001,DBNO=1,$ BONUS
SEGNAM=AW0401,ACCESS=PE ,FILENO=001,DBNO=1,$ LEAVE_BOOKED

Top of page

ACCESS=ADBS

ACCESS=ADBS specifies the main segment of the file. This segment contains only non-repeating fields.


Top of page

FILENO

The FILENO attribute specifies the ADABAS file number. You need this file number to identify the ADABAS file(s) you wish to access. The valid values are 1-255.

Suppose you are accessing two segments: the first is in the EMPLOYEE file, and the second is in the INSURANCE file. To describe this situation in the Access File, use the SEGNAM and FILENO attributes as illustrated in DBNO in Segment Attributes.


Top of page

DBNO

The DBNO attribute specifies the ADABAS database number. It is used when you define files from multiple databases in one Master File. If it is not provided, the DBNO will be read from the DDCARD. If the DDCARD is not allocated, the Interface uses the default value, DBNO=0.

The following example illustrates the use of both the FILENO and DBNO attributes to account for the files being in different databases:

SEGNAM=ONE   ,FILENO=1  ,DBNO=1 ,... ,$ 
SEGNAM=PAY ,FILENO=2 ,DBNO=3 ,... ,$

Top of page

CALLTYPE

The CALLTYPE attribute affects how the ADABAS Interface processes WHERE and IF statements on descriptors in report requests and how it retrieves cross-referenced file data from a descendant segment. With CALLTYPE, you optionally specify the type of access to use to process the inverted lists for any given segment. Ask your ADABAS database administrator to advise you when you are selecting a CALLTYPE.

The possible values and their meanings are:

Value

Meaning

FIND

An ADABAS FIND call is issued when there are one or more WHERE or IF statements against fields defined to FOCUS with INDEX=I. The search is on specific values of the field.

The ADABAS Interface can generate ADABAS FIND (S1) calls even when non-descriptor fields are used as search criteria. This can occur whenever CALLTYPE=FIND is specified in the Access File, and if you include an IF or WHERE test when referencing a non-descriptor field in your TABLE or TABLEF request.

To turn off this feature, see Interface Navigation, which discusses the optimization of the FIND call using non-descriptor fields.

RL

An ADABAS Read Logical call is issued when there are one or more WHERE or IF statements against fields defined to FOCUS with INDEX=I.

Note: If you have selected a field defined with TYPE=NOP (for example, subdescriptors), a FIND call is issued even if RL has been specified.

The first IF statement in a request that refers to a field with INDEX=I determines the inverted list used for the Read Logical access for the root of the subtree. Refer to Report Considerations, for information on subtrees.

When retrieving descendant segments, the ADABAS Interface issues a Read Logical call using the descriptor pointed to by IXFLD. For more information on IXFLD, refer to Implementing Embedded JOINs: KEYFLD and IXFLD and the FOCUS for IBM Mainframe User's Manual.

For CALLTYPE=RL, all other selection tests on descriptor fields specified in your report request are applied after the record is returned.


Top of page

SEQFIELD

The SEQFIELD attribute specifies the field you want to use as the sequencing value:

RELEASE=6,OPEN=YES,$
$ ADABAS FILE = EMPLOYEES DICTIONARY =
SEGNAM=S01 ,ACCESS=ADBS,FILENO=001, DBNO=1,CALLTYPE=RL,
SEQFIELD=PERSONNEL_ID,$

For more information about SEQFIELD, see Installation Instructions.


Top of page

PASS

The PASS attribute specifies the ADABAS password for the file. It is required if the file is password protected.

You must specify the password for each password-protected file you use. For example:

SEGNAM=ONE   ,FILENO=1   ,DBNO=1   ,PASS=ONEXX ,...,$
SEGNAM=PAY ,FILENO=2 ,DBNO=3 ,PASS=USER2 ,...,$

For information about encrypting the Access File to prevent unauthorized viewing of passwords, refer to the FOCUS for IBM Mainframe User's Manual.


Top of page

FETCH

The FETCH attribute indicates whether to use the Fetch feature for segments described as ACCESS=ADBS in the Access File. Valid values are ON (default) or OFF.


Top of page

FETCHSIZE

The FETCHSIZE attribute sets the number of records per buffer. You can supply a specific number or have the ADABAS Interface automatically calculate the maximum number of records that fit in a 32K buffer.

The following is an example of an Access File that enables the Fetch feature and sets the number of records per buffer to 15.

$$$ CREATED BY AUTOADBS ON 03/18/97 AT 15.04.22 BY PMSMJB
$$$ FILENAME=EMPFILE1,SUFFIX=ADBSINX,$
RELEASE=6,OPEN=YES,$
$ ADABAS FILE = EMPLOYEES                         DICTIONARY =
SEGNAM=S01 ,ACCESS=ADBS,FILENO=001,CALLTYPE=RL,
SEQFIELD=PERSONNEL_ID,FETCH=ON,FETCHSIZE=15,$

Top of page

Using the GROUP Attribute to Cross-Reference Files

The GROUP attribute can be used to cross-reference ADABAS files if the file you want to search does not contain a descriptor. This cross-referencing can be done only if fields within the file you want to search correspond to descriptors in the file you are cross-referencing.

Consider this situation: You have a SALES file which contains salesman information. It also has account information, such as COMPANY_CODE, ITEM_NUMBER, and ITEM_NAME.

Suppose you also have an ACCOUNT file containing information about each company in a salesman's territory. The ACCOUNT file has a superdescriptor consisting of COMP_CODE, IT_NUMBER, and IT_NAME. These fields correspond to the fields specified in the SALES file.

You can create a link between the matching fields in the SALES and ACCOUNT files. To do this, describe the matching fields from the SALES file as a group. Then you can join the group field to the superdescriptor in the ACCOUNTS file. The host file is the file, without a descriptor, containing the held values which must be grouped in order to retrieve related records in the second file.

For example:

FILE=SALES    ,SUFFIX=ADBSINX    ,$
SEGNAME=ACCT_SEG ,SEGTYPE=S ,$
GROUP=LINKFLDS ,ALIAS= ,USAGE=A20 ,ACTUAL=A20 ,$
FIELD=COMPANY_CODE ,ALIAS=BA ,USAGE=A3 ,ACTUAL=A3 ,$
FIELD=ITEM_NUMBER ,ALIAS=BB ,USAGE=A5 ,ACTUAL=A5 ,$
FIELD-ITEM_NAME ,ALIAS=BC ,USAGE=A12 ,ACTUAL=A12 ,$

SALES is the host file which uses the superdescriptor (COMPANY) in the ACCOUNT file for the company-related data. The superdescriptor in the ACCOUNT file, easily recognized by TYPE=SPR in the Access File, is composed of fields that correspond to the dummy group in the host. Looking at Figure 5-12 and Figure 5-13, you see how the fields in the LINKFLDS group in the SALES file relate to the superdescriptor COMPANY in the ACCOUNT file:

FILE=ACCOUNT	,SUFFIX=ADBSINX ,$
SEGNAME=PROD_SEG ,SEGTYPE=S ,PARENT=ACCTS ,$
GROUP=COMPANY ,ALIAS=S1 ,USAGE=A20 ,ACTUAL=A20, INDEX=I,$
FIELD=COMP_CODE ,ALIAS=AA ,USAGE=A3 ,ACTUAL=A3 ,$
FIELD=IT_NUMBER ,ALIAS=AB ,USAGE=A5 ,ACTUAL=A5 ,$
FIELD-IT_NAME ,ALIAS=AC ,USAGE=A12 ,ACTUAL=A12 ,$

Use the GROUP superdescriptor COMPANY to retrieve data for those values using the JOIN command within a FOCUS procedure. The JOIN command or embedded cross-reference completes the link. In this example, you would join LINKFLDS in SALES to COMPANY in ACCOUNT using the following syntax:

JOIN LINKFLDS IN SALES TO ALL COMPANY IN ACCOUNT AS J1

Top of page

Describing Descriptors in the Access File

Field suffixes are specified in the Access File to identify descriptors, superdescriptors, and subdescriptors. The syntax is

FIELD[NAME]=fieldname, TYPE=fieldsuffix, [NU={YES|NO}] ,$

where:

fieldname
Is the fieldname or group in the Access File.

fieldsuffix
Indicates the field suffix. Possible values are:

DSC indicates a descriptor.

SPR indicates a superdescriptor made up of whole fields.

NOP indicates a subdescriptor or superdescriptor made up of partial fields.

blank
Indicates non-descriptor fields.

NU
Specifies whether null-suppression is in use. Possible values are:

YES indicates that the field is described in the Interface with null-suppression.

Note: Descriptors with null values are not stored in inverted lists.

NO indicates null-suppression is not used. This is the default value.


Top of page

Specifying Superdescriptors Containing Partial Fields

If a superdescriptor consists of one or more partial fields, that superdescriptor (field) is defined with TYPE=NOP (non-printable) in the Access File. This type of descriptor can be used in selection tests, but neither it nor any part of it can be printed or displayed unless the field is alphanumeric.

The partial fields that comprise such superdescriptors are stored in ADABAS; there is no facility or necessity for identifying them to FOCUS or the Interface. If you look at an Access File that contains a superdescriptor composed of partial fields, you could recognize it by TYPE=NOP, but you cannot list the partial fields that are its components. To use the Interface, identify such a superdescriptor in the Access File with TYPE=NOP.

Any superdescriptor defined to FOCUS with TYPE=NOP has the following limitation: CALLTYPE=RL is not supported when this field is the IXFLD in an embedded cross-reference or JOIN.

See your Software AG documentation for more information about using superdescriptors containing partial fields.


Top of page

Specifying Subdescriptors

A subdescriptor consists of a partial field value for which an index has been created in ADABAS. It is described at the field level in the Access File as TYPE=NOP. It can be used in selection tests, but it cannot be printed.

Any subdescriptor defined to FOCUS in the Access File with TYPE=NOP has the following limitation: CALLTYPE=RL is not supported when this field is the IXFLD in an embedded cross-reference or JOIN.


Top of page

Specifying Null-suppression

To allow the ADABAS Interface to create the most efficient calls, while still maintaining integrity of the answer set, any null-suppressed fields that are components of a superdescriptor must be defined in the Access File. The NU attribute is used to define a null-suppressed field.

An NU field defined as a descriptor is not stored in inverted lists when it contains a null value. Any qualifying descriptor records containing a null value are not recognized by a FIND command that refers to that descriptor.

The same is true for subdescriptors and superdescriptors derived from fields described in the Interface with null-suppression. No entry is made for a subdescriptor if the bytes of the field from which it is derived contain a null value and that field is defined with null-suppression (NU). No entry is made for a superdescriptor if any of the fields from which it is derived is an NU field with a null value.

See your Software AG documentation for more information about null-suppression and how it affects data retrieval.


Top of page

Implementing Embedded JOINs: KEYFLD and IXFLD

The KEYFLD and IXFLD attributes identify the common fields for parent/descendant relationships in a multi-segment Master File. These relationships are referred to as embedded JOINs or FOCUS views.

For each descendant segment, the KEYFLD and IXFLD attributes specify the fieldnames of the shared field that implements the embedded JOIN. The parent field supplies the value for cross-referencing; the descendant field contains the corresponding value. The Interface implements the relationship by matching values at run time.

The KEYFLD and IXFLD attributes are only valid for ACCESS=ADBS segments.

Attribute

Meaning

KEYFLD

Refers to the FOCUS fieldname in the parent segment whose value is used to retrieve the child segment. This is also known as the primary key.

IXFLD

Refers to the FOCUS fieldname in the child or cross-referenced segment containing the related data. This is also known as the foreign key.

The value for the KEYFLD attribute is a 1- to 66-character fieldname or alias from the parent segment. The value for the IXFLD attribute is a 1- to 66-character fieldname or alias from the descendant segment.

FILENAME=AMKTORDR     ,SUFFIX=ADBSINX ,$
SEGNAME=MKTORDER
FIELDNAME =NMARKET_GRP ,BA ,I3 ,I2, INDEX=I,$
FIELDNAME =QPRODUCT ,BB ,I3 ,I2 ,$
FIELDNAME =QNEEDITM ,BC ,A3 ,I2 ,$
FIELDNAME =FBUILD ,BD ,A1 ,A1 ,$
FIELDNAME =FK_NPRODUCT ,BE ,A4 ,A4 ,$
FIELDNAME =FK_NCUSTOMER ,BF ,I3 ,I2 ,$
FIELDNAME =DATEMKTO ,BG ,A8 ,A8 ,$
FIELDNAME =DATEFBLD ,BH ,A8 ,A8 ,$
SEGNAME=CUSTOMER, SEGTYPE=U,PARENT=MKTORDER,$
FIELDNAME =NCUSTMR_GRP ,AA ,I3 ,I2, INDEX=I,$
FIELDNAME =NAMECUST ,AB ,A15 ,A15 ,$
FIELDNAME =DCUSROAD ,AC ,A20 ,A20 ,$
FIELDNAME =DCUSTOWN ,AD ,A20 ,A20 ,$
Figure 5-14. Master File With Embedded JOIN Using KEYFLD and IXFLD RELEASE=6, OPEN=YES,$
SEGNAM=MKTORDER, ACCESS=ADBS,
FILENO=022,DBNO=001 ,$
SEGNAM=CUSTOMER, ACCESS=ADBS,
FILENO=021,DBNO=001
,CALLTYPE=FIND,
IXFLD=NCUSTMR_GRP,KEYFLD=FK_NCUSTOMER,$
Figure 5-15. Access File With Embedded JOIN Using KEYFLD and IXFLD

Note: Include the pair of attributes in the Access File segment declaration for descendant segments. Do not specify them in the segment declaration for the root segment.

A JOIN can be based on more than one field in the host and cross-referenced logical record types. If the ADABAS file uses multiple fields to establish a relationship or link between logical record types, you can specify concatenated fields in an embedded JOIN. You can also specify multiple fields with the dynamic JOIN command. See Chapter 6, Reporting Considerations, for more information.

In the multi-field embedded JOIN, the KEYFLD and IXFLD values consist of a list of their component fields separated by slashes (/). Additional Access File attributes are not required. The syntax is

KEYFLD = field1/field2/...,
IXFLD = cfield1/cfield2/...,$

where:

field1/...

Is a composite of up to 16 key fields from the parent segment. Slashes are required.

cfield1/...
Is a composite of up to 16 key fields from the descendant segment.

The Interface compares each field pair for the data formats prior to format conversion; it evaluates each field pair with the following rules:

To implement JOINs, the ADABAS DBMS converts the alphanumeric FOCUS field formats to equivalent ADABAS field formats in order to perform the necessary search and match operations. When the ADABAS DBMS returns the answer set of matched values, it also converts the values back to alphanumeric formats. The cross-referenced fields must be descriptor fields.


Information Builders