You are on page 1of 36

FOCUS

------------------------------------------------------------------
GETTING INTO FOCUS
------------------------------------------------------------------

FOCBEGIN/FOCSTART
- A CLIST that allocates all the files necessary
to run Focus. Only need to do it once during
a TSO session.
FOCUS
- Use after you have used FOCBEGIN during a
TSO session.
TABLE FILE filename
(commands)
END

QUIT
FIN
- Get out of Focus

ONLINE FILE ALLOCATION


In order for focus to read information from a data file it is necessary to first tell FOCUS
where the data resides and give a description of how the data is arranged on the file. This
is done with a file allocation statement.

The first kind of file allocation we need to talk about is the on-line file allocation. The
format of the on-line file allocation is as follows:

*************************************************************
>> TSO ALLOC F(SCHEMA) DS('DATA.SET.NAME') SHR
*************************************************************

An EXAMPLE of a typical allocate statement is the following.

>> TSO ALLOC F(CONAMES) DS('INFOCTR.FOCFILE.CONAMES') SHR

After the allocation has been done you can now do a ‘TABLE FILE CONAMES' and print any field
names in the schema.

*** You can use the ALLOCATE in 'FOCUS.PROD.EXEC'Browse the dataset for the allocate -
CONMALLC

VERBS
¤ PRINT
¤ LIST
¤ SUM/WRITE
¤ COUNT

Request: TABLE FILE FOCUSEXP


PRINT COID AND REGNO
END
Output:
+--------------------------------------------------------+
| COMPANY_ID REGION_NO |
| ---------- --------- |
| 11701 01 |

Request: TABLE FILE FOCUSEXP


LIST COID AND ACCTNO
END
Output:
+--------------------------------------------------------+
| LIST COMPANY_ID ACCOUNT_NO |
| ---- ---------- ---------- |
| 1 11701 10001 |
| 2 11701 10200 |

Request: TABLE FILE FOCUSEXP


PRINT ACCTNO AMT
BY COID
END
Output:
+-------------------------------------------------------+
| COMPANY_ID ACCOUNT_NO AMOUNT |
| ---------- ---------- ------ |
| 11701 10001 5,000.00 |
| 10200 404.00 |
| 20030 3,000.00 |
| 34600 200.00 |
| 70210 1,000.00 CR |

High-to-Low
+-------------------------------+
| BY (HIGHEST) {n} sortfield |
+-------------------------------+

Request: TABLE FILE EMPLOYEE


PRINT LAST_NAME AND FIRST_NAME
BY HIGHEST CURR_SAL
END

TERMINATING FOCUS

END
¤ Terminates a FOCUS request.
¤ Function is processed.
¤ User is returned to FOCUS command level.

RUN
¤ Terminates report request.
¤ Report is processed.
¤ User remains within table environment.
¤ Do not repeat TABLE FILE filename.
¤ Will see "T>".

QUIT
¤ Terminates a FOCUS request.
¤ Request is not processed.
¤ User is returned to FOCUS command level.
¤ Used to end invalid commands.

OFFLINE

Request: TABLE FILE EMPLOYEE


PRINT LAST_NAME FIRST_NAME
END

Output:
+---------------------+
| PAGE 1 |
| LAST_NAME FIRST_NAME|
| --------- ----------|
| STEVENS ALRED |
| . . |
| . . |
| . . |
+---------------------+

Then:
> OFFLINE (Press ENTER)
> RETYPE (Press ENTER)
> ONLINE (Press ENTER)

¤ Report request must end with END.


¤ OFFLINE command may be issued before report request.
¤ No other FOCUS commands may be entered between OFFLINE and
RETYPE or report will not be available.

SUM VERB

Request: TABLE FILE EMPLOYEE TABLE FILE EMPLOYEE


PRINT CURR_SAL SUM CURR_SAL
BY DEPARTMENT BY DEPARTMENT
END END
Ouput:
+----------------------------+ +--------------------------------+
| DEPARTMENT CURR_SAL | | DEPARTMENT CURR_SAL |
| ---------- -------- | | ---------- -------- |
| MIS $13,200.00 | | MIS $108,002.00 |
| $18,480.00 | | PRODUCTION $114,282.00 |
| $18,480.00 | | |

COUNT
¤ If there is a BY phrase, the count represents the number of times a field is encountered
within that sortfield.
¤ If there are no BY phrases, the count represents the number of times the field is
encountered within the entire file.
¤ The word COUNT is placed in the column heading beneath the fieldname.

COUNT object1(...object95)

Request: TABLE FILE EMPLOYEE TABLE FILE EMPLOYEE


PRINT CURR_SAL COUNT CURR_SAL
BY DEPARTMENT BY DEPARTMENT
END END

Output:

+-----------------------------+ +-------------------------+
| | | CURR_SAL |
| DEPARTMENT CURR_SAL | | DEPARTMENT COUNT |
| ---------- -------- | | ---------- -------- |
| MIS $13,200.00 | | MIS 6 |
| $18,480.00 | | PRODUCTION 6 |
| $18,480.00 | | |
| $21,780.00 | | |

COUNT *

Request: TABLE FILE EMPLOYEE


COUNT *
END
Output:

+--------------+
| COUNT * |
| COUNT |
| ------- |
| 19 |
+--------------+
SORT

+---------------------------------------------------------+
| BY (HIGHEST) sortfield (IN-GROUPS-OF quantity) |
+---------------------------------------------------------+
¤ Sortfield must be numeric
¤ IN-GROUPS-OF must be used with the BY phrase.
¤ If BY sortfield, then 1 line for each field value.
¤ If BY sortfield IN-GROUPS-OF n, then 1 line for each category.
Values Appear as Category
------ --------
0 - 9-------------------------------0
10 - 19------------------------------10
20 - 29------------------------------20

Request: TABLE FILE EMPLOYEE TABLE FILE EMPLOYEE


SUM ED_HRS SUM ED_HRS
BY CURR_SAL BY CURR_SAL IN-GROUPS-OF 5000
END END

Output:
+------------------------+ +---------------------------+
| CURR_SAL ED_HRS | | CURR_SAL ED_HRS |
| -------- ------ | | -------- ------ |
| $9,000.00 25.00 | | $5,000.00 35.00 |
| $9,500.00 10.00 | | $10,000.00 61.00 |
| $11,000.00 25.00 | | $15,000.00 100.00 |
| $13,200.00 36.00 | | $20,000.00 80.00 |

Request: TABLE FILE EMPLOYEE


SUM ED_HRS
RANKED BY TOP 10 CURR_SAL
END
Output:
+---------------------------------------+
| RANK CURR_SAL ED_HRS |
| ---- -------- ------ |
| 1 $29,700.00 .00 |
| 2 $27,062.00 45.00 |
| 3 $26,862.00 30.00 |

FOCUS QUERY REQUEST


(1) TABLE FILE filename
(2) {PRINT } object1 ({AND } object2...object95 )
{LIST }
{SUM/WRITE}
{COUNT }
(3) (BY (HIGHEST) {n} sortfield (IN-GROUPS-OF qty))
n = # of instances
can be 1 to 32 sortfields
(4) RANKED BY (TOP ) {n}
(HIGHEST)
(LOWEST )
(5) {END }
{RUN }
{QUIT}

ACROSS
+----------------------------------------------------------------+
| ACROSS (HIGHEST) sortfield (IN-GROUPS_OF quantity) |
+----------------------------------------------------------------+

¤ The report is sorted by the values of the ACROSS sortfield.


¤ The values of the ACROSS fields are displayed across the page.
¤ The verb object values are printed beneath the ACROSS field.
¤ If the values of the ACROSS fields are to be printed from high
value to low value, use HIGHEST.
¤ Best used with SUM or COUNT verbs.
¤ A maximum of 5 ACROSS phrases may be used in a request.
Vertical Sort: Horizontal Sort:

Request: TABLE FILE EMPLOYEE TABLE FILE EMPLOYEE


SUM CURR_SAL SUM CURR_SAL
BY DEPARTMENT ACROSS DEPARTMENT
END END

Output:

+--------------------------+ +---------------------------+
| | | DEPARTMENT |
| DEPARTMENT CURR_SAL | | MIS PRODUCTION |
| ---------- -------- | | --------------------------|
| MIS $108,002.00| | $108,002.00 $114,282.00 |
| PRODUCTION $114,282.00| | |
+--------------------------+ +---------------------------+

IF
Request: TABLE FILE EMPLOYEE
COUNT EMP_ID BY DEPARTMENT
BY PAY_DATE
IF DEPARTMENT EQ MIS
IF GROSS GT 1000
IF PAY_DATE FROM 820501 TO 821231
END

Output:
+-----------------------------------------------+
| EMP_ID |
| DEPARTMENT PAY_DATE COUNT |
| ---------- -------- ------ |
| MIS 82/05/28 4 |
| 82/06/30 4 |
| 82/07/30 4 |
| 82/08/31 5 |
+-----------------------------------------------+

LIMITING RECORDS

+----------------------------+
| IF RECORDLIMIT EQ n |
+----------------------------+

Request: TABLE FILE EMPLOYEE


PRINT LN FN DEPARTMENT
IF DPT EQ MIS
IF RECORDLIMIT EQ 3
END

Output:
+--------------------------------------------------------------------+
| LAST_NAME FIRST_NAME DEPARTMENT |
| --------- ---------- ---------- |
| SMITH MARY MIS |
| JONES DIANE MIS |
| MCCOY JOHN MIS |
+--------------------------------------------------------------------+

¤ Only the first "n" records that meet all other screening conditions will be in the report

MASK

+---------------------------+
| IF fieldname EQ 'mask' |
+---------------------------+

¤ "$" is used to mask out positions whose values are irrelevant.


