Application Files

In this section:

 

The following topics describe how FOCUS references and searches for your application files such as Master Files, FOCEXEC files (stored procedures), FOCUS data sources, FOCCOMP files, and external data files. It also describes the various functions of the USE command.

When you do not change the default file types and the default file mode (A), you can enter FOCUS and prepare reports, or modify data without issuing any FILEDEF commands or other communication. When you rename the default file type of a FOCUS data source, or use a data source on a disk other than the A disk, you must issue the USE command when you enter FOCUS. (The USE command is discussed in the Describing Data manual.)


Top of page

x
Master Files

Master Files have the file type MASTER and consist of parameter lists that describe data sources to FOCUS. The description of a FOCUS data source and all data sources it cross-references must be available whenever you refer to the data source. Generally, the description and the data source both reside on the A disk, although descriptions do not have to be on the same disk as the data. In this way, many users may share the same set of Master Files, yet use different data sources.

The Master File and the data source it is describing usually have the same file name. The maximum LRECL for a variable length file is 32756 bytes; for a fixed length file, the maximum length is 32760 bytes. The record format can be fixed or variable. TED can only work with Master Files that consist of fixed or variable-length records up to 160 bytes long.

Note: All disks are searched when a Master File is needed. That is, the standard CMS search order is used (A then B, and so on) until the Master File is found or no more disks exist to be searched.


Top of page

x
Access Files

Access Files for FOCUS data sources have the file type ACCESS. They are optional except for intelligent partitioning of FOCUS data sources. For information, see the Describing Data manual. The maximum LRECL for a variable length file is 32756 bytes; for a fixed length file, the maximum length is 32760 bytes. The record format can be fixed or variable.

Note: All disks are searched when an Access File is needed. That is, the standard CMS search order is used (A then B, and so on) until the Access File is found or no more disks exist to be searched.


Top of page

x
FOCEXEC or Maintain Files

How to:

Stored procedures can be saved under any CMS file name and file type. They are most conveniently filed under the file type FOCEXEC. Maintain procedures can conveniently have FILETYPE MAINTAIN. For details, see the Maintaining Databases manual. The maximum LRECL for a variable length file is 32756 bytes and for a fixed length file the maximum is 32760. The record format can be fixed or variable. TED can only work with FOCEXECs that consist of fixed or variable-length records up to 160 bytes long.



x
Syntax: How to Execute a FOCEXEC Stored Procedure
EXEC procedurename

or

EX procedurename

where:

procedurename

Is the name of the procedure to be executed. This corresponds to the file name.



x
Syntax: How to Execute a Non-FOCEXEC Stored Procedure

If you do not use the file type FOCEXEC, the full file name and file type must be enclosed in single quotation marks when you execute the procedure (since the identifier will contain an embedded blank). The syntax for this is:

EXEC 'procname proctype procmode' 

or

EX 'procname proctype procmode' 

where:

procname

Is the name of the procedure to be executed. This corresponds to the file name.

proctype

Is procedure type.

procmode

Is the procedure type. The default file mode is *. This means that the standard CMS disk search order is used (for example, A then B, and so on). Therefore, stored procedures may reside on central disks and be made simultaneously accessible to many users.

This type of identification can be useful when you need to group or sort many similar procedures.

In addition, users can execute a procedure from a specific minidisk by specifying:

EX 'filename filetype filemode'


Example: Executing a Non-FOCEXEC Stored Procedure

If a procedure is stored as

SALES REPORT A

To execute, enter:

EX 'SALES REPORT'

Top of page

x
PROFILE FOCEXEC

In CMS, the PROFILE procedure must be named

PROFILE FOCEXEC A

unless the PROFILE option of the EX FOCUS command is used. (See How to Enter FOCUS for more information.) Only the A disk or read-only extensions of the A disk (for example C/A) will be searched. The PROFILE will be executed before control is passed to the terminal.


Top of page

x
StyleSheet Files

