As Focus can report both from its own database as well as from an external database , there must be a description for Focus that tells it of the nature of File (Fixed or Variable ) ,the Record names, the Field names, and the nature of the field ( Alpha Numeric, Integer , Packed etc..).
This description is stored in a separate file called a MASTER. In Mainframe Focus, there is an separate PDS where each member is a MFD. Each of which describes a particular file.
Generally the PDS is coded as **. MASTER. ** .
Let us learn on the characteristics of Master through this sample Master.
SEGNAME=EMPLOYEE, ( ==> similar to a Record of IDMS. )
FIELD = EMPLOYEE_ID , ALIAS= EID , USAGE= I9, ACTUAL = I9 , $
FIELD = LAST_NAME , ALIAS= LN , USAGE= A10, ACTUAL = A10 , $
FIELD = FIRST_NAME , ALIAS= FN , USAGE= A15, ACTUAL = A15 , $
FIELD = DEPARTMENT , ALIAS= DEPT. , USAGE= D9.2, ACTUAL = D9,$
SEGNAME = PRSNL_INFO, SEGTYPE = S1,PARENT = EMPLOYEE ( ==> owner
FIELD = SPOUSE_NAME, ALIAS = SN, USAGE = A25, ACTUAL = A25,$
FIELD = CHILDREN, , USAGE = I2, ACTUAL = I2,$
THE MFD HAS THREE PRIMARY ATTRIBUTES
· FILE ATTRIBUTE
· SEGMENT ATTRIBUTE
· FIELD ATTRIBUTE
· Focus has a extensive date format. A date
in the YMD format can be
displayed as DMY format in the report just by changing the edit option of the field that is used to display it to NEW_DATE/A6MDYY= This will cause a date like 980227 to be displayed as 02/27/1998
· Other date conversions include displaying a date as Monday , December 30 1985,
· This would involve defining the date format to /A6MtrDYY.
· Actual Attribute.
· This describes the type of data as it actually exists in the data base or file. The source of this
information is the cobol FD statements. This ACTUAL= exists in the MFD only when describing
an external data to FOCUS, Focus data bases do not need it.
There is an exclusive section for dates in FOCUS
1. Description attribute. It is used to include
a descriptive text for a field, and is ignored while
processing. Up to 44 characters can be included in this.
DESC==‘QUANTITY SOLD’, $
2. Title attribute. Is used to supply an optional Column title instead of the field name.
TITLE= ‘ Date of Birth’, $
3. Missing attribute. The default is OFF, if set to ON, Focus will distinguish a missing value
from an internally entered blank or Zero. This is useful in reports where Counts or Averages are done.
When Missing is set to ON, and a count is done, all missing fields are excluded, similarly with the case of Averages.
4. Field Type attribute.
This is used to create an index for a Field in a file. Note : Text fields cannot be
INDEXED , (i.e., FIELDS with USAGE=TX)
It is an internally stored and maintained table of values and the locations
of these ,and helps in
An index is mandatory if
1. A segment is to be cross referenced, esp by JOINS,
2. Create certain alternate view files
3. Use a FIND function in MODIFY
4. Speed up retrieval for a given field.
5. HELP MESSAGE ATTRIBUTE :
E.g.. FIELD = EMPLOYEE_ID,,USAGE = A6YMD, ACTUAL = A6,
HELPMESSAGE=‘ XXXXX ....TEXT.... XXXXX’ ,$
Text is one line with up to 78 characters long.
This text is displayed in the type area of MODIFY or CRTFORM . This could also be used to specify acceptable values for the fields.
6. OCCURS ATTRIBUTE :
Eg. OCCURS = n
If it is ‘n’ then ‘n’ describes the number of times that field occurs.
If field name, it names data set in the parent segment that is a counter containing the number
of occurrences of the descendent segments. ( Similar to COBOL's occurs depending on ..)
If variable, it indicates to Focus that the number of occurrences varies from record to record,
and Focus computes the number of occurrences from the field length.
In the MFD the entry for this would be as
7. POSITION ATTRIBUTE :
It is used to describe a structure in which a multiple number of occurrences of a field
occur in the middle of a record.
1. For Mainframe , the MFD must be always
be 80 characters long.
2. All must be in capitals, except the contents of TITLE and DESC attributes.
3. The contents of an single specification can spill over to as many lines and is ended by the
delimiter ‘ $ ‘.
Click here to learn on the basic verbs used in FOCUS