¤ "$*" may be used to mark as irrelevant the remainder of the field value.
Request: TABLE FILE EMPLOYEE
PRINT LN1
BY LAST_NAME BY FIRST_NAME BY TYPE
IF TYPE EQ 'H$*'
END

Output:

+----------------------------------------------------------------------+
| LAST_NAME FIRST_NAME TYPE ADDRESS_LN1 |
| --------- ---------- ---- ----------- |
| BANNING JOHN HSM 160 LOMBARDO AVE. |
| |
| BLACKWOOD ROSEMARIE HM |
| . . . . |
| . . . . |

+-------------------------------------+
| IF fieldname {CONTAINS} value |
| {OMITS} |
+-------------------------------------+

¤ The relations, CONTAINS and OMITS, are used only with alphanumeric fields.
¤ If the value contains spaces, it must be in single quotes.
¤ The field is searched for the value position by position.
¤ For CONTAINS, if the value is found, the record is selected.
¤ For OMITS, if the value is found, the record is not selected.

Request: TABLE FILE EMPLOYEE


PRINT DAT_INC
BY HIGHEST BANK_NAME
BY LAST_NAME BY FIRST_NAME
IF BANK_NAME CONTAINS 'ASSOC'
END

Output:
+--------------------------------------------------------------+
| BANK_NAME LAST_NAME FIRST_NAME DAT_INC |
| --------- --------- ---------- ------- |
| BANK ASSOCIATION CROSS BARBARA 82/04/09 |
| 81/11/02 |
| ASSOCIATED BLACKWOOD ROSEMARIE 82/04/01 |
| IRVING JOAN 82/05/14 |
| 82/01/04 |
| MCKNIGHT ROGER 82/05/14 |
| 82/02/02 |
+--------------------------------------------------------------+
¤ CONTAINS will include the selected values.
¤ OMITS will not include the selected values.

REPORT FORMATTING

+------------------------------+
| SET parameter= option |
+------------------------------+

OR

+--------------------------------------+
| ON TABLE SET parameter value |
+--------------------------------------+

¤ Allows you to change parameters of your FOCUS environment such as controlling output.
¤ Can have as many parameters on a line as you can fit. Parameters are separated by a comma.
¤ ? SET To inquire about the current settings--lists them on the screen.
¤ Page 12-5 in Focus Manual.

Request:
SET NODATA=NONE
TABLE FILE FOCUSEXP TABLE FILE FOCUSEXP
PRINT AMT AND ACCTNO PRINT AMT AND ACCTNO
ACROSS ACCTT ACROSS ACCTT
BY REGNO BY COID BY REGNO BY COID
IF ACCTT EQ '1' OR '3' IF ACCTT EQ '1' OR '3'
IF READLIMIT EQ 15 IF READLIMIT EQ 15
END ON TABLE SET NODATA NONE
END
Output:
+----------------------------------------------------------------------+
| PAGE 1 |
| ACCOUNT_TYPE |
| 1 3 |
| REGION_NO COMPANY_ID AMOUNT ACCOUNT_NO AMOUNT ACCOUNT_NO|
| ------------------------------------------------------------------ |
| 01 11701 5,000.00 10001 NONE NONE |
| 404.00 10200 NONE NONE |
| NONE NONE 200.00 34600 |
| 02 31702 100.00 10001 NONE NONE |
| 405.00 10003 NONE NONE |
| 6,000.00 10200 NONE NONE |
| NONE NONE 50.00 CR 34600 |
| 03 34608 200.00 10001 NONE NONE |
| 2,500.00 10003 NONE NONE |
| 300.00 10200 NONE NONE |
+----------------------------------------------------------------------+

RECORD RETRIEVAL

TABLEF provides for fastest retrieval of records from a given file.

RULES FOR USE :


1. Data is already sorted into report format
2. No across phrases can be used
3. No multiple verbs
4. By statements must be in same order as data
5. By statements can only be used for control break option such as skip-line

NOTE: FOCUS reads in sequential order, NO sorting process.

EXAMPLE:
EX CONMALLC
TABLEF FILE CONAMES
PRINT COID REGION SHORTNM CITYST BEDS
IF FACTYP EQ 'H'
IF STATUS EQ 2
END

FOCUS QUERY REQUEST

(1) TABLE FILE filename

(2) {PRINT } object1 ({AND } object2...object95 )


{LIST }
{SUM/WRITE}
{COUNT }

(3) (ACROSS (HIGHEST) sortfieldn (IN-GROUPS-OF qty))

(4) (BY (HIGHEST) {n} sortfield (IN-GROUPS-OF qty))


n = # of instances
can be 1 to 32 sortfields

(5) RANKED BY (TOP ) {n}


(HIGHEST)
(LOWEST )

(6) (If {field relation value (OR value...)})


( {RECORDLIMIT EQ n })
( {READLIMIT EQ n })

(7) {END }
{RUN }
{QUIT}

-Can have up to 32 sortfield statements in a request.

COMPUTE

Request: TABLE FILE EMPLOYEE


SUM GROSS DED_AMT
COMPUTE DG_RATIO/F4.2 = DED_AMT/GROSS;
BY HIGHEST PAY_DATE
END

Output:
+------------------------------------------------------------+
| PAY_DATE GROSS DED_AMT DG_RATIO |
| -------- ----- ------- -------- |
| |
| 82/08/31 $18,523.84 $9,486.90 .51 |
| 82/07/30 $14,508.84 $7,600.96 .52 |
| 82/06/30 $14,508.84 $7,600.96 .52 |
| 82/05/28 $13,698.35 $7,438.28 .54 |
| 82/04/30 $10,850.68 $5,448.47 .50 |

COMPUTE

Request: TABLE FILE EMPLOYEE


SUM ED_HRS
COMPUTE STATUS/A10 = IF ED_HRS GE 30 THEN
'REQ. MET' ELSE 'LOW';
BY EID
END

Output:
+------------------------------------------------------------+
| EMP_ID ED_HRS STATUS |
| ------ ------ ------ |
| |
| 071382660 25.00 LOW |
| 112847612 36.00 REQ. MET |
| 117593129 50.00 REQ. MET |
| 119265415 10.00 LOW |
| 119329144 .00 LOW |
| 123764317 30.00 REQ. MET |
| 126724188 5.00 LOW |
| 219984371 .00 LOW |
| 326179357 75.00 REQ. MET |
| 451123478 50.00 REQ. MET |
| 543729165 25.00 LOW |
| 818692173 45.00 REQ. MET |
+------------------------------------------------------------+

DIRECT OPERATIONS

Prefix MEANING USAGE


------ ------- -----
MAX. Maximum Field Value MAX.AMT
MIN. Minimum Field Value MIN.AMT
AVE. Average Field Value AVE.AMT
ASQ. Average Sum of Squares Field Value ASQ.AMT
PCT. Percent of Column Total PCT.AMT
FST. First Retrieved Field Value FST.ACCTNO
LST. Last Retrieved Field Value LST.COID
TOT. Column Total of Field Value TOT.AMT
CNT. Count of Fields Retrieved CNT.ACCTNO
SUM. Sum of Fields Retrieved SUM.AMT
RPCT. Percent of Row Total RPCT.AMT
ALL. All Values (with missing descendents) ALL.ACCTNO
ST. Subtotal value of field at a sort ST.SALES
break
CT. Running column total of field CT.CURR_SAL

PREFIX ABBREVIATIONS

Request: TABLE FILE FOCUSEXP


SUM AMOUNT AND PCT.AMOUNT AND TOT.AMOUNT
BY REGION
END
Output:
+--------------------------------------------------------------------+
| NUMBER OF RECORDS IN TABLE = 24 LINES = 3 |
| PAGE 1 |
| PCT. TOT. |
| REGION_NO AMOUNT AMOUNT AMOUNT |
| --------- ------ ------ ------ |
| 01 3,404.00 48.60 7.004.00 |
| 02 4,030.00 57.53 7,004.00 |
| 03 430.00 CR 6.13 CR 7,004.00 |
+--------------------------------------------------------------------+

REPORT FORMATTING
¤ REPORT HEADING
¤ PAGE HEADING
¤ COLUMN POSITIONING
¤ COLUMN TITLES
¤ PAGE FOOTING
¤ REPORT FOOTING

+------------------------------------+
| TABLE FILE filename |
| HEADING(CENTER) |
| " text " |
+------------------------------------+
Request: TABLE FILE FOCUSEXP
HEADING
"<10 SAMPLE OUTPUT REPORT <113 PAGE: <TABPAGENO"
"<113 Printed &DATE"
"<113 TIME: &TOD"
"<18 <COID"
"</2"
PRINT AMT ACCTT COSTCTR
BY COID NOPRINT PAGE-BREAK
BY ACCTNO
END

Output:
+---------------------------------------------------------------------+
| SAMPLE OUTPUT REPORT PAGE: 1 |
| PRINTED 8/01/88 |
| TIME: 08.38.17 |
| 11701 |
| |
| |
| ACCOUNT_NO AMOUNT ACCOUNT_TYPE COST_CENTER |
| ---------- ------ ------------ ----------- |
| 10001 5,000.00 1 22 |
| 10200 404.00 1 20 |
| 20030 3,000.00 2 19 |
| 34600 200.00 3 19 |
| 70210 1,000.00 CR 4 32 |
| 80301 4,200.00 CR 4 29 |
+---------------------------------------------------------------------+
+--------------------------+
| TABLE FILE filename |
| FOOTING(BOTTOM)(CENTER) |
| " text " |
+--------------------------+
TABLE FILE FOCUSEXP
HEADING
"<10 SAMPLE OUTPUT REPORT <113 PAGE:<TABPAGENO"
"<113 Printed &DATE"
"<113 TIME: &TOD"
"<18 <COID"
"</2"
PRINT AMT ACCTT COSTCTR
BY COID NOPRINT PAGE-BREAK
BY ACCTNO
FOOTING CENTER
"HUMANA IS A GREAT COMPANY"
END
+---------------------------------------------------------------------+
| SAMPLE OUTPUT REPORT PAGE: 1 |
| PRINTED 8/01/88 |
| TIME: 08.38.17 |
| 11701 |
| ACCOUNT_NO AMOUNT ACCOUNT_TYPE COST_CENTER |
| ---------- ------ ------------ ----------- |
| 10001 5,000.00 1 22 |
| 10200 404.00 1 20 |
| 20030 3,000.00 2 19 |
| 34600 200.00 3 19 |
| 70210 1,000.00 CR 4 32 |
| 80301 4,200.00 CR 4 29 |
| |
| HUMANA IS A GREAT COMPANY |
+---------------------------------------------------------------------+

