Master File Attributes

In this section:

A Master File consists of file, segment, and field declarations. Each declaration consists of some or all of the following attributes:

FILE=filename, SUFFIX=IDMSR,$ 
SEGNAME=segname, PARENT=parent 
SEGTYPE=segtype, CRFILE=crfile, OCCURS=occurs, POSITION=position,$ 
{GROUP=group|FIELDNAME=fieldname}, ALIAS=alias, USAGE=usage, ACTUAL=actual, [FIELDTYPE=fieldtype,]$

where:

filename

Is the Master File name.

IDMSR

Indicates that this Master File describes an IDMS data source.

segname

Is the segment name.

parent

Is the name of the parent segment.

segtype

Defines whether the segment is unique, U or KLU, or non-unique, S or KL. KLU and KL apply to segments that are described in a remote Master File (see Remote Segment Descriptions for additional information).

crfile

Is the name of the remote Master File when SEGTYPE is KLU or KL.

occurs

Is the integer or field name that specifies the number of repeating fields.

position

Is the field name of the beginning of the OCCURS segment.

group

Is any valid FOCUS name.

fieldname

Is any valid FOCUS field name.

alias

Is any valid FOCUS field name with the following exceptions. For an LRF last field, include the .END suffix. For key fields, the alias must be DBKEY.

usage

Is the usage format.

actual

Is the actual IDMS data format.

fieldtype

Is I if field has an IDMS Integrated Index. N/A for LRF records.

Note: Attributes and their values are separated by commas. Each declaration must end with a comma and dollar sign.


Top of page

x
File Attributes

The FILE attribute names the Master File. The Master File name is the member name within a partitioned data set (PDS) allocated to DDNAME MASTER.

The value of the SUFFIX attribute is IDMSR, the load module name of the adapter module.


Top of page

x
Segment Attributes

You can assign any SEGNAME value to DML record-types and LRF records, not necessarily the IDMS record names. However, using a similar name is recommended for documentation purposes. The segment name must be unique within a given Master File. If the same IDMS record-type is viewed in two different contexts (for example, a loop structure), two segment declarations are required.

The PARENT attribute is required for descendant segment declarations. The PARENT value names the parent segment. This attribute is not specified for the root or entry segment declaration.

The SEGTYPE attribute indicates whether a segment can occur only once (SEGTYPE=U) or many times (SEGTYPE=S). It is used as follows:

Note:

The CRFILE attribute is specified only for segments that are described remotely in another Master File. The field descriptions for these segments are, in effect, copied into the Master File at execution time. Remote descriptions are discussed in Remote Segment Descriptions.

The OCCURS and POSITION attributes are specified only when the segment corresponds to an intra-record structure (repeating fields), such as a COBOL OCCURS or OCCURS DEPENDING structure. These attributes are described in detail in Intra-Record Structures: The OCCURS Segment.


Top of page

x
Field Attributes

Reference:

The GROUP attribute identifies a set of fields with a single name. The individual fields that comprise the group must be specified immediately following the group declaration. The GROUP name can be any unique name up to 66 characters in length. Its usage is similar to that of a COBOL group name. Generally, this attribute is used for IDMS indexed or CALC fields.

Note: USAGE and ACTUAL format types for a GROUP field are always alphanumeric (A). USAGE and ACTUAL format lengths for a GROUP field are the sums of the field lengths that form the GROUP field.

The FIELDNAME attribute can be any valid FOCUS field name, not necessarily an IDMS field name, or it can remain blank. The name that you assign must be unique within a segment because data is referenced through field names or aliases. Hyphenated names must be enclosed in single quotation marks. If the same IDMS record-type is viewed in different contexts and, therefore, underlies two or more segments, different field names must be specified in the separate segment descriptions.

Because of the record-oriented nature of IDMS, fields in the Master File are described for each segment in the same order as they appear in the subschema record area. (See Adapter for CA-IDMS Samples, for a procedure that prints a report listing IDMS fields.) Bytes skipped for field alignment or for fields you want to omit must be described as dummy fields of the appropriate length. Dummy fields can have blank field names and aliases.

You do not need to describe all fields of the record-type or LRF record, only an initial set, starting with the first field and continuing up to the last field of interest, but you must list dummy fields after those fields to account for the record length. For variable-length record-types, treat the fixed-length portion as one segment and the variable portion as another segment, described with the OCCURS attribute. See Intra-Record Structures: The OCCURS Segment for more information.

The ALIAS attribute specifies an alternate name for FIELDNAME. An alias name can also be any valid FOCUS name and must be unique within a segment. Certain fields require specific ALIAS values:

The USAGE and ACTUAL attributes describe the data format of the field.

The FIELDTYPE attribute identifies Integrated Index fields on network record-types. Omit it for LRF records.



x
Reference: Field Format Conversion

The ACTUAL attribute defines the field length for COBOL fields found in the IDMS file. The number of internal storage bytes used by COBOL determines the actual length of the field for these formats:

Alphanumeric (A)

The number of characters described by the COBOL PICTURE.

Zoned decimal (Z)

The number of characters described by the COBOL PICTURE.

Integer (I)

2 or 4, corresponding to decimal lengths of 1-4 or 5-9 in the COBOL PICTURE.