StyleSheet files can be saved under any CMS file name and have file type FOCSTYLE. The record format is fixed length with LRECL=80. For details, see the Creating Reports manual.


Top of page

x
FOCUS Data Sources

FOCUS data sources contain data written in FOCUS format. FOCUS data sources have a record length of 4096 and a fixed-length record format. XFOCUS data sources have a record length of 16384 and a fixed-length record format. See the Describing Data manual for information about maximum file size and partitioning. Each data source has a file name that matches the name of its Master File, and has a file type of FOCUS. For example, if the data source's Master File is LEDGER MASTER, then the FOCUS data source is LEDGER FOCUS. You can override these defaults with the USE command, a DATASET attribute in the Master File, or an Access File. These techniques are explained in the Describing Data manual.


Top of page

x
External Indices for FOCUS Data Sources

An external index is a FOCUS file 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 CMS, the external index is automatically defined as a permanent file when it is created using REBUILD.


Top of page

x
MDIs for FOCUS Data Sources

An MDI is a separate multi-field index file for one or more FOCUS databases. The MDI is independent of its associated FOCUS database and is used to improve retrieval performance. In CMS, the MDI is automatically allocated as a permanent file when it is created using REBUILD.


Top of page

x
Database Security: ENCRYPT, DECRYPT, and RESTRICT

How to:

Since the restriction information for a FOCUS data source is stored in its Master File, you will want to encrypt the Master File in order to prevent users from examining the restriction rules. Only the Database Administrator can encrypt a Master File. If you wish to change restrictions, the process can be reversed using the DECRYPT command to restore the Master File to a readable form. You can add security limitations to existing data sources using the RESTRICT command.



x
Syntax: How to Encrypt a FOCUS File
ENCRYPT FILE filename [filetype [filemode]]

where:

filename

Is the name of the FOCUS file.

filetype

Is the file type. The default is MASTER.

filemode

Is the file mode. The default is A.



Example: Encrypting a FOCUS File

The command

ENCRYPT FILE EMPLOYEE

encrypts the file EMPLOYEE MASTER A.



x
Syntax: How to Decrypt a FOCUS File
DECRYPT FILE filename [filetype [filemode]]

where:

filename

Is the name of the FOCUS file.

filetype

Is the file type. The default is MASTER.

filemode

Is the file mode. The default is A.



x
Syntax: How to Restrict a FOCUS File
RESTRICT 
filename [filetype [filemode]] 
filename [filetype [filemode]]
.
.
.
END

where:

filename

Is the name of the FOCUS file.

filetype

Is the file type. The default is FOCUS.

filemode

Is the file mode. The defaults is A.



Example: Restricting a FOCUS File

The command

RESTRICT
EMPLOYEE
SALES
PROD FOCUS C
END

restricts the files EMPLOYEE FOCUS A, SALES FOCUS A, and PROD FOCUS C.


Top of page

x
FUSELIB

How to:

The FOCUS User-Written Subroutine Library, FUSELIB, contains additional calculation and utility routines.



x
Syntax: How to Access the FUSELIB Library

Issue the following CMS command before attempting to use one of these routines:

GLOBAL TXTLIB FUSELIB

Top of page

x
FOCCOMP Files

How to:

The FOCCOMP file contains the output from the COMPILE command. The FOCCOMP file is used to run the compiled MODIFY procedure:

RUN focexecname


x
Syntax: How to Create a FOCCOMP File
filename FOCCOMP

where:

filename

Is the CMS file name of the FOCEXEC file that was compiled with the COMPILE command. The procedure has a variable-length record format and a record length of 4092.


Top of page

x
Window Files

How to:

Window files contain the windows, menus, and related information created by Window Painter. There are three types of window files:



x
Syntax: How to Identify Compiled Window Files
filename FMU

where:

filename

Is the name chosen by the user during the Window Painter session that creates the file, or else is the name specified in the WINDOW COMPILE command that creates the file.



x
Syntax: How to Identify Window Transfer Files
filename TRF

where:

filename

Is the name chosen by the user when the transfer file is created by mainframe FOCUS Window Painter, or the name specified in the CMS FILEDEF command when the transfer file is transferred from PC/FOCUS.



x
Syntax: How to Identify Window Documentation Files
filename TRF

where:

filename

Is the name chosen by the user when the documentation file is created by Window Painter.


Top of page

x
Non-FOCUS Data Sources

How to:

You can use the FOCUS query language to read non-FOCUS data sources. FOCUS can read QSAM, ISAM, VSAM files; IMS, CA-IDMS/DB, ADABAS, MODEL 204 database files; and Teradata, CA-DATACOM/DB, Oracle, and SQL tables.

Non-FOCUS data sources must be defined to the operating system. You can let FOCUS issue default FILEDEF commands for your data sources, provided the files are either comma-delimited (COM) or fixed-format (FIX) files, where every record is a fixed- length, 80-character record. If a comma-delimited or fixed-format file has a record length other than 80, you must issue a FILEDEF.

For VSAM (KSDS or ESDS) files, use the standard DLBL commands to filedef the files prior to entering FOCUS. VSAM files exist only on OS or DOS disks (not on CMS disks). The Master Catalog must be defined. The dsname must be the VSAM cluster name. Use the IDCAMS utility to obtain it. The CMS LISTFILE command cannot be used for this purpose.

A SET command is available to switch the AMODE of the FOCSAM Interface (which reads VSAM and flat files) to 24-bit addressing. The Interface runs in 31-bit mode by default, in order to take advantage of modern operating system architecture. By extension, the Interface also builds 31-bit addresses for VSAM buffers and ACBs. However, some external VSAM buffering packages run in 24-bit mode, and do not recognize 31-bit addresses. The SET AMODE command allows the Interface to be run with these 24-bit programs.



x
Syntax: How to Set the VSAM Addressing Mode
{MVS|CMS} VSAM SET AMODE {24|31}

where:

MVS|CMS

Specifies the operating system.

24

Specifies AMODE 24. FOCSAM builds ACBs and buffers in 24-bit addresses.

31

Specifies AMODE 31. FOCSAM builds ACBs and buffers in 31-bit addresses. 31 is the default value.



x
Syntax: How to Query the Addressing Mode

To determine the addressing mode that is in effect at any time, you can issue the query

{MVS|CMS} VSAM SET ?

This query returns output similar to the following:

(FOC1177)  SET OPTIONS - : BUFND = n / BUFNI = n / AMODE = n

If you are not using any external programs or buffering packages that require 24-bit addresses for the ACB or buffers, you will not need to change the default.



Example: Defining a VSAM File to the Operating System

The following defines a VSAM file to CMS:

LINK VSAMDISK 191 192 R
ACC 192 B
DLBL IJSYSCT B DSN MASTER CAT (VSAM PERM)
DLBL CUST B DSN CUST DATA (VSAM PERM)

The allocation statements for a VSAM alternate index on CMS are:

DLBL CUST B DSN CUST DATA  (VSAM PERM
DLBL DD1  B DSN CUST PATH1 (VSAM PERM
DLBL DD2  B DSN CUST PATH2 (VSAM PERM

Top of page

x
TRACE Files

How to:

To record output from either the TRACE or ECHO option of MODIFY in a file, you must first define the file.



x
Syntax: How to Define a Trace File
FILEDEF HLIPRINT DISK fileid (RECFM recfm LRECL lrecl

where:

fileid

Is the CMS fileid of the file receiving the TRACE or ECHO output.

recfm

Is the format of the file (F for fixed, V for variable).

lrecl

Is the file record length. The record length should be at least 32 for the TRACE option and at least 80 for the ECHO option.

If you are displaying output from the TRACE or ECHO option on the terminal, no allocation is necessary.



Example: Defining the Trace File

This request stores output from the TRACE option in the file TRACE OUTPUT A:

CMS FILEDEF HLIPRINT DISK TRACE OUTPUT (RECFM F LRECL 32)
MODIFY FILE EMPLOYEE TRACE
PROMPT EMP_ID CURR_SAL
IF CURR_SAL GT 50000 GOTO HIGHSAL
ELSE GOTO UPDATE;
CASE UPDATE
MATCH EMP_ID
   ON MATCH UPDATE CURR_SAL
   ON NOMATCH REJECT
ENDCASE
CASE HIGHSAL
TYPE
   " "
   "YOU ENTERED A SALARY ABOVE $50,000"
   " "
PROMPT CURR_SAL.PLEASE REENTER THE SALARY BELOW.
IF CURR_SAL GT 50000 GOTO HIGHSAL
ELSE GOTO UPDATE;
ENDCASE
DATA

Top of page

x
TTEDIT Files

How to:

Reference:

When you save a TableTalk session, a command file and a session file are saved. The command file has file type FOCEXEC and the session file has file type TTEDIT. Both files are created on the A disk. Each file has a fixed- length record format and a record length of 80. You can also edit a previous TableTalk session.



x
Reference: TTEDIT File ID
filename FOCEXEC A 
filename TTEDIT A

where:

filename

Is the CMS file name you specify in TableTalk.



x
Syntax: How to Edit a Saved TableTalk Session
TABLETALK EDIT [filename]

where:

filename

Is the CMS file name you specified in the saved TableTalk session. If you omit the file name, a list of all TTEDIT files will be displayed. Include a file name to edit a particular saved TableTalk session.


Top of page

x
HOLDSTAT Files

How to:

Reference:

HOLDSTAT files enable you to include FOCUS DBA information and environmental comments in HOLD and PCHOLD Master Files. You may create your own and specify its file name with the SET HOLDSTAT command or use the HOLDSTAT ERRORS file supplied by Information Builders.

The contents of a HOLDSTAT file are included automatically into HOLD and PCHOLD Master Files when report requests are executed. To include its contents, a HOLDSTAT file must be available and the SET HOLDSTAT command must be specified. For information about the SET HOLDSTAT command, see the Developing Applications manual.



x
Syntax: How to Specify a HOLDSTAT File

The fileids for a HOLDSTAT file are

{HOLDSTAT|fn} [MASTER|ERRORS] [fm|A]

where:

fn

Is the file name of your customized HOLDSTAT file.

MASTER

Specifies the MASTER file type. When FOCUS searches for the HOLDSTAT file, the MASTER file type takes precedence over the ERRORS file type.

ERRORS

Specifies the ERRORS file type.

fm

Is the file mode of the disk.

A HOLDSTAT file may contain environmental comments like a file header, or the FOCUS DBA attribute, or both. The supplied HOLDSTAT ERRORS file contains the following file header with Dialogue Manager system variables:

$ ===================================================================== $
$      HOLD file created on &DATE at &TOD by FOCUS &FOCREL              $
$              Database records retrieved= &RECORDS                     $
$              Records in the HOLD file = &LINES                        $
$ ===================================================================== $

In the HOLD Master File, the comments appear after the FILE and SUFFIX attributes and the DBA information is appended to the end.



x
Reference: Rules for Creating a HOLDSTAT File

If you create your own HOLDSTAT file, consider the following rules:


Top of page

x
Winform Files

All of a Maintain procedure's Winforms are contained in a file with the file type WINFORMS. A Maintain procedure's WINFORMS and FOCEXEC files must have the same file name. The maximum LRECL for a variable length file is 32756 bytes; for a fixed length file, the maximum length is 32760 bytes. The record format can be fixed or variable. TED can only work with WINFORMs that consist of fixed or variable-length records up to 160 bytes long. When searching for WINFORMS files, FOCUS uses the standard CMS search order.

Users create and edit Winforms using the Winform Painter. Users should make changes to WINFORMS files using the Painter only, and should not attempt to edit them directly. All changes made outside the Painter are lost the next time the file is edited in the Painter.


Information Builders