Request: TABLE FILE EMPLOYEE


PRINT ED_HRS
CURR_JOBCODE
BY LAST_NAME
BY FIRST_NAME
END

Output:

Column 3 Column 20 Column 32 Column 40


| | | |
| | | |
V V V V
+---------------------------------------------------------+
| LAST_NAME FIRST_NAME ED_HRS CURR_JOBCODE |
| --------- ---------- ------ ------------ |
| |
| BANNING JOHN .00 A17 |
| . . . . |
| . . . . |
| . . . . |
+---------------------------------------------------------+

+------+
| IN n|
+------+

Request:

TABLE FILE EMPLOYEE TABLE FILE EMPLOYEE


PRINT BANK_ACCT PRINT BANK_ACCT IN 1
BY BANK_NAME BY BANK_NAME IN 16
BY LAST_NAME BY LAST_NAME IN 30
END END

Output:

+-------------------------------+ +--------------------------------+
| BANK_NAME LAST_NAME BAN|_AC|T BANK_ACCT BANK_NAME| LAST_NAME
| --------- --------- ---|---|- --------- ---------| ---------
| GREENSPAN | | | GREENSPAN
| MCCOY | | | MCCOY
| ROMANS | | | ROMANS

CHANGING COLUMN TITLES

+---------------------------+
|field AS 'title(, ...title5'|
+---------------------------+

Request: TABLE FILE EMPLOYEE


SUM ED_HRS AS 'TOTAL,EDUCATION,HOURS'
BY CURR_JOBCODE AS 'CURRENT,JOBCODE'
END

Output:
+-----------------------------+
| TOTAL |
| CURRENT EDUCATION |
| JOBCODE HOURS |
| ------- --------- |
¤ Placing a comma in new column heading forces a new line.
¤ Allows up to 5 lines of heading per column

COLUMN NOTATION

Request: TABLE FILE FOCUSEXP


SUM AMT
BY REGNO
SUM AMT AND
COMPUTE COPCT = C2 / C1 * 100;
BY REGNO BY ACCTT
END

Output:
+---------------------------------------------------------------------+
| PAGE 1 |
| REGION_NO AMOUNT ACCOUNT_TYPE AMOUNT COPCT|
| --------- ------ ------------ ------ -----|
| 01 3,404.00 1 5,404.00 158.75|
| 2 3,000.00 88.13|
| 3 200.00 5.88|
| 4 5,200.00 CR -152.76|
| 02 4,030.00 1 6,505.00 161.41|
| 2 1,025.00 25.43|
| 3 50.00 CR -1.24|
| 4 3,450.00 CR -85.61|
| 03 430.00 CR 1 3,673.00 -854.19|
| 2 718.00 -166.98|
| 3 1,530.00 CR 355.81|
| 4 3,291.00 CR 765.35|
+---------------------------------------------------------------------+

Request: TABLE FILE FOCUSEXP


PRINT ACCTNO OVER AMT OVER COSTCTR
BY REGNO
BY COID SKIP-LINE
END
Output:
+---------------------------------------------------------------------+
| PAGE 1 |
| REGION_NO COMPANY_ID |
| --------- ---------- |
| 01 11701 ACCOUNT_NO 10001 |
| AMOUNT 5,000.00 |
| COST_CENTER 22 |
| ACCOUNT_NO 10200 |
| AMOUNT 404.00 |
| COST_CENTER 20 |
| ACCOUNT_NO 20030 |
| AMOUNT 3,000.00 |
| COST_CENTER 19 |

Request: TABLE FILE CAR


COUNT MODEL
ACROSS MPG IN-GROUPS-OF 10
BY CAR ROW-TOTAL COLUMN-TOTAL
END
Output:
+---------------------------------------------------------------------+
| PAGE 1 |
| |
| |
| |
| |
| MPG |
| 0 10 20 TOTAL |
| CAR |
| ---------------------------------------------- |
| |
| ALFA ROMEO 0 0 3 3 |
| AUDI 0 0 1 1 |
| BMW 0 4 2 6 |
| DATSUN 1 0 0 1 |
| JAGUAR 1 1 0 2 |
| TOTAL 3 6 9 18 |
+------------------------------------------------------------------

+----------------------------+
| ON fieldname operation |
+----------------------------+

For Instance: ON COID SKIP-LINE

Request: TABLE FILE FOCUSEXP


SUM AMT AND CNT.ACCTNO
BY REGNO
BY COID
BY ACCTT
ON COID SUB-TOTAL
END
Output:
+---------------------------------------------------------------------+
| ACCOUNT_NO |
| REGION_NO COMPANY_ID ACCOUNT_TYPE AMOUNT COUNT |
| --------- ---------- ------------ ------ ---------- |
| 01 11701 1 5,404.00 2 |
| 2 3,000.00 1 |
| 3 200.00 1 |
| 4 5,200.00 CR 2 |
| *TOTAL COMPANY_ID 11701 3,404.00 6 |
| *TOTAL REGION_NO 01 3,404.00 6 |
| 03 34608 1 3,000.00 3 |
| 2 450.00 1 |
| 3 1,575.00 CR 1 |
| 4 2,300.00 CR 1 |
| *TOTAL COMPANY_ID 34608 425.00 CR 6 |
| 34902 1 673.00 3 |
| 2 268.00 1 |
| 3 45.00 1 |
| 4 991.00 CR 1 |
| *TOTAL COMPANY_ID 34902 5.00 CR 6 |
| *TOTAL REGION_NO 03 430.00 CR 12 |
| TOTAL 2,974.00 18 |
+---------------------------------------------------------------------+

Request: TABLE FILE FOCUSEXP


SUM AMT AND CNT.ACCTNO
BY REGNO
BY COID
BY ACCTT
ON COID SUBTOTAL
END
Output:
+---------------------------------------------------------------------+
| REGION_NO COMPANY_ID ACCOUNT_TYPE AMOUNT COUNT |
| --------- ---------- ------------ ------ ---------- |
| 01 11701 1 5,404.00 2 |
| 2 3,000.00 1 |
| 3 200.00 1 |
| 4 5,200.00 CR 2 |
| *TOTAL COMPANY_ID 11701 3,404.00 6 |
| 03 34608 1 3,000.00 3 |
| 2 450.00 1 |
| 3 1,575.00 CR 1 |
| 4 2,300.00 CR 1 |
| *TOTAL COMPANY_ID 34608 425.00 CR 6 |
| 34902 1 673.00 3 |
| 2 268.00 1 |
| 3 45.00 1 |
| 4 991.00 CR 1 |
| *TOTAL COMPANY_ID 34902 5.00 CR 6 |
| TOTAL 2,974.00 18 |
+---------------------------------------------------------------------+

Request: TABLE FILE FOCUSEXP


SUM AMT AND CNT.ACCTNO AND
COMPUTE AMTPER = C1 / C2;
BY REGNO BY COID
BY ACCTT
ON COID SUMMARIZE
END
Output:
+---------------------------------------------------------------------+
| REGION_NO COMPANY_ID ACCOUNT_TYPE AMOUNT COUNT | AMTPER
| --------- ---------- ------------ ------ ---------- | ------
| 01 11701 1 5,404.00 2 | 2,702.00
| 2 3,000.00 1 | 3,000.00
| 3 200.00 1 | 200.00
| 4 5,200.00 CR 2 | -2,600.00
| *TOTAL COMPANY_ID 11701 3,404.00 6 | 567.33
| *TOTAL REGION_NO 01 3,404.00 6 | 567.33
| 03 34608 1 3,000.00 3 | 1,000.00
| 2 450.00 1 | 450.00
| 3 1,575.00 CR 1 | -1,575.00
| 4 2,300.00 CR 1 | -2,300.00
| *TOTAL COMPANY_ID 34608 425.00 CR 6 | -70.83
| 34902 1 673.00 3 | 224.33
| 2 268.00 1 | 268.00
| 3 45.00 1 | 45.00
| 4 991.00 CR 1 | -991.00
| *TOTAL COMPANY_ID 34902 5.00 CR 6 | -.83
| *TOTAL REGION_NO 03 430.00 CR 12 | -35.83
| TOTAL 2,974.00 18 | 165.22
+---------------------------------------------------------------------+

Request: TABLE FILE FOCUSEXP


