Focus Funda11

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 100

Focus- An Introduction

FOCUS FOR S/390


It is a Fourth generation Language It is used as Report Generating tool. Software Product developed by Information Builders Inc.

FOCUS ENVIRONMENT FOCUS is an environment in itself FOCUS environment constitutes mainly of Text editor TED

FINANCIAL REPORTING LANGUAGE


DATA EXPORT INTERFACE AND FILE TRANSFER GRAPH GENERATOR FEATURES FOR THE APPLICATION DEVELOPERS DATABASE MANAGEMENT : MODIFY DIALOG MANAGER FULL SCREEN DATA ENTRY FORMS : FIDEL. WINDOW PAINTER DATA BASE EDITOR : FSCAN

FOCUS JCL is mainly the batch environment.

File definitions
File Definition describes the components of a Master File Description Master File defines the complete structure and format of your data Before you can use FOCUS to write reports, you must create a Master File for each data file you wish to use, regardless of whether the file is a FOCUS file or a non-

FOCUS file (created outside of FOCUS).

MFD
Master File Description is a file that describes a data file to FOCUS. The MFD contains information about the names and formats of the fields in each file segment. It also holds information about the relationship of fields and segments to each other.

Identify the parts of a Master File Description


FILENAME=ARC3850A,SUFFIX=FIX ,$ SEGNAME=ORDHDR, SEGTYP=S1, $ FIELDNAME= ORDER_NUM ,ORDNUM ,P6 , P4 ,$ FIELDNAME= REC_CUST ,RECCST ,A7 ,A7 ,$ FIELDNAME= SHIP_CUST ,SHPCST ,A7 ,A7 ,$ END

Master File
Describes logical construction of data file.

Define Focus Files


USE filename type mode END specifies the nondefault names and locations of data to be referenced by a TABLE command.

Define Focus Files


DEFINE FILE filename used to define [ADD or CLEAR] additional temporary field/format = expression; fields which are field/format = expression; modifications or END combinations of existing fields.

FOCEXEC
user-written FOCUS report procedure

Report Definitions

Basic Reporting commands


Table Request Print, List verbs Sum, Add,Write & Count Basic Sorting Additional Printing Techniques

Basic Reporting commands


Table Request Print, List verbs Sum, Add,Write & Count Basic Sorting Additional Printing Techniques

Table Command
Use the TABLE command to begin report requests Use END or RUN commands to terminate Report requests.

Table Command format


TABLE FILE filename Used to identify the source of data used in reports

Initiates report specification which is finished by END

HEADINGS AND FOOTINGS AND COLUMN TITLES

Report headings and footings may be added by typing the words "HEADING" or "FOOTING.

HEADING
creates a report heading

format is HEADING(CENTER)

PRINT Verb
The PRINT verb prints fields specified on the report in the order requested

Print Command
TABLE FILE MAST PRINT AREA SALES1 DATE1 DATE2 END The output of the focexec is shown below. AREA SALES1 DATE1 DATE2 ------- -------- -------- --------HUSTON 111111 98/02/23 00/11/01 CALCUT 888888 98/02/27 00/02/23 BOMBAY 888888 98/03/01 00/02/23 CALCUT 888888 98/03/02 00/02/23 TEXAS 888888 98/03/03 00/02/23 CALCUT 888888 00/02/28 00/02/23 MADRAS 888888 00/02/29 00/02/23 CALCUT 888888 01/03/01 00/02/23

PRINT Verb
PRINT field [AS 'title'] field...

specifies one or more fields to print


a nonstandard column title can be provided.

Print Verb example


PRINT CUST_NAME AS 'CUSTOMER,NAME' IN 24

END

List Verb
The LIST verb prints the fields specified on the report in the order requested and counts the number of records on the report

LIST Verb
LIST field [AS 'title'] field...

like PRINT but adds an integer counter column

SUM
The SUM verb adds numeric fields specified

