Spacer

Guidlines to Writing Focexecs

Spacer

 

1. Report output should indicate the name of the FOCEXEC that generated it.

2. Do not code focexecs with any blank lines. If you must have a blank lines between sections of code then precede it the -*, which indicates a comment.

3. JOINS should not be duplicative or unnecessary. Remember that many JOINS to other master files have already been made by UITS. If a join has been made to another master file it will be indicated at the end of the master file descriptions as "Cross Reference File".

4. If you use JOIN statements in your focexec, be sure to specify join names rather than allowing it to default: JOIN ACCOUNT_NUM IN D9530F09 TO ACCOUNT_NUM IN D9530F14 AS JOIN1.

5. If you change the default FOCUS environment within the focexec, make sure to reset it back at the end of the focexec. Example: Near the top of your focexec, you decide to enter the command SET ALL=Pass in order to retrieve short-pathed records. At the end of your focexec, after the End statement, you must add: SET ALL=FOCUS to reset the environment.

6. Except in rare situations, field references should use the Aliases rather than the fieldname. For instance, a master file has the following field description: Field=FG005_FGRT, Alias=ACCOUNT_NUM. When writing your focexec you will use ACCOUNT_NUM to identify the field, not the FG005_FGRT.

7. Use the standard documentation setup at the beginning of your focexec. Remember that comment sections are preceded by a -*. Here is an example of what should be seen at the beginning of a focexec:

00000 * * * Top of File * * *

00001 -* F9530U04 FOCEXEC

00002 -**********************************************************

00003 -* REVISED: 03/14/01 BY CBM - INCLUDES SUBTOTALS *

00004 -* REVISED: 02/26/01 BY CBM - YEAR SELECTION EDIT *

00005 -* REVISED: 02/08/01 BY CBM - TO MEET FOCUSADM STNDS *

00006 -* CREATED: 04/17/00 BY C.MCEVITT *

00007 -**********************************************************

00008 -* NAME: F9530U04 FOCEXEC *

00009 -* SYSTEM: FINANCIAL RECORDS SYSTEM *

00010 -*TITLE: ACCOUNT TRANSACTIONS *

00011 -* FILES USED: D95**F09 & D95**F15 * 00015,-*

00012 -* FUNCTION: DISPLAYS DATE, PO OR DOCUMENT #, VENDOR, *

00013 -* DESCRIPTIONS, ENCUMBRANCES, AND ACTUAL *

00014 -* EXPENSES FOR A SPECIFIED DATE RANGE. *

00015 -**********************************************************

 

8. Document your 'define' sections and any 'compute', 'where' and 'if ' tests by inserting comment lines before the particular code in the program. This aides other users & auditors in understanding how the program works.

9. Avoid using FOCUS reserve names to define fields. For instance, do not define fields with names such as COLUMN, TABLE, ROW, etc.

10. Anytime you do MATCHFILES be sure to use the command "on table hold as......" after the match has taken place. Do not assume Focus understands that there is an unnamed hold file that it should be using to table file against.

11. If your program works without using the "SET EXTSORT = OFF/ON" command, then don't use it unnecessarily.

12. Report output should indicate the Report Date, since it will reflect the date the report was executed. It is recommended that the 4-digit year is used. Using the &DATEMDYY will produce a date with a 4-digit year in the header.

508 UsableNet Approved (v. 1.2.1)

Last Updated 11/30/01 CBMcEvitt