SUM AMT AND CNT.ACCTNO AND
COMPUTE AMTPER = C1 / C2;
BY REGNO BY COID
BY ACCTT
ON COID RECOMPUTE
END
Output:
+---------------------------------------------------------------------+
| ACCOUNT_NO |
| REGION_NO COMPANY_ID ACCOUNT_TYPE AMOUNT COUNT | AMTPER
| --------- ---------- ------------ ------ ---------- | ------
| 01 11701 1 5,404.00 2 | 2,702.00
| 2 3,000.00 1 | 3,000.00
| 3 200.00 1 | 200.00
| 4 5,200.00 CR 2 | 2,600.00
| *TOTAL COMPANY_ID 11701 3,404.00 6 | 567.33
| 03 34608 1 3,000.00 3 | 1,000.00
| 2 450.00 1 | 450.00
| 3 1,575.00 CR 1 | 1,575.00
| 4 2,300.00 CR 1 | 2,300.00
| *TOTAL COMPANY_ID 34608 425.00 CR 6 | -70.83
| 34902 1 673.00 3 | 224.33
| 2 268.00 1 | 268.00
| 3 45.00 1 | 45.00
| 4 991.00 CR 1 | -991.00
| *TOTAL COMPANY_ID 34902 5.00 CR 6 | -.83
| TOTAL 2,974.00 18 | 165.22
+---------------------------------------------------------------------+
Request: TABLE FILE FOCUSEXP
PRINT ACCTNO AND AMT
BY REGNO BY COID
ON REGNO PAGE-BREAK
END
Output:
+-----------------------------------------------------------+
| REGION_NO COMPANY_ID ACCOUNT_NO AMOUNT |
| --------- ---------- ---------- ------ |
| 01 11701 10001 5,000.00 |
| 10200 404.00 |
| 20030 3,000.00 |
| 34600 200.00 |
| 70210 1,000.00 CR |
| 80301 4,200.00 CR |
| PAGE 2 |
| REGION_NO COMPANY_ID ACCOUNT_NO AMOUNT |
| --------- ---------- ---------- ------ |
| 03 34608 10001 200.00 |
| 10003 2,500.00 |
| 10200 300.00 |
| 20030 450.00 |
| 34600 1,575.00 CR |
| 80301 2,300.00 CR |
| 34902 10001 260.00 |
| 10003 428.00 |
| 10200 15.00 CR |
| 20030 268.00 |
| 34600 45.00 |
| 80301 991.00 CR |
+-----------------------------------------------------------+

Request: SET PAGE = OFF


TABLE FILE FOCUSEXP
PRINT ACCTNO AND AMT
BY REGNO
BY COID
ON REGNO SKIP-LINE
END
Output:
+---------------------------------------------------------+
| REGION_NO COMPANY_ID ACCOUNT_NO AMOUNT |
| --------- ---------- ---------- ------ |
| 01 11701 10001 5,000.00 |
| 10200 404.00 |
| 20030 3,000.00 |
| 34600 200.00 |
| 70210 1,000.00 CR |
| 80301 4,200.00 CR |
| |
| 03 34608 10001 200.00 |
| 10003 2,500.00 |
| 10200 300.00 |
| 20030 450.00 |
| 34600 1,575.00 CR |
| 80301 2,300.00 CR |
| 34902 10001 260.00 |
| 10003 428.00 |
| 10200 15.00 CR |
| 20030 268.00 |
| 34600 45.00 |
| 80301 991.00 CR |
+---------------------------------------------------------+

FOCEXEC
FOCEXEC is a FOCUS executable procedure.
¤ FOCUS program is stored as a member in the 'TEST.FOCUS.EXEC' dataset.
¤ Can include the TSO ALLOC statement in the FOCEXEC.
¤ -* indicates that the line is a comment.
¤ -TYPE MESSAGE sends the message to the screen.

To execute the FOCEXEC:


¤ Go into FOCUS.
¤ Type EX MEMBERNAME. Example: EX TRxx01.

Request:

-* This program ....


TABLE FILE CAR
COUNT MODEL
ACROSS MPG IN-GROUPS-OF 10
BY CAR ROW-TOTAL COLUMN-TOTAL
END
-TYPE PROCESSING ENDS

Output:
+---------------------------------------------------------------------+
| PAGE 1 |
| |
| MPG |
| 0 10 20 TOTAL |
| CAR |
| ---------------------------------------------- |
| |
| ALFA ROMEO 0 0 3 3 |
| AUDI 0 0 1 1 |
| BMW 0 4 2 6 |
| DATSUN 1 0 0 1 |
| JAGUAR 1 1 0 2 |
| JENSEN 0 1 0 1 |
| MASERATI 1 0 0 1 |
| PEUGEOT 0 0 1 1 |
| TOYOTA 0 0 1 1 |
| TRIUMPH 0 0 1 1 |
| |
| TOTAL 3 6 9 18 |
+---------------------------------------------------------------------+

EXTRACTING FILES

Request:

TABLE FILE EMPLOYEE TABLE FILE EMPLOYEE


SUM CURR_SAL SUM CURR_SAL
ACROSS DEPARTMENT ACROSS DEPARTMENT
BY CURR_JOBCODE BY CURR_JOBCODE
END ON TABLE HOLD
END

Output:
+-----------------------------------++--------------------------------+
| DEPARTMENT || |
| CURR_JOBCODE MIS PRODUCTION || ? hold |
| __________________________________|| |
| A01 . $9,500.00|| DEFINITION OF CURRENT HOLD FILE|
| A07 $9,000.00 $11,000.00|| |
| A15 . $26,862.00|| FIELDNAME ALIAS FORMAT |
| A17 $27,062.00 $29,700.00|| |
| B02 $18,480.00 $16,100.00|| CURR_JOBCODE E01 A3 |
| B03 $18,480.00 .|| CURR_SAL E02 D12.2M |
| B04 $21,780.00 $21,120.00|| CURR_SAL E03 D12.2M |
| B14 $13,200.00 .|| |
+-----------------------------------++--------------------------------+

DEFINE FILE
¤ Creates new fields based on existing database field values.
¤ Changes field length to accommodate sums and totals.
¤ Changes field format so FOCUS special functions can be used.
¤ Creates new fields using FOCUS special functions.
¤ Defined fields are temporary.
¤ Exist only for this FOCUS session.
¤ Defined fields may also be put into the file's Master File
Description if the expression uses fields from that segment only.

+----------------------------------------+
| DEFINE FILE filename |
| fieldname (/format)=expression; |
| . |
| . |
| . |
| END |
+----------------------------------------+
where:
fieldname 1-12 characters.
format Any format allowed for field descriptions in FOCUS.
Default format is D12.2
expression Any value compatible with the format, or
Any arithmetic expression, or
Any logical expression.
; Required to indicate the end of the expression.
1. Enter:
? DEFINE
2. The system will respond with:

FILE FIELD NAME FORMAT FIELDNO SEGNO ADDR VIEW TYPE


EMPLOYEE INCREASE D8.2 36 1 00063138
EMPLOYEE BANK_COST F6.2 37 2 00063234

IF STATEMENTS

Request:

DEFINE FILE FOCUSEXP


NEWAMT/P10.2=IF ACCTNO IS '10001' THEN AMT * 1.25 ELSE
IF ACCTNO IS '34600' THEN AMT * 2 ELSE
AMT;
END

TABLE FILE FOCUSEXP


SUM NEWAMT AND AMT
BY REGNO
BY COID
BY ACCTT
END

Output:

+----------------------------------------------------------------------+
|PAGE 1 |
|REGION_NO COMPANY_ID ACCOUNT_TYPE NEWAMT AMOUNT |
|--------- ---------- ------------ ------ ------ |
|01 11701 1 6,654.00 5,404.00 |
| 2 3,000.00 3,000.00 |
| 3 400.00 200.00 |
| 4 -5,200.00 5,200.00 CR |
|02 31702 1 6,530.00 6,505.00 |
| 2 1,025.00 1,025.00 |
| 3 -100.00 50.00 CR |
| 4 -3,450.00 3,450.00 CR |
|03 34608 1 3,050.00 3,000.00 |
| 2 450.00 450.00 |
| 3 -3,150.00 1,575.00 CR |
| 4 -2,300.00 2,300.00 CR |
| 34902 1 738.00 673.00 |
| 2 268.00 268.00 |
| 3 90.00 45.00 |
| 4 -991.00 991.00 CR |
+----------------------------------------------------------------------+
CONCATENATION

Request: DEFINE FILE FOCUSEXP


NOTE/A1=IF AMT GT 2000 THEN '*' ELSE ' ';
NACCT/A6=NOTE|ACCTNO;
END
TABLE FILE FOCUSEXP
PRINT NACCT AND AMT
BY COID
END

Output:

+----------------------------------------------------------+
| PAGE 1 |
| COMPANY_ID NACCT AMOUNT |
| ---------- ----- ------ |
| 11701 *10001 5,000.00 |
| 10200 404.00 |
| *20030 3,000.00 |
| 34600 200.00 |
| 70210 1,000.00 CR |
| 80301 4,200.00 CR |
| 31702 10001 100.00 |
| 10003 405.00 |
| *10200 6,000.00 |
| 20030 1,025.00 |
| 34600 50.00 CR |
| 80301 3,450.00 CR |

Request: DEFINE FILE EMPLOYEE


NEWNAME/A26=LN||','||FN;
NEWNAME2/A26=LN|','|FN;
END
TABLE FILE EMPLOYEE
PRINT NEWNAME
NEWNAME2
END

Output:

+----------------------------------------------------------+
| PAGE 1 |
| NEWNAME NEWNAME2 |
| ------- -------- |
| STEVENS,ALFRED STEVENS ,ALFR|D
| SMITH,MARY SMITH ,MARY|
| JONES,DIANE JONES ,DIAN|
| SMITH,RICHARD SMITH ,RICH|RD
| BANNING,JOHN BANNING ,JOHN|
| IRVING,JOAN IRVING ,JOAN|
| ROMANS,ANTHONY ROMANS ,ANTH|NY

CHARACTER CONVERSION

Request: DEFINE FILE FOCUSEXP


NACCT/P5=EDIT(ACCTNO);
CHGACCT/P5=NACCT + 1;
STATE/A2=EDIT(COID,'$99$$');
SPLIT/A6=EDIT(ACCTNO,'999-99');
END
TABLE FILE FOCUSEXP
PRINT COID AND STATE AND CHGACCT AND SPLIT
END

