Professional Documents
Culture Documents
------------------------------------------------------------------
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
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
*************************************************************
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
High-to-Low
+-------------------------------+
| BY (HIGHEST) {n} sortfield |
+-------------------------------+
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
Output:
+---------------------+
| PAGE 1 |
| LAST_NAME FIRST_NAME|
| --------- ----------|
| STEVENS ALRED |
| . . |
| . . |
| . . |
+---------------------+
Then:
> OFFLINE (Press ENTER)
> RETYPE (Press ENTER)
> ONLINE (Press ENTER)
SUM VERB
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)
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 *
+--------------+
| 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
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 |
ACROSS
+----------------------------------------------------------------+
| ACROSS (HIGHEST) sortfield (IN-GROUPS_OF quantity) |
+----------------------------------------------------------------+
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 |
+----------------------------+
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' |
+---------------------------+
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.
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
EXAMPLE:
EX CONMALLC
TABLEF FILE CONAMES
PRINT COID REGION SHORTNM CITYST BEDS
IF FACTYP EQ 'H'
IF STATUS EQ 2
END
(7) {END }
{RUN }
{QUIT}
COMPUTE
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
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 ABBREVIATIONS
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 |
+---------------------------------------------------------------------+
Output:
+------+
| IN n|
+------+
Request:
Output:
+-------------------------------+ +--------------------------------+
| BANK_NAME LAST_NAME BAN|_AC|T BANK_ACCT BANK_NAME| LAST_NAME
| --------- --------- ---|---|- --------- ---------| ---------
| GREENSPAN | | | GREENSPAN
| MCCOY | | | MCCOY
| ROMANS | | | ROMANS
+---------------------------+
|field AS 'title(, ...title5'|
+---------------------------+
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
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|
+---------------------------------------------------------------------+
+----------------------------+
| ON fieldname operation |
+----------------------------+
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.
Request:
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:
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:
IF STATEMENTS
Request:
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
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 |
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
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:
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 |
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
MONTH TRANSLATION:
Usage Meaning Example
----- ------- -------
MT short form upper case JAN
MTR complete upper case JANUARY
Masterfile:
Output:
+----------------------------------------------------------+
| PAGE 1 |
| LAST_NAME DATE OF HIRE |
| --------- ------------ |
| STEVENS Saturday, June 2 1980 |
| JONES Monday, May 1 1980 |
| BROWN Saturday, November 25 1985 |
+----------------------------------------------------------+
Masterfile:
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 |
+---------------------------------------------------------------------+
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:
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
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.
+---------------------------------------------------------------------+
| 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:
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 |
+-------------------------------------------------------------------+
+-------------------------------------------+
| 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:
Output:
+-------------------------------------------------------------------+
| COUNTRY CAR BODYTYPE |
| ------- --- -------- |
| ENGLAND JAGUAR CONVERTIBLE |
| ITALY ALFA ROMEO COUPE |
| ALFA ROMEO ROADSTER |
| MASERATI COUPE |
+-------------------------------------------------------------------+
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
+-------------------------------------------------------------+
| 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.
Request 1: Request 2:
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 |
+---------------------------------------------------------------+
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 || |
+-----------------------------------++----------------------------------+
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
+-----------------------------------+
| Check File(filename) Picture |
+-----------------------------------+
+---------------------------------------------------------------------+
| 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.
************************************************************************
JOIN deffld WITH dbfld in HOSTFILE TO (ALL) field2 in CRFILE as JOINNAME
************************************************************************
EXAMPLE OF THE DEFINED-based JOIN
---------------------------------
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
COMMAND RECAP
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.
FOCEXEC
HOLDMAST
ID#___.FOCUS.HOLDMAST - user created schemas. This is the dataset that holds schemas that
are created when requesting data to be held.
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.**
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
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.