Floating-point (F)

4 bytes

Double-precision (D)

8 bytes

Packed decimal (P)

(number of PICTURE digits / 2) + 1; excluding sign (S) or implied decimal (V).

The USAGE attribute defines the display length. Allow for the maximum possible number of characters or digits including decimal points. You may include valid display options without increasing the length size. The USAGE attribute also supports the field formats listed in the previous table.

To translate the COBOL field formats to FOCUS field formats, consult the following table. Minimum values are shown for FOCUS USAGE lengths.

COBOL USAGE TYPE

COBOL PICTURE

BYTES OF INTERNAL USAGE STORAGE

FOCUS ACTUAL FORMAT

FOCUS USAGE FORMAT

DISPLAY

X(4)

4

A4

A4

DISPLAY

S99

2

Z2

P3

DISPLAY

9(5)V9

6

Z6

P8.1

COMP

S9

2

I2

I1

COMP

S9(4)

2

I2

I4

COMP

S9(5)

4

I4

I5

COMP

S9(9)

4

I4

I10

COMP-1

-

4

F4

F6

COMP-2

-

8

D8

D15

COMP-3

9

1

P1

P1

COMP-3

S9V99

2

P2

P5.2

COMP-3

9(4)V9(3)

4

P4

P8.3

For COMP-1 and COMP-2, allow for the maximum possible digits.

For COBOL DISPLAY fields with zoned decimal, FOCUS formats must be packed (P).

For COMP-1 and COMP-2, PICTURE is not permitted for internal floating-point formats (F and D).

Note: For network record-types, the ACTUAL and USAGE formats of zoned CALC and zoned index fields must be described as alphanumeric (A).

Field formats are fully described in your FOCUS documentation.



Example: Creating GROUP Field EMP_NAME

The following example illustrates how to create the GROUP field EMP_NAME:

GROUP=EMP_NAME   ,ALIAS=ENAME,USAGE=A25  ,ACTUAL=A25 ,$
 FIELD=FIRST_NAME,ALIAS=EFN  ,USAGE=A10  ,ACTUAL=A10 ,$
 FIELD=LAST_NAME ,ALIAS=ELN  ,USAGE=A15  ,ACTUAL=A15 ,$

The GROUP field called EMP_NAME is composed of two fields, FIRST_NAME and LAST_NAME. Notice the USAGE and ACTUAL formats.



Example: Creating Dummy Fields

The following example illustrates how to create a dummy field between a 1-byte alphanumeric field and a double precision floating-point field:

SEGNAME=EMPSTATUS,$
  FIELD=STATUS_CODE,SCODE,A1,A1,$
  FIELD=                 ,A7,A7,$
  FIELD=GROSS_SALES,GSALES,D12.2,D8,$

The same name and alias can be used for all dummy fields; this example uses blanks.



Example: Creating a Filler Field in a Segment Describing an LRF Record

The following example illustrates when to create a filler field in a segment describing an LRF record:

FILENAME=JOBMAST, SUFFIX=IDMS,$
 SEGNAME=JOBEMP, SEGTYPE=S,$
  FIELDNAME=JOBID,ALIAS=JID,USAGE=A4,ACTUAL=A4,$
  FIELDNAME=TITLE,ALIAS=JOBT,USAGE=A20,ACTUAL=A20,$ 
  FIELDNAME=DESCRIPTN,ALIAS=CMTS.END,USAGE=A120, ACTUAL=A120,$ 
  FIELDNAME=START_DTE,ALIAS=STDT,USAGE=A6YMD,ACTUAL=A6,$
  FIELDNAME=FINISH_DTE,ALIAS=FIDT,USAGE=A6YMD,ACTUAL=A6,$
  FIELDNAME=SALARY_GRADE,ALIAS=GRADE,USAGE=P4,ACTUAL=Z2,$
  FIELDNAME=SALARY,ALIAS=SLRY,USAGE=P10.2,ACTUAL=P5,$ 
  FIELDNAME=      ,ALIAS=FILL.END,USAGE=A1,ACTUAL=A8,$ 

The LR record called JOB-EMPOSITION is defined to the IDMS subschema with seven fields. The first three fields are derived from a physical (DML) record-type called JOB and the last four fields are from the EMPOSITION physical record-type.

In this example, the filler field corresponds to the last field of the EMPOSITION record-type because LRF records must lie on a double-word boundary. The IDMS filler field is stored to make the record length a multiple of eight. IDMS filler fields on physical record-types underlying LRF views must become filler fields in the Master File. These filler fields can have any field name or be blank. The ALIAS must include the .END suffix. Since the JOB record-type is 144 bytes (total of ACTUAL formats), it does not need filler; the last field, DESCRIPTN, only requires an alias with an .END suffix.


Top of page

x
The IDMS Database Key

The key of a network record-type corresponding to a segment can optionally be described as the last field in the segment. To specify a database key, use the following values:

Attribute

Valid Values

FIELDNAME=

Any unique valid FOCUS name.

ALIAS=

DBKEY

USAGE=

I10

ACTUAL=

I4

The key is used to select records from entry segments when screening on particular IDMS values in the user request. For a discussion of entry record retrieval, see CA-IDMS Record Retrieval Intervals.


Information Builders