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.)
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.
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.
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.
EXEC procedurename
or
EX procedurename
where:
Is the name of the procedure to be executed. This corresponds to the file name.
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:
Is the name of the procedure to be executed. This corresponds to the file name.
Is procedure type.
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'
If a procedure is stored as
SALES REPORT A
To execute, enter:
EX 'SALES REPORT'
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.
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.
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.
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.
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.
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.
ENCRYPT FILE filename [filetype [filemode]]
where:
Is the name of the FOCUS file.
Is the file type. The default is MASTER.
Is the file mode. The default is A.
The command
ENCRYPT FILE EMPLOYEE
encrypts the file EMPLOYEE MASTER A.
DECRYPT FILE filename [filetype [filemode]]
where:
Is the name of the FOCUS file.
Is the file type. The default is MASTER.
Is the file mode. The default is A.
RESTRICT filename [filetype [filemode]] filename [filetype [filemode]] . . . END
where:
Is the name of the FOCUS file.
Is the file type. The default is FOCUS.
Is the file mode. The defaults is A.
The command
RESTRICT EMPLOYEE SALES PROD FOCUS C END
restricts the files EMPLOYEE FOCUS A, SALES FOCUS A, and PROD FOCUS C.
How to: |
The FOCUS User-Written Subroutine Library, FUSELIB, contains additional calculation and utility routines.
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
How to: |
Window files contain the windows, menus, and related information created by Window Painter. There are three types of window files:
Compiled window files are created on the A disk. Once they are created, they can be moved to any other disk. They have a 4096-byte record length and a fixed-length record format.
When window transfer files are created by mainframe FOCUS Window Painter, they are created on the A disk. When they are transferred from PC/FOCUS, they are transferred to the disk specified in the prior CMS FILEDEF command. Once they are created or transferred, they can moved to any disk. Transfer files have an 80-byte record length and a fixed-length record format.
The Document the file option of the Window Painter Utilities Menu also creates a file with a TRF-file type. If you need to create both TRF files (a documentation file and a transfer file) for a given compiled window file, be sure to give the two TRF files different file names. Otherwise, the second TRF file will be appended to the first one.
Window documentation files are created on the A disk. Once they are created, they can be moved to any other disk. They have a an 80-byte record length and a fixed-length record format.
The Create a transfer file option of the Window Painter Utilities Menu also creates a file with TRF file type. If you need to create both TRF files (a documentation file and a transfer file) for a given compiled window file, be sure to give the two TRF files different file names. Otherwise, the second TRF file will be appended to the first one.
filename FMU
where:
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.
filename TRF
where:
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.
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.
{MVS|CMS} VSAM SET AMODE {24|31}
where:
Specifies the operating system.
Specifies AMODE 24. FOCSAM builds ACBs and buffers in 24-bit addresses.
Specifies AMODE 31. FOCSAM builds ACBs and buffers in 31-bit addresses. 31 is the default value.
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.
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
How to: |
To record output from either the TRACE or ECHO option of MODIFY in a file, you must first define the file.
FILEDEF HLIPRINT DISK fileid (RECFM recfm LRECL lrecl
where:
Is the CMS fileid of the file receiving the TRACE or ECHO output.
Is the format of the file (F for fixed, V for variable).
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.
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
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.
filename FOCEXEC A filename TTEDIT A
where:
Is the CMS file name you specify in TableTalk.
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.
The fileids for a HOLDSTAT file are
{HOLDSTAT|fn} [MASTER|ERRORS] [fm|A]
where:
Is the file name of your customized HOLDSTAT file.
Specifies the MASTER file type. When FOCUS searches for the HOLDSTAT file, the MASTER file type takes precedence over the ERRORS file type.
Specifies the ERRORS file type.
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.
If you create your own HOLDSTAT file, consider the following rules:
$BOTTOM
END
DBA=password,$
You may include other DMA attributes such as USER, ACCESS, RESTRICT, NAME, and VALUE. For information about the DBA attribute, see the Describing Data manual.
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 |