Output:

+----------------------------------------------------------+
| PAGE 1 |
| COMPANY_ID STATE CHGACCT SPLIT |
| ---------- ----- ------- ----- |
| 11701 17 10002 100-01 |
| 11701 17 10201 102-00 |
| 11701 17 20031 200-30 |
| 11701 17 34601 346-00 |
| 11701 17 70211 702-10 |
| 11701 17 80302 803-01 |

DECODE

Request:

DEFINE FILE FOCUSEXP


ACCT_GROUP/A12=DECODE ACCTT (1 ASSETS 2 LIABILITIES
'3' 'REVENUE' '4' 'EXPENSES' ELSE 'ERROR');
END
TABLE FILE FOCUSEXP
PRINT ACCTNO AND AMT
BY ACCT_GROUP
END

Output:

+----------------------------------------------------------+
| PAGE 1 |
| ACCT_GROUP ACCOUNT_NO AMOUNT |
| ---------- ---------- ------ |
| ASSETS 10001 5,000.00 |
| 10200 404.00 |
| 10200 6,000.00 |
| 10001 260.00 |
| 10003 428.00 |
| 10200 15.00 CR |
| EXPENSES 70210 1,000.00 CR |
| 80301 4,200.00 CR |
| 80301 3,450.00 CR |
| 80301 2,300.00 CR |
| 80301 991.00 CR |
| LIABILITIES 20030 3,000.00 |
| 20030 1,025.00 |
| 20030 450.00 |
| 20030 268.00 |

NEW DATE FORMATS


The new DATE formats make it possible to:
¤ Sort by date regardless of display format
¤ Define date components such as year, month, quarter, etc. and extract them easily from
date fields
¤ Do arithmetic with dates and date comparisons without using special date handling
functions
¤ Reference dates in a natural way, such as JAN 1 1985, without regard to formats
¤ Automatically validate dates in transactions
¤ Convert dates easily to other formats
FOR EXAMPLE:
BY ORDERDATE Sorts dates into date sequence regardless of the display format
DAYS/I4=SHIPDATE-ORDERDATE; Computes the elapsed number of days between two dates
regardless of their display format.
DAYS/I4=SHIPDATE-'JAN 1 1985'; Computes the elapsed number of days regardless of the
Display format
SHIPMONTH/MONTH=SHIPDATE; Extracts the month from SHIPDATE
For example if SHIPDATE is December 24,1985, SHIPMONTH IS
12, but would be printed as "DECEMBER".
SHIPMONTH/M=SHIPMONTH + 3; Always produces a valid month value in the range 1 to 12.
For example, if the value of SHIPMONTH is 12 then
SHIPMONTH + 3 is 3.
SHIPMONTH/YM=SHIPDATE; The year and month are extracted from shipdate.

In basic date formats, the components are separated by /.The separating character can be
changed.
EXAMPLES:

FORMAT DISPLAY
__________________________

YMD 85/11/22
Y-M-D 85-11-22
Y.M.D 85.11.22
Y|M|D 851122
YBMBD 85 11 22

DATE EDIT OPTIONS:


+----------+------------+----------------------------------------------+
| OPTION | MEANING | EFFECT |
| D | Day | Prints a value of 1 to 31 for the day. |
+----------+------------+----------------------------------------------+
| M | Month | Prints a value of 1 to 12 for the month. |
+----------+------------+----------------------------------------------+
| Y | Year | Prints a two-digit year. |
+----------+------------+----------------------------------------------+
| YY | Century | Prints additional 2 characters. Ex: 1991. |
+----------+------------+----------------------------------------------+
| Q | Quarter | Prints the quarter (1-4). |
+----------+------------+----------------------------------------------+
| W |Day of Week | Prints number of day of week. |
| | | (1-7, where Mon = 1) |
+----------+------------+----------------------------------------------+
| w |Day of Week | Prints abbreviated name of day of week. |
+----------+------------+----------------------------------------------+
| T | Translate | Prints the month/day as a 3-char. abbrev. |
+----------+------------+----------------------------------------------+
| t | Translate | Same as above except 1st char. is uppercase|
| | | and last 2 are lowercase. |
+----------+------------+----------------------------------------------+
| TR | Translate | Prints the month/day entire name in |
| | | uppercase. |
+----------+------------+----------------------------------------------+
| tr | Translate | Same as above except 1st char. is uppercase|
| | | and the rest are lowercase. |
+----------+------------+----------------------------------------------+

MONTH TRANSLATION:
Usage Meaning Example
----- ------- -------
MT short form upper case JAN
MTR complete upper case JANUARY

DAY OF WEEK TRANSLATION:


WT short form upper case MON
WTR or complete upper case MONDAY
WR
If the date is December 24, 1984 which was a Thursday:
+------------------------------------------------+
| Usage Result |
| ----- ------ |
| MTRDYY DECEMBER 24, 1984 |
| MTDYY DEC 24, 1984 |
| MTRDYYW DECEMBER 24 1984, THU |
| WRMTRDYY THURSDAY, DECEMBER 24 1984 |
| WTR THURSDAY |
| W 4 |
+------------------------------------------------+

Masterfile:

FIELDNAME=HIRE_DATE ,HDT ,YMD ,$

Request: DEFINE FILE EMP50


HIRED/wrMtrDYY=HIRE_DATE; TITLE='DATE OF HIRE'
END

TABLE FILE EMP50


PRINT LAST_NAME HIRED
IF HIRE_DATE LT '1985 DEC 31'
END

Output:
+----------------------------------------------------------+
| PAGE 1 |
| LAST_NAME DATE OF HIRE |
| --------- ------------ |
| STEVENS Saturday, June 2 1980 |
| JONES Monday, May 1 1980 |
| BROWN Saturday, November 25 1985 |
+----------------------------------------------------------+

Masterfile:

FIELDNAME=HIRE_DATE ,HDT ,YMD ,$

Request:
DEFINE FILE EMP50
HIREMO/YM=HIRE_DATE;
HIRED/wrMtrDYY=HIRE_DATE:
END
TABLE FILE EMP50
PRINT LAST_NAME HIREMO AS 'MONTH AND YEAR HIRED'
HIRED as 'DATE OF HIRE' AND
COMPUTE DOS/I4='1985 DEC 31' - HDT; AS 'DAYS,OF,SERVICE' AND
COMPUTE LOS/I4=DOS/30; AS 'MONTHS,OF,SERVICE'
IF HIRE_DATE LT '1985 DEC 31'
END
Output:
+---------------------------------------------------------------------+
| PAGE 1 |
| MONTH DAYS MONTHS |
| AND YEAR OF OF |
| LAST_NAME HIRED DATE OF HIRE SERVICE SERVICE |
| --------- -------- ------------ ------- ------- |
| STEVENS 80/06 Saturday, June 2 1980 2038 67 |
| JONES 80/05 Monday, May 1 1980 1340 44 |
| BROWN 85/11 Saturday, November 25 1985 36 1 |
+---------------------------------------------------------------------+

NO DATE FORMAT A6,P6,I6


___________________________________

OLD DATE FORMAT A6MDY,P6MDY,I6MDY


___________________________________

NEW DATE FORMAT MDY,YMD


___________________________________

In order to use the NEW DATE format you must first convert The NO DATE format to the OLD
DATE format then to the NEW DATE format.

Masterfile:

FIELDNAME=HIRE_DATE, ALIAS=HDT, FORMAT=I6YMD, $

Request: DEFINE FILE EMPLOYEE


NEW_DATE/MDY=HIRE_DATE;
LOS1/I4='JAN 1 1983' - NEW_DATE;
PENS_ELIG/A3 = IF LOS1 GE 365 OR CURR_JOBCODE EQ 'A17'
THEN 'YES' ELSE 'NO';
END
TABLE FILE EMPLOYEE
PRINT LOS1 CURR_JOBCODE AS JOB
NEW_DATE HIRE_DATE
BY LAST_NAME BY FIRST_NAME
IF PENS_ELIG EQ 'YES'
END

Output:
+---------------------------------------------------------------------+
| PAGE 1 |
| LAST_NAME FIRST_NAME LOS1 JOB NEW_DATE HIRE_DATE |
| --------- ---------- ---- --- -------- --------- |
| |
| BANNING JOHN 153 A17 08/01/82 82/08/01 |
| CROSS BARBARA 425 A17 11/02/81 81/11/02 |
| MCCOY JOHN 549 B02 07/01/81 81/07/01 |
| SMITH MARY 549 B14 07/01/81 81/07/01 |
| STEVENS ALFRED 943 A07 06/02/80 80/06/02 |
+---------------------------------------------------------------------+

VERB SUMMARY

A REQUEST STATEMENT MAY HAVE UP TO 6 SETS OF VERBS AND ASSOCIATED


SORT CONDITIONS.
NOTE: MUST HAVE SUM BEFORE LIST OR PRINT.
TABLE FILE FOCUSEXP
Request Set 1) SUM AVE.AMOUNT
BY REGION_NO
Request Set 2) PRINT ACCOUNT_NO COST_CENTER
BY REGION_NO
BY COMPANY_ID
END
Output:
+---------------------------------------------------------------------+
| AVE |
| REGION_NO AMOUNT COMPANY_ID ACCOUNT_NO COST_CENTER|
| --------- ------ ---------- ---------- -----------|
| 01 567.33 11701 10001 22 |
| 10200 20 |
| 20030 19 |
| 34600 19 |
| 70210 32 |
| 80301 29 |
| 02 671.66 31702 10001 22 |
| 10003 18 |
| 10200 20 |
| 20030 19 |
| 34600 19 |
| 80301 29 |

