Creating Master and Access Files

There are two methods for creating Master and Access Files.

FOCUS file descriptions can represent an entire table or part of a table. Also, several pairs of file descriptions can define different subsets of columns for the same table, or one pair of Master and Access Files can describe several tables. This chapter presents single-table Master and Access Files. For multi-table file descriptions, see Multi-Table Structures.

You can represent tables with repeating columns as FOCUS OCCURS segments. See The OCCURS Segment for an explanation of these virtual constructs.

FOCUS processes a request with the following steps.

  1. It locates the Master File for the table. The file name specified in the report request identifies the Master File by its member name.
  2. It detects the SUFFIX value, DB2, SQLDS, SQLDBC, SQLORA, or SQLIDMS, in the Master File. Since this value indicates that the data is in an RDBMS table, FOCUS passes control to the appropriate relational adapter.
  3. The adapter locates the corresponding Access File, uses the information contained in both descriptions to generate the SQL statements required by the request, and passes the SQL statements to the RDBMS.
  4. The adapter retrieves the answer sets generated by the RDBMS and returns control to FOCUS. Depending on the requirements of the request, FOCUS may perform additional processing on the returned data.

This example is a Master File for the DB2 table EMPINFO.

FILENAME=EMPINFO       ,SUFFIX=DB2,$
 
SEGNAME=EMPINFO        ,SEGTYPE=S0,$
 FIELD=EMP_ID          ,ALIAS=EID        ,USAGE=A9    ,ACTUAL=A9,$
 FIELD=LAST_NAME       ,ALIAS=LN         ,USAGE=A15   ,ACTUAL=A15,$
 FIELD=FIRST_NAME      ,ALIAS=FN         ,USAGE=A10   ,ACTUAL=A10,$
 FIELD=HIRE_DATE       ,ALIAS=HDT        ,USAGE=YMD   ,ACTUAL=DATE,$
 FIELD=DEPARTMENT      ,ALIAS=DPT        ,USAGE=A10   ,ACTUAL=A10, 
MISSING=ON,$
 FIELD=CURRENT_SALARY  ,ALIAS=CSAL       ,USAGE=P9.2  ,ACTUAL=P4,$
 FIELD=CURR_JOBCODE    ,ALIAS=CJC        ,USAGE=A3    ,ACTUAL=A3,$
 FIELD=ED_HRS          ,ALIAS=OJT        ,USAGE=F6.2  ,ACTUAL=F4, 
MISSING=ON,$
 FIELD=BONUS_PLAN      ,ALIAS=BONUS_PLAN ,USAGE=I4    ,ACTUAL=I4,$
 FIELD=HIRE_DATE_TIME ,ALIAS=HDTT        ,USAGE=HYYMDm ,ACTUAL=HYYMDm ,
MISSING=ON,$
 FIELD=HIRE_TIME      ,ALIAS=HT          ,USAGE=HHIS   ,ACTUAL=HHIS   ,
MISSING=ON,$

The following is an Access File for the table EMPINFO.

SEGNAME = EMPINFO, TABLENAME = "USER1"."EMPINFO", KEYS = 1,
 WRITE = YES,  DBSPACE = PUBLIC.SPACE0,$

File Descriptions and Tables contains a complete list of Master Files and Access Files for the examples cited in this manual.


Information Builders