SUM Verb
SUM [prefix.]field [AS title'] field... computes a summary for the fields within the category specified by the BY variable

SUM-An example
TABLE FILE FRSMTD SUM TT_CD_AMT - selects the FRS Month-to-Date Transaction data file - sums the amounts of all transactions - selects the first 500 records in the file

WHERE READLIMIT EQ 500

WHERE RECORDLIMIT EQ 10
END

- selects the first 10 records that match

- end of the focexec

SUM-An example(contd.)
PAGE 1 TT_CD_AMT ---------

$284.65

Count
The COUNT verb shows the number of records (does not show individual records)

Count
TABLE FILE FRSSL - selects the FRS Subsidiary Ledger data file COUNT ACCID - counts the number of Account ID's WHERE READLIMIT EQ 500 - selects the first 500 records in the file WHERE RECORDLIMIT EQ 10 - selects the first 10 records that match END - end of the focexec

Count(contd.)
PAGE 1 ACCID

COUNT
----2

Basic Sorting
Most reports are sorted in FOCUS by use of the BY option using BY HIGHEST will result in fields sort from highest to Lowest order default is lowest to highest

Noprint
NOPRINT indicates you wish to sort the report but not display the sort field format is : BY [HIGHEST] field [NOPRINT]

Record Selection
use WHERE and IF conditions to select a subset of records for printing WHERE and IF Conditions

Uses of the WHERE Clause

WHERE
WHERE field rel val [OR val]

specifies a selection criterion, The OR criterion is used with the EQ relational operator.

WHERE
WHERE field LIKE 'mask' a screening of alphanumeric data.;

Where
WHERE field LIKE % WHERE field LIKE _' use % to match any number of characters use _ to match any single character.

Uses of the WHERE Clause


Value comparison and range checking relations. Combined relations range testing Character string screening

Record selection(contd.)
READLIMIT Specifies the total number of records to be read from the data file RECORDLIMIT Specifies the total number of records selected for the report

Examples of Readlimit,Recordlimit
WHERE READLIMIT EQ 100

WHERE RECORDLIMIT EQ 10

TOTALS AND SUBTOTALS With FOCUS, you can add grand totals and subtotals when a specified sort field changes by using the SUMMARIZE option with the BY statement

example :
TABLE FILE filename

PRINT fieldnames
BY sortfield SUMMARIZE END

Additional features of the BY option SKIP-LINE UNDER-LINE

Skips one line Underlines after BY field

PAGE-BREAK Skips to new Page

Some useful commands relating to Files ? F Filename - Lists fields described in MFD

?FF Filename - Lists fields, aliases, format information


? FDT - Displays the file directory table (FOCUS Files)

TABLE FILE filename PRINT LIST SUM COUNT BY [HIGHEST][n]sortfieldn ACROSS [HIGHEST] [n] sortfieldn WHERE field relation expression END [SEG.]field [prefix.field]

Defining Temporary Fields

DEFINE FILE EMPLOYEE MONTHLY_SAL = CURR_SAL/12; END

TABLE FILE EMPLOYEE PRINT EMPLOYEE_ID AND MONTHLY_SAL AND CURR_SAL END
Note: Once the temporary field is defined, you can use it in report requests for the remainder of your FOCUS session

USING THE BY CLAUSE

USED FOR SORTING


DEFAULT IS ASCENDING ORDER VALUES FOR DUPLICATES WILL BE DISPLAYED ONLY ONCE WILL PRECEDE THE PRINT FIELDS. CAN BE OMITTED USING THE NOPRINT OPTION

BY VERB - Sorting Vertically


TABLE FILE EMPLINFO SUM SALARY BY SEX END

PAGE

SEX --F M

SALARY -----526000 808000

ACROSS VERB - Sorting Horizontally


TABLE FILE EMPLINFO SUM SALARY ACROSS SEX END

PAGE

SEX
F M -----------------------526000 808000

SIMPLE MATRIX REPORT


USING BOTH THE ACROSS ND BY VERBS

THE BY VERB ALWAYS LIST THE FIELDS AROSS ROWS


THE ACROSS VERB ALWAYS LISTS THE FIELDS BY COLUMNS

BOTH SUM AND PRINT VERBS CAN BE USED IN TABLE REPORT

ACROSS CANNOT BE USED IN ITSELF.


DOTS REPRESENT EMPTY CELL VALUES IF NO VALUE EXISTS. ACROSS CANNOT HAVE MORE THAN 5 FIELDS.

SAMPLE MATRIX REPORT


TABLE FILE EMPLINFO SUM SALARY ACROSS SEX BY DEPT_ID END

PAGE

SEX F M DEPT_ID --------------------------------D0001 110000 180000 D0002 210000 270000 D0003 108000 204000 D0004 98000 154000

SAMPLE MATRIX REPORT CONT..


INTERCHANGING THE BY AND ACROSS FIELDS

TABLE FILE EMPLINFO SUM SALARY BY SEX ACROSS DEPT_ID END


PAGE 1

DEPT_ID D0001

D0002

D0003

D0004

SEX ----------------------------------------------------F 110000 210000 108000 98000 M 180000 270000 204000 154000

SAMPLE MATRIX REPORT CONT..


USING THE PRINT VERB

TABLE FILE EMPLINFO PRINT SALARY BY SEX ACROSS DEPT_ID END

PAGE

DEPT_ID D0001

D0002

D0003

D0004

SEX ----------------------------------------------------F 10000 . . . . . 12000 . 10000 . . . . . 12000 . 10000 . . . 10000 . . . 10000 . . . 10000 . . . 10000 . . . . . 12000 . . 15000 . . . 15000 . . . . 12000 . . . . 14000 ........... M 10000 . . . 10000 . . . . . 12000 . 10000 . . . 10000 . . . . . 12000 . . 15000 . . 10000 . . . . . 12000 . . 15000 . . . . 12000 . . 15000 . . 10000 . . . . . . 14000

SAMPLE MATRIX REPORT CONT..


USING THE PRINT VERB

TABLE FILE EMPLINFO PRINT SALARY ACROSS SEX BY DEPT_ID END

PAGE

SEX F M DEPT_ID --------------------------------D0001 10000 . . 10000 . 10000 10000 . . 10000 . 10000 10000 . . 10000 10000 . 10000 . 10000 . 10000 . . 10000 . 10000 ............ D0002 . 15000 . 15000 . 15000 . 15000 . 15000 15000 . 15000 . . 15000 . 15000 . 15000 . 15000 . 15000 15000 .

SELECTING RECORDS - WHERE CLAUSE


TABLE FILE EMPLINFO PRINT SALARY BY LAST_NAME WHERE SALARY GT 14000 END
PAGE 1

LAST_NAME --------BERMUDEZ CHAN CHAPMAN CHIZEK CRUZ DAS DAZQUEZ DENNISON DIAZ EASTERLY EL FRAZIER GAUTAM

SALARY -----15000 15000 15000 15000 15000 15000 15000 15000 15000 15000 15000 15000 15000

SUBTOTALS - ON CLAUSE

TABLE FILE EMPLINFO

PRINT SALARY
BY DEPT_ID BY LAST_NAME WHERE SALARY GT 10000 ON DEPT_ID SUBTOTAL END

PAGE DEPT_ID ------D0002

1 SALARY -----15000 15000 15000 15000 15000 15000 15000 15000 480000 12000 12000 12000 12000 12000 12000 12000 12000 12000

LAST_NAME --------BERMUDEZ CHAN CHAPMAN CRUZ .......... GUNTER HALE HESS D0002 TRINNKER *TOTAL DEPT_ID D0002 D0003 CAPETILLO CARRERO DAK DAVIS FITZGERALD FOX ............ WAGONER WATZ WILLIAMS

*TOTAL DEPT_ID D0003 ............. D0004 THOMAS VARKE ZURA


*TOTAL DEPT_ID D0004

312000
14000 14000 14000 252000

TOTAL

1044000

SUB-FOOTERS / WHEN CLAUSE


TABLE FILE EMPLINFO BY LAST_NAME BY SALARY BY DEPT_ID ON SALARY SUBFOOT <13 *** Emp_id: <EMPLOYEE_ID salary exceeds 14000. WHEN SALARY GT 14000 END
PAGE 1

LAST_NAME --------ALEMANY ALVAREZ ANDAYA BATTIATO BERMUDEZ BLACKMER BRILL BROWN CAPETILLO CARRERO CHAN CHAPMAN CHENG

SALARY DEPT_ID ------ ------10000 D0001 10000 D0001 14000 D0004 10000 D0001 15000 D0002 *** EMP_ID: K0053 SALARY EXCEEDS 14000. 10000 D0001 14000 D0004 10000 D0001 12000 D0003 12000 D0003 15000 D0002 *** EMP_ID: K0054 SALARY EXCEEDS 14000. 15000 D0002 *** EMP_ID: K0040 SALARY EXCEEDS 14000. 14000 D0004

SKIP-LINE / UNDER-LINE CLAUSE


TABLE FILE EMPLINFO BY LAST_NAME ON LAST_NAME SKIP-LINE END
PAGE 1

LAST_NAME --------ALEMANY ALVAREZ ANDAYA BATTIATO BERMUDEZ BLACKMER BRILL BROWN

SKIP-LINE / UNDER-LINE CLAUSE


TABLE FILE EMPLINFO BY LAST_NAME ON LAST_NAME UNDER-LINE END
PAGE 1

LAST_NAME --------ALEMANY -----------ALVAREZ -----------ANDAYA -----------BATTIATO -----------BERMUDEZ -----------BLACKMER -----------BRILL -----------BROWN ------------

ALIAS and UNIQUE Field-name


TABLE FILE EMPLINFO PRINT LN END

TABLE FILE EMPLINFO PRINT LAST END

COUNT VERB
TABLE FILE EMPLINFO COUNT EMPL BY DEPT_ID BY SALARY BY SEX END
PAGE 1

DEPT_ID ------D0001

SALARY -----10000 12000 14000 15000 12000 15000 12000 14000 10000 12000

D0002

D0003

D0004

SEX --F M F M F M M F F M F M F M M

EMPLOYEE_ID COUNT ----------7 6 2 3 2 5 4 1 13 18 8 17 1 1 1

PREFIX OPERATORS AVE - Average (Total / Count) ASQ - Average Sum of Squares MIN - Minimum MAX - Maximum FST - First LST - Last CNT - Count CNT.DST - Count Distinct PCT. - Percent to Column Total RPCT. - Percent to Row Total TOT. - Column Total

Syntax

display prefix.fieldname Note: Only SUM OR COUNT display verbs are allowed.

AVE- OPERATOR

TABLE FILE EMPLINFO SUM AVE.SALARY BY DEPT_ID END

PAGE

DEPT_ID ------D0001 D0002 D0003 D0004

AVE SALARY -----12000 14906 12076 13666

ASQ- OPERATOR

TABLE FILE EMPLINFO SUM AVE.SALARY ASQ.SALARY BY LAST_NAME END

PAGE

LAST_NAME --------ALEMANY ALVAREZ ANDAYA BATTIATO BERMUDEZ BLACKMER BRILL BROWN

AVE SALARY -----10000 10000 14000 14000 15000 15000 14000 14000

ASQ SALARY -----100000000 100000000 196000000 196000000 225000000 225000000 196000000 196000000

MAX and MIN - OPERATORS

TABLE FILE EMPLINFO SUM MAX.SALARY AND MIN.SALARY END

PAGE

MAX SALARY -----15000

MIN SALARY -----10000

PCT - OPERATOR TABLE FILE EMPLINFO SUM PCT.SALARY SALARY BY DEPT_ID END

PAGE

DEPT_ID ------D0001 D0002 D0003 D0004

PCT SALARY -----25 34 22 17

SALARY -----348000 477000 314000 246000

RPCT - OPERATOR TABLE FILE EMPLINFO SUM SALARY RPCT.SALARY BY SEX ACROSS DEPT_ID END
PAGE 1

DEPT_ID D0001

D0002

D0003

D0004

RPCT RPCT RPCT SEX SALARY SALARY SALARY SALARY SALARY SALARY SAL ----------------------------------------------------------------------------F 122000 22 207000 38 110000 20 98 M 226000 26 270000 31 204000 24 148

PCT.CNT - OPERATOR TABLE FILE EMPLINFO SUM PCT.CNT.EMPL BY DEPT_ID END


PAGE 1

DEPT_ID ------D0001 D0002 D0003 D0004

PCT.CNT EMPLOYEE_ID ----------27.62 30.48 24.76 17.14

FST - OPERATOR TABLE FILE EMPLOYEE SUM FST.EMPL END

PAGE

FST EMPLOYEE_ID ----------K0001

LST - OPERATOR TABLE FILE EMPLOYEE SUM LST.EMPL END

PAGE

LST EMPLOYEE_ID ----------K0105

BY ROWS OVER - OPTION TABLE FILE EMPLINFO PRINT FN BY SEX ROWS M OVER F END
PAGE 1

M M M M M M M

FIRST_NAME ---------MICHAEL SHANKAR GEORGE WAH ANTONIO SHAWN TITO

ACROSS COLUMNS AND - OPTION TABLE FILE EMPLINFO PRINT FN ACROSS SEX COLUMNS M AND F END
PAGE 1

SEX M F ---------------------------. LARRY MICHAEL . SHANKAR . . GLEN GEORGE . WAH . . HECTOR . LUIS ANTONIO . SHAWN . TITO .

Numeric Data Ranges - OPTION TABLE FILE EMPLINFO PRINT FN BY SALARY IN-GROUPS-OF 1000 END
PAGE 1 SALARY -----10000 FIRST_NAME ---------LARRY SHANKAR GEORGE HECTOR ANTONIO ............. JOHN MARY ATANYA MELODY RAY DWAYNE AMANDA MICHAEL GLEN WAH LUIS

12000

Numeric Data Ranges - FOR OPTION TABLE FILE EMPLINFO PRINT FN FOR SALARY 13999 To 15100 OVER 9999 TO 10100 OVER 11000 TO 12450 PAGE END
13999 13999 13999 13999 13999 13999 13999 13999 13999 13999 9999 9999 9999 9999 9999 9999

FIRST_NAME ---------GEORGE DANNETTE ED ATUL PAUL MARTY REBECCA KELLY RAY RICHARD LARRY SHANKAR GEORGE HECTOR ANTONIO SHAWN

Sorting by Rank: HIGHEST/LOWEST OPTION TABLE FILE EMPLINFO PRINT FN BY HIGHEST 10 AGE PAGE END
AGE --59 57 56

53 52 51 49 48 47 46

FIRST_NAME ---------DANNETTE SCOTT CARLA BRYAN ALICE RASHED ALFREDO RAYMOND VANNESSA YVONE MELODY MARY SHAWN RICHARD MARTY AMANDA LUIS TINA TOM KARL JOBY JANE

Multiple SORT requests TABLE FILE SUM SALARY SUM SALARY SUM SALARY SUM SALARY END
SALARY -----334000 DEPT_ID ------D0001

EMPLINFO BY DEPT_ID BY DEPT_ID BY SEX BY DEPT_ID BY SEX BY AGE

SALARY -----290000

SEX --F

SALARY -----110000

180000

AGE --23 28 31 33 38 41 48 51 52 57 26 27 32 33 34 35

SALARY -----10000 10000 10000 10000 10000 10000 10000 10000 20000 10000 20000 10000 30000 20000 10000 10000

WHERE Cond.. TABLE FILE EMPLINFO PRINT LAST_NAME AND FIRST_NAME BY LAST_NAME NOPRINT WHERE (SAL GT 10000) AND (DEPT IS 'D0003') END
PAGE 1

LAST_NAME --------CAPETILLO CARRERO DAK DAVIS FITZGERALD FOX FRY GERRY MARCUS MATTHEWS

FIRST_NAME ---------NYDIA TITO MARTIN JANE ED PAUL SUE BRIAN DAN MICHAEL

WHERE Cond..

Selection criteria from File


tso alloc f(nameinfo) da('w5197.test.nameinfo') shr reu TABLE FILE EMPLINFO PRINT LAST BY LAST_NAME NOPRINT WHERE FN IN FILE NAMEINFO END
PAGE 1

LAST_NAME --------EDDENS PROIETTI SEVERNS WILLIAMS

FIRST_NAME ---------DAVID DAVID AMIKO BRYAN

WHERE Cond..

Selection criteria from File


TABLE FILE EMPLINFO SUM SALARY BY AGE WHERE TOTAL SALARY EXCEEDS 80000 END

PAGE

AGE --31 32 34 45

SALARY -----81000 112000 92000 81000

|-------------|----------------------------------------| |Operator |Meaning | |-------------|----------------------------------------| |EQ |Tests for and selects values equal to | |IS |the test expression. | |-------------|----------------------------------------| |NE |Tests for and selects values not equal | |IS-NOT |to the test expression. | |-------------|----------------------------------------| |GE |Tests for and selects values greater | | |than or equal to the test value (based | |-------------|----------------------------------------| |GT |Tests for and selects values greater | |EXCEEDS |than the test value. | |IS-MORE-THAN | | |-------------|----------------------------------------| |LT |Tests for and selects values less than | |IS-LESS-THAN |the test value. | |-------------|----------------------------------------| |LE |Tests for and selects values less than | | |or equal to the test value. | |-------------|----------------------------------------| |GE lower AND |Tests for and selects values within a | |... |range of values. | | LE upper | | |-------------|----------------------------------------| |LT lower OR |Tests for and selects values outside of | |... |a range of values. | | GT upper | | |-------------|----------------------------------------|

|-------------|----------------------------------------| |OMITS |Tests for and selects values that do not| |NOT LIKE |include a character string matching test| | |value. The string cannot occur in any | | |position in the value being tested.When | | |used with WHERE, can test alphanumeric | | |fields; when used with IF, can test both| | |alphanumeric and text fields. | |-------------|----------------------------------------| |INCLUDES |Tests whether a chain of values of a | | |given field in a child segment includes | | |all of a list of literals. | |-------------|----------------------------------------| |EXCLUDES |Tests whether a chain of values of a | | |given field in a child segment excludes | | |all of a list of literals. | |-------------|----------------------------------------| |IN (z,x,y) |Selects records based on values found in| | |an unordered list. | |-------------|----------------------------------------| |NOT ... IN |Selects records based on values not | |(z,x,y) |found in an unordered list. | |-------------|----------------------------------------| |IN FILE |Selects records based on values stored | | |in a sequential file. | |-------------|----------------------------------------| |NOT ... IN |Selects records with field values not | |FILE |found in a sequential file. | |-------------|----------------------------------------|

|-------------|----------------------------------------| |FROM lower |Tests for and selects values within a | | TO upper |range of values. | |-------------|----------------------------------------| |IS-FROM lower|Tests for and selects values within a | | |range of values. This is alternate | | TO upper |syntax for FROM lower to UPPER; both | | |operators produce identical results. | |-------------|----------------------------------------| |NOT-FROM | Tests for and selects values that are | |lower |outside a range of values. | | TO upper | | |-------------|----------------------------------------| |IS MISSING |Tests whether a field contains null | |IS-NOT |values-that is, if some instances of the| |MISSING |field contain no data (have "missing" | |NE MISSING |data). For a thorough examination of | | |missing data, see Section 4.7 . | |-------------|----------------------------------------| |CONTAINS |Tests for and selects values that | |LIKE |include a character string matching test| | |value. The string can occur in any | | |position in the value being tested. When| | |used with WHERE, can test alphanumeric | | |fields; when used with IF, can test both| | |alphanumeric and text fields. | |-------------|----------------------------------------|

WHERE Cond..

NOT-FROM lower TO upper


TABLE FILE EMPLINFO PRINT SAL BY LAST_NAME WHERE SAL NOT-FROM 10000 TO 14000 END
PAGE 1

LAST_NAME --------BERMUDEZ CHAN CHAPMAN CHIZEK CRUZ DAS DAZQUEZ

SALARY -----15000 15000 15000 15000 15000 15000 15000

WHERE Cond..

NOT-FROM lower TO upper


TABLE FILE EMPLINFO PRINT SAL BY LAST_NAME WHERE LAST_NAME CONTAINS 'J' END
PAGE 1

LAST_NAME --------FUJITANI JAYALAXMI TALREJA

SALARY -----10000 15000 14000

WHERE Cond..

LIKE Operator
TABLE FILE EMPLINFO PRINT LN WHERE LN LIKE 'C%' END

PAGE

LAST_NAME --------CARRERO CRUZ CHAPMAN CAPETILLO CHAN CHENG CHIZEK

WHERE Cond..

LIKE Operator
TABLE FILE EMPLINFO PRINT LN WHERE LN LIKE %J%' END

PAGE

LAST_NAME --------TALREJA FUJITANI JAYALAXMI

WHERE Cond..

LIKE Operator
TABLE FILE EMPLINFO PRINT DEPT_ WHERE DEPT_I LIKE '_0003' END

PAGE

DEPT_ID ------D0003 D0003 D0003 D0003 D0003 D0003 D0003 D0003

WHERE Cond..

RECORDLIMIT Operator
TABLE PRINT WHERE WHERE END FILE EMPLINFO FN FN LIKE '%A' RECORDLIMIT EQ 4

PAGE

FIRST_NAME ---------ATANYA LAURA KAWANNA LUCIA

WHERE Cond..

READLIMIT Operator
TABLE PRINT WHERE WHERE END FILE EMPLINFO FN FN LIKE '%A' READLIMIT EQ 4

PAGE

FIRST_NAME ---------ATANYA LAURA KAWANNA LUCIA REBECCA

IF

* * * *

Functionally Similar to WHERE Has a SUBSET of functions provided by WHERE Can use TEXT fields (not possible in WHERE) No difference in syntax, what so ever.

DEFINE AND COMPUTE

Both are temporary fields Can be created either in the report or specified in MFD. (In case of COMPUTE only in reports). DEFINE results are stored across session. COMPUTE results are deleted after the report gets executed. COMPUTE field is calculated after every record has been selected, sorted and summed. DEFINE operations are calculated on each retrieved record

DEFINE and COMPUTE

DEFINE FILE EMPLINFO SALVSAGE = SALARY/AGE; END TABLE FILE EMPLINFO SUM SALARY AND SALVSAGE COMPUTE SALVAGE = SALARY/AGE; END
PAGE 1

SALARY -----1334000

SALVSAGE -------37,991.09

SALVAGE ------339.87

ADD AND CLEAR OPTIONS

ADD - TO add additional fields to existing fields. CLEAR - To Clear the already Defined fields REDEFINES - When the field name is same across segments, to differentiate between the fields.

ADD AND CLEAR OPTIONS

DEFINE FILE EMPLINFO SALVSAGE = SALARY/AGE; END DEFINE FILE EMPLINFO ADD SALHALF = SALARY/2; END DEFINE FILE EMPLINFO CLEAR END

You might also like