WHEN
¤ Extension of the ON phrase.
¤ Performs conditional printing at break points in a report.
¤ Determines when options such as "ON fieldname SUBTOTAL" appear in the report.
¤ If the WHEN clause is used with SUBHEAD or SUBFOOT, it must be placed on the line
following the text.

ON fieldname option WHEN expression (;)

OPTION: Allowable control option (SUBTOTAL, PAGE-BREAK, etc.)

EXPRESSION: Any expression which evaluates to True/False.


All alphanumeric literals must be enclosed within single
quotation marks.
Request: TABLE FILE FOCUSEXP
SUM AMT AND CNT.ACCTNO
BY REGNO
BY COID
BY ACCTT
ON COID SUBTOTAL
SUBFOOT
"** THIS IS THE CORPORATE OFFICE **"
WHEN COID EQ '11701'
END
Output:

+---------------------------------------------------------------------+
| REGION_NO COMPANY_ID ACCOUNT_TYPE AMOUNT COUNT |
| --------- ---------- ------------ ------ ---------|
| 01 11701 1 5,404.00 |
| 2 3,000.00 |
| 3 200.00 |
| 4 5,200.00 CR |
| *TOTAL COMPANY_ID 11701 3,404.00 |
| ** THIS IS THE CORPORATE OFFICE ** |
| 02 31702 1 6,505.00 |
| 2 1,025.00 |
| 3 50.00 CR |
| 4 3,450.00 CR |
| *TOTAL COMPANY_ID 31702 4,030.00 |

WHERE Clause
¤ Allows:
û Field to field comparisons
û Complex record screens
û May replace some DEFINE statements
¤ Syntax:
WHERE <expression> {;}
Field-To-Field Comparison

Request:

DEFINE FILE EMPLOYEE


FLAG/I1=IF CSAL * 1.1 GT 25000
THEN 1 ELSE 0;
END
TABLE FILE EMPLOYEE TABLE FILE EMPLOYEE
PRINT LAST_NAME FIRST_NAME CSAL PRINT LAST_NAME FIRST_NAME CSAL
BY EID BY EID
IF FLAG EQ 1 WHERE CSAL * 1.1 GT 25000
END END

Output:
+-------------------------------------------------------------------+
| EMP_ID LAST_NAME FIRST_NAME CURR_SAL |
| ----- --------- ---------- -------- |
| 119329144 BANNING JOHN $29,700,00 |
| 123764317 IRVING JOAN $26,862,00 |
| 818692173 CROSS BARBARA $27,062,00 |
+-------------------------------------------------------------------+

Complex Record Screening

Request: TABLE FILE EMPLOYEE


PRINT LAST_NAME FIRST_NAME
CURR_JOBCODE JOBCODE AS 'PREVIOUS'
BY DEPARTMENT BY EMP_ID
WHERE DEPARTMENT EQ 'MIS'
OR CURR_JOBCODE NE JOBCODE
END
Output:
+---------------------------------------------------------------------+
| DEPARTMENT EMP_ID LAST_NAME FIRST_NAME CURR_JOBCODE PREVIOU|
| ---------- ------ --------- ---------- ------------ -------|
| MIS 112847612 SMITH MARY B14 B14 |
| 117593129 JONES DIANE B03 B03 |
| JONES DIANE B03 B02 |
| 219984371 MCCOY JOHN B02 B02 |
| 326179357 BLACKWOOD ROSEMARIE B04 B04 |
| 543729165 GREENSPAN MARY A07 A07 |
| GREENSPAN MARY A07 B01 |
| 818692173 CROSS BARBARA A17 A17 |
| CROSS BARBARA A17 A16 |
| PRODUCTION 119265415 SMITH RICHARD A01 B01 |
| 123764317 IRVING JOAN A15 A14 |
+---------------------------------------------------------------------+

WHERE TOTAL CLAUSE


