In this section: |
You will come across a variety of files when you use FOCUS. These files can be application files that you create, extract files that FOCUS creates as requested by your application, or work files that FOCUS creates as required by your application.
This topic describes FOCUS file allocation requirements and describes how to assign a logical name, or DDNAME, to a file or device for operating systems that support this feature.
In this section: |
Reference: |
FOCUS files fall into three categories: application files, extract files, and work files. This topic contains information about files and ways to define them in the UNIX and Linux environments.
Some files are automatically allocated by FOCUS, but there are times when you must explicitly define a file and its location. A FILEDEF command generates platform independent file paths for all portable platforms by creating FILEDEF syntax with application names.
The following tables describe the FOCUS files that you will use under UNIX and Linux. FOCUS uses file extensions to distinguish different file types.
Application Files
Extension |
Description |
---|---|
.mas |
Master File. |
.acx |
Access File. |
.fex |
Procedure (FOCEXEC). |
.foc |
FOCUS and XFOCUS data sources and external index. |
.dat |
Sequential data source. |
.sty |
FOCUS StyleSheet file. |
.err |
Error messages file or help text. |
.prf |
Profile. |
.htm .html .jpeg .gif .css .js .class .jar |
Files used for HTML files and styling for HTML files. |
Extract Files
File |
Description |
---|---|
HOLD |
Contains data saved using the HOLD command. |
SAVB |
Contains data saved using the SAVB command. |
SAVE |
Contains data saved using the SAVE command. |
.FTM |
Contains data saved using the HOLD, SAVB, or SAVE command. |
Note: Dialogue Manager output files must be allocated using the FILEDEF command in system or user profiles.
Work Files
File |
Description |
---|---|
FOCSORT |
Used during sorting. |
FOCPOST |
Sequential output file saved using the POST command. The PICKUP command reads it back in. |
FOCSML |
Used by Financial Modeling Language (FML). |
OFFLINE |
Used when the SET PRINT parameter is OFFLINE. |
SYSIN |
Directs input. |
SYSPRINT |
Directs output to the screen. |
You do not have to explicitly define most of your application files prior to referring to them. FOCUS dynamically allocates certain application files. Additionally, FOCUS dynamically defines all extract files and temporary work files to the operating system during a session.
FOCUS defines the following extract, output, and work files:
How to: |
For a file managed by the operating system, such as an ISAM or comma-delimited data file, the physical file name is the actual name of a file as it appears to the operating system. A logical name (or ddname) is a shorthand name that points to the physical file name. Logical names simplify code by allowing short names to be used in place of the longer physical file name.
The FILEDEF command assigns a logical name to a physical file name and specifies file attributes. You can explicitly define a file and its location to FOCUS using the FILEDEF command. This generates platform independent file paths for all portable platforms by creating FILEDEF syntax with application names. An allocation can be issued in a procedure and lasts for a single request.
It is recommended that instead of including an allocation in each procedure, you include all FILEDEF commands in a single file that you call with the -INCLUDE command at the beginning of each procedure. This enables you to make changes to your FILEDEF commands globally instead of changing the allocation information in each procedure.
The FILEDEF command is typically used in the following ways in operating systems that support this command:
You can also use the Universal Naming Convention (UNC) to assign logical names to files that are located on a server. In order to take advantage of the UNC you must first attach to the server you want to use. For information on attaching to a server or mapping network drives, consult your network administrator.
FILEDEF ddname DISK appname[/appnamea...]/filename [(APPEND] [LRECL n] [RECFM F]
where:
Is the logical name for the file. The ddname can be from one to eight characters. When used to associate a data source with a Master File, the ddname must match the name of the Master File.
Associates the specified ddname with a file.
Is the name of the application under APPROOT, or a nested application name, that contains the physical file.
Is the physical name of the file under the appname.
Appends records to the end of the file. Without this option, the file is overwritten.
Specifies the record length. n is an integer.
You must specify an LRECL value if the file is a SAVB file or fixed-format transaction file used in data maintenance (FIXFORM files) that contains binary values.
Specifies fixed length records.
You must specify an RECFM value if the file is a SAVB file or fixed-format transaction file used in data maintenance (FIXFORM files) that contains binary values.
FOCUS data sources (files with the .foc extension) that do not conform to the default naming convention are identified with the USE command, not FILEDEF. For information on the USE command, see the Describing Data manual.
To send output to the LPT1 port (provided that the machine is configured properly):
FILEDEF OFFLINE DISK LPT1
To search all directories on the search path for the NEW_EMPS.DAT file, set your APP PATH. For example:
APP PATH app1 app2 app3 ... appn
To append a report extract from the LIBRARY data source to the current content of the file LIB03.FTM:
FILEDEF SAVE DISK C:\LIBRARY\LIB03.FTM (APPEND
You can specify an LRECL equal to or greater than the implied LRECL for the request. For example, if the length of the longest line in the text file is seven characters, issue this command:
FILEDEF BIGLINE DISK BIGLINE.FTM (LRECL 7
How to: |
The ? FILEDEF command displays the ddnames assigned for various files, input and output.
? FILEDEF
Issuing the command
? FILEDEF
produces information similar to the following:
Lname Device Lrecl Recfm Append Expl Filename =============================================================== HOLD2 DISK 0 V N Y C:\VM\SMALL\HOLD2.FTM
How to: |
You can clear allocations by using FOCUS syntax.
FILEDEF ddname CLEAR
where:
Is the logical name. It may contain one to eight alphanumeric characters.
Clears the specified ddname.
In this section: |
This topic describes how FOCUS references and searches for application files.
When you do not change the default file type, you can prepare a report without issuing a FILEDEF command or other communication. When you change the default file type of a FOCUS data source, or the data source does not reside in a standard search path, you must issue the USE command. The USE command is discussed in the Describing Data manual.
Reference: |
A Master File contains metadata about a data source, and is identified with a file name and extension, for example, filename.mas. It consists of attributes that describe a data source. A Master File and the data source that it describes usually have the same name.
The description of a data source and all files it cross-references must be available whenever you refer to the data source.
For more information about how to generate Master Files, see the Describing Data manual.
The following rules apply:
Reference: |
For some data sources, an Access File supplements a Master File. An Access File includes additional information that completes the description of the data source. For example, it includes the full data source name and location. You need one Master File, and for some data sources one Access File, to describe a data source.
FOCUS searches for an Access File on the path using APP PATH logic.
The following rules apply:
Reference: |
A procedure contains your report requests and cannot have control characters. A procedure is identified with a file name and extension, for example, filename.fex.
Procedures can be simultaneously accessed and executed by all users. The device and directory must precede the procedure file name and extension for FOCUS to locate the procedure. If you specify a disk and a directory, you must include both the file name and the file extension (.fex) when calling the procedure.
FOCUS searches for a procedure on the path, using APP PATH logic.
The following rules apply:
Reference: |
FOCUS and XFOCUS data sources contain data written in FOCUS format. All FOCUS data sources have a record length of 4096 and a fixed length record format. The maximum size of a FOCUS data source is 2G. XFOCUS data source have a record length of 16K and a fixed length record format. XFOCUS data sources can be a maximum size of 16G.
A FOCUS or XFOCUS data source is identified with a file name and extension, for example, filename.foc for both types of data sources. The name of a FOCUS data source usually matches the name of the corresponding Master File. For example, if the Master File is ledger.mas, then the FOCUS or XFOCUS data source is ledger.foc. You can override this default with the USE command, described in the Describing Data manual.
The following rules apply:
An external index is a FOCUS data source that contains index, field, and segment information for one or more specified FOCUS data sources. The external index is independent of its associated FOCUS data source and is used to improve retrieval performance. In UNIX and Linux, the external index is automatically allocated as a permanent file when it is created using REBUILD.
FOCUS recognizes sequential data sources formatted in the following ways:
For details, see the Describing Data manual.
Reference: |
FOCUS StyleSheets enable you to style and produce reports that highlight key information. With StyleSheets, you specify various stylistic characteristics of a report and style report components individually. You can also use StyleSheets to define a hyperlink from any reporting object.
You can create StyleSheets externally or within a report request. For details, see the Creating Reports manual.
FOCUS searches for a FOCUS StyleSheet on the path, using APP PATH logic.
The following rules apply:
In this section: |
FOCUS creates all extract files in a temporary directory, unless you use an APP HOLD command, an APP HOLDDATA command, or FILEDEF the file to a permanent file in a permanent directory.
How to: |
A HOLD extract file is a sequential data source that contains the results of a report request. It may have a corresponding HOLD Master File. The extension for a HOLD file is .ftm unless you specify the FORMAT option. If a Master File is created, it has the same name as the extract file, with the extension .mas.
ON TABLE HOLD [AS [app/]filename]
where:
Is a name for the HOLD file. If you do not specify a file name, HOLD is used as the default name. Since each subsequent HOLD command overwrites the previous HOLD file, it is useful practice to code a distinct file name in each request to direct the extracted data to a separate file, preventing it from being overwritten.
For the complete syntax with all options, see the Creating Reports manual.
How to: |
A SAVB file is an extract file containing the results of a report request in internal format. That is, all numeric fields are stored in binary, and all character fields are padded with spaces to a multiple of four bytes. The file cannot be printed.
ON TABLE SAVB [AS [app/]filename]
where:
Is the name of the file. The default is SAVB. The default extension is .ftm.
How to: |
A SAVE file is an extract file that saves the data of a report, but does not save headings, or subtotals, or create a Master File. It is a simple sequential character data file and can be used by other programs, or merged into another data file using a data maintenance request. The default format is simple character, although you can specify formats compatible with many other software products. FOCUS saves all columns in the report in printable, character format with no spaces between columns.
A SAVE file contains the external character format equivalent to SAVB. The command format and allocations are the same as SAVB. However, the numbers are printable American Standard Code for Information Interchange (ASCII) characters and no padding takes place.
ON TABLE SAVE [AS [app/]filename]
where:
Is the name of the file. The default is SAVE. The default extension is .ftm.
How to: |
A HOLDMAST file is a temporary Master File. Master Files for HOLD files will be created in a temporary directory unless the HOLD command contains an application name (app/filename) or an APP HOLD or APP HOLDMETA command is issued, which specifies its location.
If the HOLD file was created under the default name HOLD, the FILEDEF command can be used in conjunction with the APP HOLDMETA syntax to designate a logical name to the HOLD file and respective Master File.
APP HOLDMETA app_name
where:
Is a valid application directory.
The following example sets a logical name for the HOLD file with FILEDEF and specifies a location for the Master File with APP HOLDMETA:
FILEDEF SALES DISK app1/sales.ftm APP HOLDMETA app1 TABLE FILE GGSALES SUM DOLLARS BY CATEGORY ON TABLE HOLD AS SALES END
The name of the Master File is derived from the ON TABLE HOLD AS filename name, which specifies sales as the logical name for the physical data source (sales.ftm). The Master File is given the same file name with the extension .mas (sales.mas). Both of these files are placed in application directory app1 as permanent files.
Note: Other methods for creating both the HOLD file and Master File in an application directory include the following:
To report on the HOLD file, you need to issue a FILEDEF command (unless the Master File has a DATASET attribute that points to the file). For example:
FILEDEF SALES DISK app1/sales.ftm TABLE FILE SALES PRINT * END
FOCUS creates work files as required by your application. FOCUS creates all extract files in a temporary directory unless you issue an APP HOLD command or FILEDEF the file to a permanent directory.
The available work files are:
The following command sends further report output to the file EMPL OUTPUT A with a fixed length record format and a record length of 80 bytes:
OFFLINE FILEDEF OFFLINE DISK TMP/EMPL.OUT (RECFM F LRECL 80)
|
Information Builders |