¤ WHERE screening conditions are applied to values in the internal matrix report.
¤ Rows are eliminated before the report is printed.
¤ Any TRUE/FALSE expression is permitted.
¤ Alphanumeric literals must be enclosed within quotation marks(').
¤ Syntax:
WHERE TOTAL <expression> {;}
Request: TABLE FILE EMPLOYEE
SUM SAL AND AVE.SAL AND COMPUTE PROJ_SAL = LST.SAL * 1.1;
BY EID
WHERE TOTAL SAL GT 30000
OR AVE.SAL GT 20000
OR PROJ_SAL LT 10000
END
Output:
+---------------------------------------------------------------+
| AVE |
| EMP_ID SALARY SALARY PROJ_SAL |
| ------ ------ ------ -------- |
| 117593129 $36,230.00 $18,115.00 19.525.00 |
| 119265415 $18,550.00 $9,275.00 9,955.00 |
| 119329144 $29,700.00 $29,700.00 32,670.00 |
| 123764317 $51,282.00 $26,641.00 26,862.00 |

WHERE LIKE Clause

+-------------------------------------------+
| WHERE field LIKE 'mask|
_____ ______
| WHERE NOT field LIKE 'mas|'
_____ ______
+-------------------------------------------+
¤ Used to select records based on pattern matching.
¤ field -- can be any valid alphanumeric fieldname or alias.
¤ 'mask' -- Pattern used to match records.
Rules:
û Must be enclosed in quotes.
û Underscore ( _ ) matches any single character.
û Percent ( % ) matches any sequence of characters.

Request:

TABLE FILE CAR


PRINT CAR BODYTYPE BY COUNTRY
WHERE BODYTYPE LIKE '%O%E%'
END

Output:
+-------------------------------------------------------------------+
| COUNTRY CAR BODYTYPE |
| ------- --- -------- |
| ENGLAND JAGUAR CONVERTIBLE |
| ITALY ALFA ROMEO COUPE |
| ALFA ROMEO ROADSTER |
| MASERATI COUPE |
+-------------------------------------------------------------------+

QUALIFING FIELDS: WITHIN

Reuqest: TABLE FILE FOCUSEXP


SUM PCT.AMOUNT/P10.2 WITHIN COID
BY COID SUB-TOTAL
BY ACCTT
END

Output:
+----------------------------------------------------------+
| PCT |
| COMPANY_ID ACCOUNT_TYPE AMOUNT |
| ---------- ------------ ------ |
| 11701 1 158.75 |
| 2 88.13 |
| 3 5.87 |
| 4 -152.76 |
| *TOTAL 11701 99.99 |
MATCH COMMAND

File matching is used when data from two different databases is


necessary to produce a single report.

+-------------------------------------------------------------+
| MATCH FILE EMPLOYEE |
| WRITE LAST_NAME FIRST_NAME |
| BY JOBCODE |
| RUN |
| FILE JOBFILE |
| WRITE JOB_DESC |
| BY JOBCODE |
| AFTER MATCH HOLD OLD |
| END |
+-------------------------------------------------------------+

This request will produce a single HOLD file containing the JOBCODE, JOB DESCRIPTION, LAST
NAME and FIRST NAME fields.
¤ Match command can merge up to 6 files in one request
¤ Match cannot use across, total or compute
¤ Match retrieves records from 1st file then 2nd file compares the records based on by's and
verb's
It is important to understand the "one-to-many" relationship.

SUM can generate ONE RECORD FROM MANY while


PRINT copies EACH individual RECORD.

Request 1: Request 2:

MATCH FILE EMPLOYEE MATCH FILE EMPLOYEE


WRITE LAST_NAME FIRST_NAME PRINT LAST_NAME FIRST_NAME
BY JOBCODE BY JOBCODE
RUN RUN
FILE JOBFILE FILE JOBFILE
WRITE JOB_DESC WRITE JOB_DESC
BY JOBCODE BY JOBCODE
AFTER MATCH HOLD OLD AFTER MATCH HOLD OLD
END END
TABLE FILE HOLD TABLE FILE HOLD
PRINT * PRINT *
END END
Output 1
+---------------------------------------------------------------+
|PAGE 1 |
|JOBCODE LAST_NAME FIRST_NAME JOB_DESC |
|------- --------- ---------- -------- |
|A01 SMITH RICHARD PRODUCTION CLERK |
|A07 GREENSPAN MARY SECRETARY |
|A14 IRVING JOAN SUPERVISOR/PRODUCTION |
|A15 IRVING JOAN ASSIST.MANAGER |
|A16 CROSS BARBARA MANAGER |
|A17 CROSS BARBARA DEPARTMENT MANAGER |
|B01 GREENSPAN MARY PROGRAMMER TRAINEE |
|B02 MCKNIGHT ROGER PROGRAMMER |
|B03 JONES DIANE PROGRAMMER ANALYST |
|B04 BLACKWOOD ROSEMARIE SYSTEMS ANALYST |
|B14 SMITH MARY FILE QUALITY |
+---------------------------------------------------------------+

Output 2
+---------------------------------------------------------------+
|PAGE 1 |
|JOBCODE LAST_NAME FIRST_NAME JOB_DESC |
|------- --------- ---------- -------- |
|A01 SMITH RICHARD PRODUCTION CLERK |
|A07 STEVENS ALFRED SECRETARY |
|A07 STEVENS ALFRED SECRETARY |
|A07 GREENSPAN MARY SECRETARY |
|A14 IRVING JOAN SUPERVISOR/PRODUCTION |
|A15 IRVING JOAN ASSIST.MANAGER |
|A16 CROSS BARBARA MANAGER |
|A17 BANNING JOHN DEPARTMENT MANAGER |
|A17 CROSS BARBARA DEPARTMENT MANAGER |
|B01 SMITH RICHARD PROGRAMMER TRAINEE |
|B01 GREENSPAN MARY PROGRAMMER TRAINEE |
|B02 JONES DIANE PROGRAMMER |
|B02 MCCOY JOHN PROGRAMMER |
|B02 MCKNIGHT ROGER PROGRAMMER |
|B02 MCKNIGHT ROGER PROGRAMMER |
|B03 JONES DIANE PROGRAMMER ANALYST |
|B04 ROMANS ANTHONY SYSTEMS ANALYST |
|B04 BLACKWOOD ROSEMARIE SYSTEMS ANALYST |
|B14 SMITH MARY FILE QUALITY |
+---------------------------------------------------------------+

MATCH FILE DISPOSITIONS


OLD-OR-NEW Union, all values from both files (Default when disposition is not
Specified)
OLD-AND-NEW Intersection, the values common to both files
OLD-NOT-NEW Only in the OLD file
NEW-NOT-OLD Only in the NEW file
OLD-NOR-NEW Only in the OLD file or only in NEW
OLD OLD and matches from NEW
NEW NEW and matches from OLD

Request:
MATCH FILE EMPLOYEE MATCH FILE EMPLOYEE
SUM LAST_NAME BY EMP_ID SUM LAST_NAME BY EMP_ID
RUN RUN
FILE EDUCFILE FILE EDUCFILE
SUM COURSE_CODE BY EMP_ID SUM COURSE_CODE BY EMP_ID
AFTER MATCH HOLD OLD AFTER MATCH HOLD NEW
END END
TABLE FILE HOLD TABLE FILE HOLD
PRINT * PRINT *
END END

Output:
+-----------------------------------++----------------------------------+
| EMP_ID LAST_NAME COURSE_CODE||EMP_ID LAST_NAME COURSE_CODE|
| ------ --------- -----------||------ --------- -----------|
| 071382660 STEVENS 101 ||071382660 STEVENS 101 |
| 112847612 SMITH 103 ||112847612 SMITH 103 |
| 117593129 JONES 203 ||117593129 JONES 203 |
| 119265415 SMITH 108 ||119265415 SMITH 108 |
| 119329144 BANNING ||212289111 103 |
| 123764317 IRVING ||315548712 108 |
| 126724188 ROMANS ||326179357 BLACKWOOD 301 |
| 219984371 MCCOY ||451123478 MCKNIGHT 101 |
| 326179357 BLACKWOOD 301 ||818692173 CROSS 302 |
| 451123478 MCKNIGHT 101 || |
| 543729165 GREENSPAN || |
| 818691273 CROSS 302 || |
+-----------------------------------++----------------------------------+

Request:
MATCH FILE EMPLOYEE MATCH FILE EMPLOYEE
SUM LAST_NAME BY EMP_ID SUM LAST_NAME BY EMP_ID
RUN RUN
FILE EDUCFILE FILE EDUCFILE
SUM COURSE_CODE BY EMP_ID SUM COURSE_CODE BY EMP_ID
AFTER MATCH HOLD OLD-OR-NEW AFTER MATCH HOLD OLD-AND-NEW
END END
TABLE FILE HOLD TABLE FILE HOLD
PRINT * PRINT *
END END

Output:
+-----------------------------------++----------------------------------+
| EMP_ID LAST_NAME COURSE_CODE||EMP_ID LAST_NAME COURSE_CODE|
| ------ --------- -----------||------ --------- -----------|
| 071382660 STEVENS 101 ||071382660 STEVENS 101 |
| 112847612 SMITH 103 ||112847612 SMITH 103 |
| 117593129 JONES 203 ||117593129 JONES 203 |
| 119265415 SMITH 108 ||119265415 SMITH 108 |
| 119329144 BANNING ||326179357 BLACKWOOD 301 |
| 123764317 IRVING ||451123478 MCKNIGHT 101 |
| 126724188 ROMANS ||818692173 CROSS 302 |
| 212289111 103 || |
| 219984371 MCCOY || |
| 615548712 108 || |
| 326179357 BLACKWOOD 301 || |
| 451123478 MCKNIGHT 101 || |
| 543729165 GREENSPAN || |
| 818692173 CROSS 302 || |
+-----------------------------------++----------------------------------+

Request: MATCH FILE FOCUSEXP


SUM AMOUNT CNT.ACCOUNT_NO
BY COMPANY_ID as COID
BY REGION_NO
RUN
FILE COMASTER
WRITE CONAME BEDS
BY COID
AFTER MATCH HOLD as HOLD1 OLD-AND-NEW
END
? HOLD HOLD1
TABLE FILE HOLD1
PRINT E03
E04 as 'ACCT,NO'
E06
BY E02
BY E05 SKIP-LINE
END

Output:
+---------------------------------------------------------------------+
| PAGE 1 |
| ACCT |
| REGION_NO CONAME AMOUNT NO BEDS |
| --------- ------ ------ --- ---- |
| 01 HUMANA INC. 3,404.00 6 0000 |
| 02 AUDUBON HOSPITAL 4,030.00 6 0484 |
| 03 GREENBRIER VALLEY HOSPITAL 5.00 CR 6 0122 |
| RESTON N/P 425.00 CR 6 0000 |
+---------------------------------------------------------------------+

JOIN COMMAND

THE FORMAT OF A SIMPLE JOIN COMMAND


--------------------------------------
*************************************************************
JOIN field1 in HOSTFILE TO (ALL) field2 in CRFILE as JOINNAME
*************************************************************
¤ Join command is very similar to a match, however it is much more efficient.
¤ Join does not create a file like match. Just lets you use two files as one.
¤ The format for the two fields specified in the JOIN must be the same.
¤ Up to 16 JOIN commands may be issued for any combination of files.
¤ Join commands are active for current FOCUS session or until you release the connection.
¤ FIELD2 must be indexed. (FIELDTYPE=I)
¤ Join does not always work with sequential files.
¤ The first file is called the 'HOST FILE' and the other is the 'CROSS-REFERENCED FILE'.
¤ Each time FOCUS retrieves a record from the HOST FILE. It then retrieves the records in
the CROSS-REFERENCED FILE containing this value.
¤ Join releases all pre-existing DEFINEd fields for the file being joined.

+-----------------------------------+
| Check File(filename) Picture |
+-----------------------------------+

shows the actual structure of the join.

+---------------------------------------------------------------------+
| JOIN COID IN FOCUSEXP TO COID IN COMASTER AS CDONE |
| ? JOIN |
| CHECK FILE FOCUSEXP PICTURE |
| TABLE FILE FOCUSEXP |
| SUM AMOUNT |
| BY CONAME SKIP-LINE |
| BY COID NOPRINT |
| BY ACCOUNT_NO |
| END |
+---------------------------------------------------------------------+

DEFINE-based JOIN
-----------------

In addition to the simple JOIN command, another JOIN syntax is the DEFINE-based JOIN which
allows the field in the host file to be created by a DEFINE statement. The corresponding
field in the cross-referenced file must be a real database field.
The DEFINE command must bE BETWEEN THE JOIN AND TABLE. JOIN'S CLEAR defines. The JOIN
command must fit on one line.

THE FORMAT OF THE DEFINE-based JOIN


-----------------------------------

************************************************************************
JOIN deffld WITH dbfld in HOSTFILE TO (ALL) field2 in CRFILE as JOINNAME
************************************************************************
EXAMPLE OF THE DEFINED-based JOIN
---------------------------------

JOIN ID_NUM WITH CITY IN SALES TO EMP_ID IN EDUCFILE AS SALEDUC

DEFINE FILE SALES


ID_NUM/A9 = DECODE CITY ('NEW YORK' 451123478 'NEWARK' 119265415
'STAMFORD' 818692173 'UNIONDALE' 112847612);
END

TABLE FILE SALES


PRINT DATE_ATTEND
BY CITY
BY COURSE_NAME
END

+--------------------------------------------------------------------+
| PAGE 1 |
| CITY COURSE_NAME DATE_ATTEND |
| ---- ----------- ----------- |
| NEW YORK FILE DESCRPT & MAINT 81/11/15 |
| NEWARK BASIC EPR NONR-DP MGRS 82/08/24 |
| STAMFORD BASIC REPORT PREP DP MGRS 82/08/02 |
| UNIONDALE FILE DESCRPT & MAINT 81/11/15 |
+--------------------------------------------------------------------+

JOIN UTILITY COMMANDS


1. To display a list of active JOIN commands, input: ? JOIN
2. To clear all JOIN commands, input: JOIN CLEAR *
3. To clear a specific JOIN, input: JOIN CLEAR joinname

COMMAND RECAP

JOIN field1 IN fromfile TO (ALL) field2 IN tofile AS joinname

TABLE FILE fromfile


PRINT LIST \
====> Request fields from both files
COUNT SUM/WRITE /
BY
IF
END

MATCH FILE oldfile


PRINT LIST \
====> Request fields from both files
COUNT SUM/WRITE /
BY
IF
RUN

FILE newfile
PRINT LIST \
====> Request fields from both files
COUNT SUM/WRITE /
BY ---- Must use the same name and layout of at least one by
in oldfile
IF
ON MATCH HOLD AS holdname disposition
END

WINDOWS
¤ Six Different Types
¤ Default is Window Off
¤ To Activate-Window On
Types of Windows

+----------------------+----------------------------------------------+
|Window | Activity |
+----------------------+----------------------------------------------+
| | |
|Command Window | Enter FOCUS Commands. |
+----------------------+----------------------------------------------+
| | |
|Output Window | View Window input and resulting |
| | output |
+----------------------+----------------------------------------------+
| | |
|History Window | See a record of commands entered |
| | in the Command Window. |
+----------------------+----------------------------------------------+
| | |
|Help Window | Display and edit key settings. |
+----------------------+----------------------------------------------+
| | |
|Table Window | Review output from the previous |
| | TABLE request. |
+----------------------+----------------------------------------------+
| | |
|Error Window | FOCUS error messages. |
+----------------------+----------------------------------------------+

Command Window
¤ All FOCUS commands are entered at the Command Window.
¤ Up to 4 lines of commands may be entered at a time.
¤ The title area displays the current command mode (TABLE, FOCUS, etc.)
û Copied to Output and History Windows.
û Submitted for execution.
Output Window
¤ Functions as a session log.
¤ Lines of input are preceded by a caret (>).
¤ Cannot be altered.

History Window
¤ Logs every command entered at the Command Window.
¤ Cursor must be within the history window to view previous commands.
¤ Allows the user to review up to 40 lines entered.
¤ Main FOCUS commands are preceded by caret (>).
¤ Incorrect commands are maintained and preceded by asterisk (*).

Help Window
¤ Displays the PF key settings.
¤ Appears on the screen when:
û PF1 key is pressed.
û WINDOW HELP is entered on the command line.
¤ To remove from the screen, press PF1 again.

Table Window
¤ Displays the results of the most recent TABLE request.
¤ Holds up to the first 10 pages of report data, to a width of 130 characters.
¤ Use ZOOM (PF2) to view previous results.

Error Window
¤ Appears in the middle to top of the screen when a FOCUS error is generated.
¤ Remains on the screen until the error is corrected.
¤ Cursor positioned in the Command Window at the error.
û The part of the command accepted by FOCUS is protected.
¤ After error correction:
û Press ENTER to resubmit the command.
û Enter QUIT to terminate the command.

FOCUS RELATED DATASETS


MASTER

FOCUS.PROD.MASTER - Info. ctr. maintained schemas **


(These schemas are supported by systems staff.)
PROD.FOCUS.MASTER - System maintained schemas.
(These schemas are supported by systems staff.)
FOCUS.USER.MASTER - User created schemas.
TEST.FOCUS.MASTER - Schemas being developed and tested by system staff.
(This library should only be used when recommended by InfoCtr, Data
Administration or system staff.)

FOCEXEC

FOCUS.PROD.EXEC - Info. ctr. maintained programs **


Also, where the file ALLOCATES are stored. (Browse the allocate for
the data set name.)
FOCUS.PROD.GENJCL - Info. ctr. maintained programs **
The file ALLOCATES for GENBATCH.
TEST.FOCUS.EXEC - Programs being developed and tested by systems.
PROD.FOCUS.EXEC - System maintained programs.
FOCUS.USER.EXEC - User created programs.
INFOCTR.ID#___.EXEC - Individal user created programs. User must have an infoctr
allocated in order for FOCBEGIN or INFOTSO FOCUS to work

HOLDMAST
ID#___.FOCUS.HOLDMAST - user created schemas. This is the dataset that holds schemas that
are created when requesting data to be held.

ACCESS PATHS FOR IDMS FILES


GINFOCTR.IDMS.ACCESS - Access path for Group Health IDMS databases
INFOCTR.IDMS.ACCESS - Access path for IDMS databases
PRODUTN.FOCUS.IDMS.ACCESS - Access path for Production IDMS databases

OTHER
FOCUS.PROD.SCHEMAS - Schema documentation **
FOCUS.USER.JCL - Jcl to submit batch jobs. (Note: All TSO logons have read, write,
and create access to all FOCUS.USER files)
PROD.SPECIAL.PROCLIB - Procedures library for programs such as FOCPRINT, and LSTPRINT.**
FOCPP.LOADLIB - Dataset which contains software modules necessary to run FOCUS.**

** ID# logons have read only access to FOCUS.PROD files.

BATCH JOB PROCESSING

//TSOXXXA JOB (TXXX,9999,UT999),'JCLSYS',CLASS=R,


// NOTIFY=TSOXXX,
// MSGCLASS=X
//FOCUCC EXEC FOCUCC
//********************************************************************
//* FOCUCC SCANS THE JCL AND MAKES SURE ANY DATASETS DESIGNATED
//* AS - NEW,CATLG - DOES NOT ALREADY EXIST.
//* IF THE DATASET EXISTS IT WILL BE DELETED AND
//* YOUR FOCUS STEP WILL EXECUTE WITHOUT GENERATING THE 'DUPLICATE
//* NAME ON DIRECT ACCESS VOLUME' ERROR MESSAGE.
//********************************************************************
//FOCUS EXEC PGM=FOCUS
//STEPLIB DD DSN=FOCPP.LOADLIB,DISP=SHR
//MASTER DD DSN=PROD.FOCUS.MASTER,DISP=SHR
// DD DSN=TEST.FOCUS.MASTER,DISP=SHR
//FOCEXEC DD DSN=TEST.FOCUS.EXEC,DISP=SHR
// DD DSN=PROD.FOCUS.EXEC,DISP=SHR
//ERRORS DD DSN=FOCPP.ERRORS,DISP=SHR
//*************************************************************
//HOLDMAST DD DSN=TSOXXX.FOCUS.HOLDMAST,DISP=SHR
//*************************************************************
//HOLD DD UNIT=SYSDA,SPACE=(TRK,(5,10))
//FOCSORT DD UNIT=SYSDA,SPACE=(TRK,(120,120))
//FOCSTACK DD UNIT=SYSDA,SPACE=(TRK,(20,10),RLSE)
//FOCIDMS DD DSN=INFOCTR.IDMS.ACCESS,DISP=SHR
// DD DSN=GINFOCTR.IDMS.ACCESS,DISP=SHR
//SYSOUT DD SYSOUT=*
//OFFLINE DD SYSOUT=*,COPIES=1
//SYSPRINT DD SYSOUT=*
//*********************************************************************
//HOLDNAME DD DSN=TSOXXX.HOLDNAME,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(150,100),RLSE)
//*********************************************************************
//* AFTER THE HOLDFILE IS CREATED THE LRECL AND BLCKSIZE WILL BE
//* ADJUSTED BY FOCUS TO THE ACTUAL LENGTH AND SIZE OF THE FILE
//*********************************************************************
//**************FORMAT USED TO ACCESS THE FILES*******************
//*"SCHEMA" DD DSN="DATASET NAME",DISP=SHR
//*****************************************************************
//**************FOLLOWING FILES THAT ARE TO BE ACCESSED***********
//GLEDGER DD DSN=PRODVSAM.GL.ACCOUNT.MASTER,DISP=SHR
//GLEDRDF DD DSN=PRODVSAM.GL.ACCOUNT.MASTER,DISP=SHR
//SYSIN DD *
OFFLINE
EX PRGNAME
FIN
/*

ACTUAL & USAGE PARAMETERS

TYPE MEANING LENGTH

I Integer number, no decimal 1 to 9


F Decimal number, single precision 1 to 9
D Decimal number, double precision 1 to 16
P Packed decimal 1 to 15
A Character 1 to 256
Z Signed zoned decimal (ACTUAL only) 1 to 15

USAGE PARAMETERS

OPTION MEANING

S Zero Suppress
C Comma Edit
B Bracket Negatives
R Print CR with negatives
M Floating dollar sign
N Fixed dollar sign
MDY Month/Day/Year (MM/DD/YY)
YMD Year/Month/Day (YY/MM/DD)
DMY Day/Month/Year (DD/MM/YY)
T Translate month into alpha
(ie JAN - used as MTDY)
L Print leading zeroes
E Scientific notation

Appendix B. Report Commands


ACROSS Print fields across page.
ROW-TOTAL Totals rows across page.
COLUMN-TOTAL Totals columns down page.
OVER Prints field over field.
AS Specifies column headings.
SUB-TOTAL Provides subtotals for numeric fields in this and all higher control
breaks.
SUBTOTAL Provides subtotals for numeric fields in this control break only.
SUMMARIZE Provides numeric field totals and recalculations.
RECOMPUTE Provides numeric field totals and recalculations for control break
specified.
SUBHEAD Places text before data associated with control break.
SUBFOOT Places text after data associated with control break.
COMPUTE Allow additional calculations at control
RECAP break.
PAGE-BREAK Start a new page.
SKIP-LINE Print a blank line.
FOLD-LINE Fold a line.
UNDER-LINE Print underline across page.
REPAGE Set page counter to 1.

Appendix C. Output Control Options

COLUMN-TOTAL Provide column totals for the report.


ROW-TOTAL Provide row totals for the report.
SUMMARIZE Provide column totals and recalculate computations for the report.
RECAP Compute recaps of columns.
NOTOTAL Eliminate report totals generated by sort control breaks.
SUBFOOT Print text after the report.
SUBHEAD Print text before the report.
SAVE Write output to an external EBCDIC file.
HOLD Write output to a temporary FOCUS file.

Appendix D. Direct Operations


PREFIX MEANING
---------- ---------------
AVE.fieldname Average Value
ASQ.fieldname Average Sum of Squares
MIN.fieldname Minimum Value
MAX.fieldname Maximum Value
LST.fieldname Last Value
FST.fieldname First Value
PCT.fieldname Percent of Column Total
TOT.fieldname Grand Total
ALL.fieldname All Occurrences
SUM.fieldname Sum of the Values
CNT.fieldname Count of the Values
ST.fieldname Subtotal on Subheadings and
Subfootings
CT.fieldname Column Total on Subheadings and
Subfootings

Appendix E. Query Commands

OPTION MEANING
? DEFINE Displays the fields currently defined for a file.
?F filename Lists fields in the master file. (string) (ie.?F EMPLOYEE)
? FDT Displays the file directory table.
? FILE filename Displays the number of records and segments.
? HOLD Displays the active hold files
? JOIN Lists the JOIN structures currently in effect.
? n Displays detailed explanations of error messages. (ie.FOC125 - enter ?
125 for explanation)
? SET Displays the current parameter values.
? STAT Displays the operating statistics (records read and lines printed) for
the last request.

You might also like