Professional Documents
Culture Documents
Student Guide
EAS101
DPEC, Inc.
This courseware and manual are protected by the U. S. Copyright Law (Title 17 United States
Code). Unauthorized reproduction and/or sales may result in imprisonment of up to one year and
fines of up to $10,000 (17 USC 505). Copyright infringements may be subject to civil liability up
to $50,00 (17 USC 504).
11.95
USING EASYTRIEVE PLUS Table of Contents
DPEC, Inc.
EASYTRIEVE PLUS OVERVIEW--Introduction A1
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
DPEC, Inc. 1
A1 EASYTRIEVE PLUS OVERVIEW--Introduction
EASYTRIEVE PLUS.
EASYTRIEVE PLUS
NOTE:
Throughout this course, to save time and space, we will
often refer to EASYTRIEVE PLUS as EASYTRIEVE or EZT+.
2 DPEC, Inc.
EASYTRIEVE PLUS OVERVIEW--Introduction A1
Now that you have some idea of what EASYTRIEVE has to offer,
let's examine the basic sections and flow of an EASYTRIEVE
program.
• Environment
• Library
• Activity
You use the Library section to define the data your program
will use: input, output and working storage fields. It is
recommended but not required.
• FILE statement
• field definitions
DPEC, Inc. 3
A1 EASYTRIEVE PLUS OVERVIEW--Introduction
Filename EMPFILER
Attributes Record Format = FB Record Size = 74 Blocksize = 1800
ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ Library ³
³ statements ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ JOB ³ ³ SORT ³
³ statements ³ ³ statement ³
³ procedures ³ ³ procedures ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ REPORT ³
³ statements ³
³ procedures ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ
4 DPEC, Inc.
EASYTRIEVE PLUS OVERVIEW--Introduction A1
DPEC, Inc. 5
A2 EASYTRIEVE PLUS OVERVIEW--Program Examples
6 DPEC, Inc.
EASYTRIEVE PLUS OVERVIEW--Program Examples A2
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
DPEC, Inc. 7
A2 EASYTRIEVE PLUS OVERVIEW--Program Examples
FILE EMPFILER
F-NAME 10 8 A
L-NAME 18 10 A
DEPT 28 5 A
TOTAL-SICK 67 2 N 0
USED-SICK 69 2 N 0
TOTAL-VAC 71 2 N 0
USED-VAC 73 2 N 0
JOB INPUT EMPFILER NAME DAYSOFF
PRINT REPT1
REPORT REPT1
SEQUENCE DEPT L-NAME
TITLE 01 'VACATION AND SICK DAYS REPORT'
LINE 01 DEPT F-NAME L-NAME TOTAL-SICK USED-SICK TOTAL-VAC USED-VAC
8 DPEC, Inc.
EASYTRIEVE PLUS OVERVIEW--Program Examples A2
FILE EMPFILER
SSNUM 1 9 N
F-NAME 10 8 A
L-NAME 18 10 A
DEPT 28 5 A
SALARY 62 5 N 0
FILE SALSORT
COPY EMPFILER
SORT EMPFILER TO SALSORT +
USING (DEPT SALARY D)
JOB INPUT SALSORT NAME SALARY
PRINT RPT1-SALARY
PRINT RPT2-SALARY
REPORT RPT1-SALARY
TITLE 'EMPLOYEE SALARIES BY NAME WITHIN DEPARTMENT'
LINE 01 DEPT F-NAME L-NAME SALARY
REPORT RPT2-SALARY
TITLE 'EMPLOYEE SALARIES BY SS NUMBER WITHIN DEPARTMENT'
LINE 01 DEPT SSNUM SALARY
DPEC, Inc. 9
A2 EASYTRIEVE PLUS OVERVIEW--Program Examples
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ SYMBOL ³ MEANING ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ UPPERCASE ³ Keywords or options. You must spell these ³
³ ³ exactly as shown, though they can be in ³
³ ³ lowercase. ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ lowercase ³ Values that you supply. ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ < > ³ Optional entry or choice of entry. ³
³ angle brackets ³ ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ ³ ³ You must choose at least one value from ³
³ vertical bar ³ a group. ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ ... ³ The parameters preceding the ellipsis can be ³
³ in syntax ³ repeated any number of times ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ ... in code ³ Code is omitted ³
³ ... in output ³ Output lines are omitted ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
10 DPEC, Inc.
EASYTRIEVE PLUS OVERVIEW--Program Examples A2
Note: You will find that the syntax for EASYTRIEVE PLUS
statements presented in this course does not cover
all optional parameters.
DPEC, Inc. 11
A2 EASYTRIEVE PLUS OVERVIEW--Program Examples
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ Character ³ Function ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ . period ³ ends a statement ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ blank ³ separates the parts of a statement ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ () parentheses ³ enclose multiple subparameters ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ , comma ³ separates for readability (optional) ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ : colon ³ delimits file, record and field ³
³ ³ qualifications ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
³ ' ' single quotes ³ enclose alphabetic literals ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
12 DPEC, Inc.
EASYTRIEVE PLUS OVERVIEW--Program Examples A2
78306
-78306
-78306.245
The rules presented here are some of the most basic coding
rules. For more detail and a complete listing, see your
EZT+ documentation.
DPEC, Inc. 13
B1 BUILDING A SIMPLE PROGRAM--Coding a Library Section
9 prints a digit
Z prints a digit, or if a leading zero, a blank
* prints a digit, or if a leading zero, an *
- prints a minus sign before the first non-zero
digit of a negative number
$ prints a currency symbol ($) before the first
non-zero digit and suppresses leading zeros
14 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a Library Section B1
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
DPEC, Inc. 15
B1 BUILDING A SIMPLE PROGRAM--Coding a Library Section
Example: L-NAME 18 10 A
SALARY 50 5 N 0
16 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a Library Section B1
The top three data-types are the most commonly used. For
all except alphanumeric, EASYTRIEVE can perform calculations
on the data in that field.
Example: BIWEEKLY-GROSS 84 4 P 2
To keep columns with long names from being too wide on the
report, stack the headings by making each word a literal.
DPEC, Inc. 17
B1 BUILDING A SIMPLE PROGRAM--Coding a Library Section
9 prints a digit
Z prints a digit, or if a leading zero, a blank
* prints a digit, or if a leading zero, an *
- prints a minus sign before the first non-zero
digit of a negative number
$ prints a currency symbol ($) before the first
non-zero digit and suppresses leading zeros
18 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a Library Section B1
SALARY 50 5 N '99999'
SALARY 50 5 N 0 'ZZ,ZZZ-'
SALARY 50 5 N 2 'ZZZ.99-'
DPEC, Inc. 19
B1 BUILDING A SIMPLE PROGRAM--Coding a Library Section
BIWEEKLY-GROSS 84 4 P 2
BIWEEKLY-NET 88 4 P 2
DEDUCTIONS W 4 P 2
TOTAL-GROSS S 6 P 2
TOTAL-EMP S 2 P
With working storage fields, you can use the VALUE option
to assign initial values to fields.
PROPOSED-RAISE-PERCENT W 2 N VALUE 05
These are all the fields from the input file that we need
to define.
FILE EMPFILER
F-NAME 10 8 A
L-NAME 18 10 A
DEPT 28 5 A
PAY-GRADE 44 2 N
TOTAL-VAC 71 2 N 0
USED-VAC 73 2 N 0
20 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a Library Section B1
FILE EMPFILER
F-NAME 10 8 A
L-NAME 18 10 A
DEPT 28 5 A
PAY-GRADE 44 2 N
TOTAL-VAC 71 2 N 0
USED-VAC 73 2 N 0
NEW-VAC W 2 N 0
VAC-REMAIN W 2 N 0
The working storage field NEW-VAC will hold the new total
amount of vacation days for each employee.
FILE EMPFILER
F-NAME 10 8 A HEADING 'FIRST NAME'
L-NAME 18 10 A HEADING 'LAST NAME'
DEPT 28 5 A HEADING 'DEPARTMENT'
PAY-GRADE 44 2 N
TOTAL-VAC 71 2 N 0
USED-VAC 73 2 N 0 HEADING ('VACATION' 'USED')
NEW-VAC W 2 N 0 HEADING ('NEW' 'TOTAL' 'VACATION')
VAC-REMAIN W 2 N 0 HEADING ('VACATION' 'REMAINING')
DPEC, Inc. 21
B2 BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section
22 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section B2
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
DPEC, Inc. 23
B2 BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section
24 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section B2
= or EQ equal to
ª= or NE not equal to (see NOTE)
> or GT greater than
< or LT less than
>= or GE greater than or equal to
<= or LE less than or equal to
literal IF USED-SICK LT 3
field IF USED-SICK = TOTAL-SICK
arithmetic expression IF USED-SICK > (TOTAL-SICK / 2)
DPEC, Inc. 25
B2 BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section
26 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section B2
This statement will select records that test true for either
of the following conditions:
DPEC, Inc. 27
B2 BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section
BI-WEEKLY-SALARY 85 6 N 2
NEWSAL W 7 N 2
You can use INTEGER with ROUNDED to first round the result
and then transfer only the numerics to the receiving field.
Assume that these fields are defined:
SALARY 62 5 N 0
INCREASE W 4 N 0
28 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section B2
FILE EMPFILER
F-NAME 10 8 A HEADING 'FIRST NAME'
L-NAME 18 10 A HEADING 'LAST NAME'
DEPT 28 5 A HEADING 'DEPARTMENT'
PAY-GRADE 44 2 N
TOTAL-VAC 71 2 N 0
USED-VAC 73 2 N 0 HEADING ('VACATION' 'USED')
NEW-VAC W 2 N 0 HEADING ('NEW' 'TOTAL' 'VACATION')
VAC-REMAIN W 2 N 0 HEADING ('VACATION' 'REMAINING')
DPEC, Inc. 29
B2 BUILDING A SIMPLE PROGRAM--Coding a JOB Activity Section
FILE EMPFILER
... field definition statements ...
JOB INPUT EMPFILER NAME COURSE-EXAMPLE
IF PAY-GRADE > 3
NEW-VAC = TOTAL-VAC + 2
ELSE
NEW-VAC = TOTAL-VAC + 1
END-IF
VAC-REMAIN = NEW-VAC - USED-VAC
PRINT REPT1
And finally, the PRINT statement makes the data selected available
to a report named REPT1.
30 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a REPORT Section B3
DPEC, Inc. 31
B3 BUILDING A SIMPLE PROGRAM--Coding a REPORT Section
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
32 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a REPORT Section B3
Beyond this basic syntax, there are parameters you can add
to tailor the report to your requirements. These parameters
fall into four categories:
• spacing control
• testing aid
• format determination
• file directing
DPEC, Inc. 33
B3 BUILDING A SIMPLE PROGRAM--Coding a REPORT Section
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
³ PARAMETER ³ DESCRIPTION ³ DEFAULT ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ PAGESIZE ³ number of lines per page ³ 58 ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ LINESIZE ³ length per line ³ 132 ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ SKIP ³ blank lines between line groups ³ 0 ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ SPACE ³ blanks between field columns and ³ ³
³ ³ between fields and literals in titles ³ 3 ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ TITLESKIP ³ blank lines after title line(s) ³ ³
³ ³ before heading or detail lines begin ³ 3 ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ SPREAD ³ spreads data evenly over entire line; ³ NOSPREAD ³
³ ³ overrides SPACE ³ ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ NOADJUST ³ left-justifies title lines and body ³ centered ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ NODATE ³ suppresses date on first title line ³ prints ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ NOPAGE ³ suppresses page number on title line ³ prints ³
ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
³ NOHEADING ³ suppresses column headings ³ prints ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
To summarize ...
SKIP, SPACE and TITLESKIP allow you to add extra blank lines
and spaces to make your report more attractive.
34 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a REPORT Section B3
• SEQUENCE
• CONTROL
• SUM
• TITLE
• HEADING
• LINE
DPEC, Inc. 35
B3 BUILDING A SIMPLE PROGRAM--Coding a REPORT Section
36 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a REPORT Section B3
CONTROL DEPT
TITLE 'NEW SALARY AND BONUS FIGURES'
TITLE 3 'FOR THE' -2 DEPT 'DEPARTMENT'
DPEC, Inc. 37
B3 BUILDING A SIMPLE PROGRAM--Coding a REPORT Section
38 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a REPORT Section B3
List TALLY on the LINE statement just like any other field.
Use a HEADING statement to give the value a more descriptive
name.
DPEC, Inc. 39
B3 BUILDING A SIMPLE PROGRAM--Coding a REPORT Section
FILE EMPFILER
... field definition statements ...
JOB INPUT EMPFILER NAME COURSE-EXAMPLE
IF PAY-GRADE > 3
NEW-VAC = TOTAL-VAC + 2
ELSE
NEW-VAC = TOTAL-VAC + 1
END-IF
VAC-REMAIN = NEW-VAC - USED-VAC
PRINT REPT1
40 DPEC, Inc.
BUILDING A SIMPLE PROGRAM--Coding a REPORT Section B3
FILE EMPFILER
... field definition statements ...
JOB INPUT EMPFILER NAME COURSE-EXAMPLE
logic statements
PRINT REPT1
REPORT REPT1
SEQUENCE DEPT L-NAME
CONTROL DEPT
TITLE 'NEW VACATION TOTALS AFTER BONUS DAYS AWARDED'
DEPT F-NAME L-NAME NEW-VAC USED-VAC VAC-REMAIN
LINE DEPT F-NAME L-NAME NEW-VAC USED-VAC VAC-REMAIN
FILE EMPFILER
F-NAME 10 8 A HEADING 'FIRST NAME'
L-NAME 18 10 A HEADING 'LAST NAME'
DEPT 28 5 A HEADING 'DEPARTMENT'
PAY-GRADE 44 2 N
TOTAL-VAC 71 2 N 0
USED-VAC 73 2 N 0 HEADING ('VACATION' 'USED')
NEW-VAC W 2 N 0 HEADING ('NEW' 'TOTAL' 'VACATION')
VAC-REMAIN W 2 N 0 HEADING ('VACATION' 'REMAINING')
JOB INPUT EMPFILER NAME COURSE-EXAMPLE
IF PAY-GRADE > 3
NEW-VAC = TOTAL-VAC + 2
ELSE
NEW-VAC = TOTAL-VAC + 1
END-IF
VAC-REMAIN = NEW-VAC - USED-VAC
PRINT REPT1
REPORT REPT1
SEQUENCE DEPT L-NAME
CONTROL DEPT
TITLE 'NEW VACATION TOTALS AFTER BONUS DAYS AWARDED'
LINE DEPT F-NAME L-NAME NEW-VAC USED-VAC VAC-REMAIN
DPEC, Inc. 41
B3 BUILDING A SIMPLE PROGRAM--Coding a REPORT Section
NEW
TOTAL VACATION VACATION
DEPARTMENT FIRST NAME LAST NAME VACATION USED REMAINING
...
42 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT Statement Parameters C1
DPEC, Inc. 43
C1 CUSTOMIZING THE REPORT--Using REPORT Statement Parameters
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
44 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT Statement Parameters C1
DPEC, Inc. 45
C1 CUSTOMIZING THE REPORT--Using REPORT Statement Parameters
NEW
TOTAL VACATION VACATION
DEPARTMENT FIRST NAME LAST NAME VACATION USED REMAINING
46 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT Statement Parameters C1
NEW
TOTAL VACATION VACATION
DEPARTMENT FIRST NAME LAST NAME VACATION USED REMAINING
...
DPEC, Inc. 47
C1 CUSTOMIZING THE REPORT--Using REPORT Statement Parameters
TALLY -- defined as 10 P 0.
You first define the file in the Library section and then
create it with the REPORT section.
• no titles or headings
• can print multiple labels side-by-side
• allows for control breaks but doesn't automatically
total quantitative fields
48 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT Statement Parameters C1
FILE EMPFILER
F-NAME 10 8 A
L-NAME 18 10 A
DEPT 28 5 A
WORK-PHONE 74 4 N
MAIL-STOP 96 4 A
JOB INPUT EMPFILER NAME CONTACT
PRINT CONTACT-LABELS
REPORT CONTACT-LABELS LABELS (ACROSS 2 DOWN 4 SIZE 35) SPACE 1
SEQUENCE DEPT L-NAME
LINE 1 COL 5 F-NAME L-NAME
LINE 2 COL 5 WORK-PHONE
LINE 3 COL 5 MAIL-STOP
You must also define the printer file in the library section
with a FILE statement: FILE PRFORM PRINTER
DPEC, Inc. 49
C1 CUSTOMIZING THE REPORT--Using REPORT Statement Parameters
NEW
TOTAL VACATION VACATION
DEPARTMENT SUPERVISOR VACATION USED REMAINING
FIN Anderson 16 6 10
FIN Mathers 16 6 10
FIN 32 12 20
HRES Liam 32 6 26
HRES 32 6 26
MNT Holmes 11 4 7
MNT 11 4 7
SALES Zetsky 27 8 19
SALES 27 8 19
SYS Matsko 49 12 37
SYS 49 12 39
151 42 109
50 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT PROCs C2
DISPLAY 'literal'³field-name
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
DPEC, Inc. 51
C2 CUSTOMIZING THE REPORT--Using REPORT PROCs
• REPORT-INPUT
• BEFORE-BREAK
• AFTER-BREAK
• BEFORE-LINE
• AFTER-LINE
• ENDPAGE
• TERMINATION
There are two ways to start a PROC. Either code the keyword
PROC on the same line with the proc-name, or put the keyword
on the next line. Note that in the first method, a period
and a space follow the proc-name before the keyword is coded.
This course uses the first method.
52 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT PROCs C2
FILE EMPFILER
L-NAME 18 10 A HEADING 'LAST NAME'
DEPT 28 5 A ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
SALARY 62 5 N 0 ³ The logic in the JOB section ³
INCREASE W 3 N 2 ³ calculates a new salary for ³
NEW-SAL W 6 N 0 HEAD³ each employee and stores the ³
TOTAL-SAL S 7 N 0 ³ total salary amount in an S ³
PCT-SAL-TO-TOT W 4 N 2 HEAD³ working storage field. ³
JOB INPUT EMPFILER NAME NEW-SALARY ³ ³
INCREASE = 1.03 ³ In the REPORT section we want ³
NEW-SAL = SALARY * INCREASE ³ to show the new salary for ³
TOT-SAL = TOT-SAL + NEW-SAL ³ each employee and also what ³
PRINT RPT-SAL ³ percent that salary is of the ³
REPORT RPT-SAL ³ total company salary amount. ³
SEQUENCE DEPT SALARY ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
CONTROL DEPT
TITLE 'NEW SALARIES AFTER INCREASE'
LINE DEPT L-NAME NEW-SAL PCT-SAL-TO-TOT
DPEC, Inc. 53
C2 CUSTOMIZING THE REPORT--Using REPORT PROCs
FILE EMPFILER
L-NAME 18 10 A HEADING 'LAST NAME'
DEPT 28 5 A ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
SALARY 62 5 N 0 ³ The REPORT-INPUT procedure ³
INCREASE W 3 N 2 ³ performs the calculation for ³
NEW-SAL W 6 N 0 HEAD³ each record input to the ³
TOTAL-SAL S 7 N 0 ³ report. ³
PCT-SAL-TO-TOT W 4 N 2 HEAD³ ³
JOB INPUT EMPFILER NAME NEW-SALARY ³ At the time the PROC executes, ³
INCREASE = 1.03 ³ the TOT-SAL field contains the ³
NEW-SAL = SALARY * INCREASE ³ total of all new salaries. ³
TOT-SAL = TOT-SAL + NEW-SAL ³ ³
PRINT RPT-SAL ³ Note the use of the SELECT ³
REPORT RPT-SAL ³ statement to pass the record ³
SEQUENCE DEPT SALARY ³ on to the report. ³
CONTROL DEPT ³ ³
TITLE 'NEW SALARIES AFTER INCREAS³ ³
LINE DEPT L-NAME NEW-SAL PCT-SALÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
REPORT-INPUT. PROC
PCT-SAL-TO-TOT ROUNDED = NEW-SAL / TOT-SAL * 100
SELECT
END-PROC
% OF
TOTAL
DEPT LAST NAME NEW SALARY SALARY
FIN Snyder 29,252 7.58
Mathers 40,067 10.38
FIN 69,319 17.96
HRES Yashiki 33,475 8.67
Washington 46,659 12.09
HRES 80,134 20.76
MNT Wilson 26,574 6.88
MNT 26,574 6.88
SALES Freeman 41,200 10.68
Vincent 41,200 10.68
SALES 82,400 21.36
SYS Jones 31,930 8.27
Johnson 42,539 11.02
Saez 52,839 13.69
SYS 127,308 32.98
385,735 99.94
54 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT PROCs C2
This example will show why at times you may need to modify
totals that appear on total lines produced by the CONTROL
statement. Examine the program below and then take a look
at the output that follows.
FILE EMPFILER
...
PCT-OF-SALARY W 4 N 2
BONUS-AMT W 4 N 0
JOB INPUT EMPFILER NAME PROJECTION
BONUS-AMT = 2000
PCT-OF-SALARY ROUNDED = (BONUS-AMT / SALARY) * 100
PRINT RPT1
REPORT RPT1
SEQUENCE DEPT L-NAME
CONTROL DEPT
TITLE 'IMPACT OF PROJECTED $2000 BONUS'
LINE DEPT F-NAME L-NAME SALARY BONUS-AMT PCT-OF-SALARY
DPEC, Inc. 55
C2 CUSTOMIZING THE REPORT--Using REPORT PROCs
FILE EMPFILER
...
PCT-OF-SALARY W 4 N 2
BONUS-AMT W 4 N 0
JOB INPUT EMPFILER NAME PROJECTION
BONUS-AMT = 2000
PCT-OF-SALARY ROUNDED = (BONUS-AMT / SALARY) * 100
PRINT RPT1
REPORT RPT1
SEQUENCE DEPT L-NAME
CONTROL DEPT
TITLE 'IMPACT OF PROJECTED $2000 BONUS'
LINE DEPT F-NAME L-NAME SALARY BONUS-AMT PCT-OF-SALARY
BEFORE-BREAK. PROC
PCT-OF-SALARY ROUNDED = (BONUS-AMT / SALARY) * 100
END-PROC
The example below had control breaks on only one field (DEPT)
and at the end (FINAL). One way to describe this is to say
that there are two levels of breaks.
56 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT PROCs C2
FILE EMPFILER
F-NAME 10 8 A
...
PCT-OF-SALARY W 4 N 2
BONUS-AMT W 4 N 0
JOB INPUT EMPFILER NAME PROJECTION
BONUS-AMT = 2000
PCT-OF-SALARY ROUNDED = (BONUS-AMT / SALARY) * 100
PRINT RPT1
REPORT RPT1
SEQUENCE DEPT L-NAME
CONTROL DEPT
TITLE 'IMPACT OF PROJECTED $2000 BONUS'
LINE DEPT F-NAME L-NAME SALARY BONUS-AMT PCT-OF-SALARY
BEFORE-BREAK. PROC
PCT-OF-SALARY ROUNDED = (BONUS-AMT / SALARY) * 100
END-PROC
FILE EMPFILER
F-NAME 10 8 A
...
PCT-OF-SALARY W 4 N 2
BONUS-AMT W 4 N 0
JOB INPUT EMPFILER NAME PROJECTION
BONUS-AMT = 2000
PCT-OF-SALARY ROUNDED = (BONUS-AMT / SALARY) * 100
PRINT RPT1
REPORT RPT1
SEQUENCE DEPT L-NAME
CONTROL DEPT
TITLE 'IMPACT OF PROJECTED $2000 BONUS'
LINE DEPT F-NAME L-NAME SALARY BONUS-AMT PCT-OF-SALARY
BEFORE-BREAK. PROC
PCT-OF-SALARY ROUNDED = (BONUS-AMT / SALARY) * 100
END-PROC
Start with Level = 1 for the lowest level (most minor) break
and go up to the number of CONTROL fields (N). Final totals
have a value of N + 1.
DPEC, Inc. 57
C2 CUSTOMIZING THE REPORT--Using REPORT PROCs
...
REPORT RPT1
SEQUENCE DEPT L-NAME
CONTROL DEPT
TITLE 'IMPACT OF PROJECTED $2000 BONUS'
LINE DEPT F-NAME L-NAME SALARY BONUS-AMT PCT-OF-SALARY
BEFORE-BREAK. PROC
PCT-OF-SALARY ROUNDED = (BONUS-AMT / SALARY) * 100
IF LEVEL = 1
logic statements
END-IF
END-PROC
58 DPEC, Inc.
CUSTOMIZING THE REPORT--Using REPORT PROCs C2
NEW
TOTAL VACATION VACATION
DEPARTMENT LAST NAME FIRST NAME VACATION USED REMAINING
FIN Sherrie Mathers 16 06 10
Mary Snyder 16 06 10
FIN 32 12 20
DPEC, Inc. 59
D1 ENHANCING THE PROGRAM--Statements and Macros
COPY file-name
You can use the PERFORM statement or the START and FINISH
parameters of the JOB statement to invoke a user
procedure.
PERFORM proc-name
60 DPEC, Inc.
ENHANCING THE PROGRAM--Statements and Macros D1
Code the procedure the same way you do any other user
procedure, but be sure to execute a SELECT statement for
records you want to go to the output file.
GOTO label³JOB
DPEC, Inc. 61
D1 ENHANCING THE PROGRAM--Statements and Macros
%macro-name <macro-parameters>
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
62 DPEC, Inc.
ENHANCING THE PROGRAM--Statements and Macros D1
• virtual files
• COPY statement
• CALL statement
• MOVE and MOVE LIKE statements
• user procedures
• SORT activity
• GOTO, DO WHILE and DO UNTIL statements
• macros
DPEC, Inc. 63
D1 ENHANCING THE PROGRAM--Statements and Macros
The program first sorts EMPFILER and puts the output of the
sort into SALSORT. Then SALSORT becomes the input file
in the JOB activity.
FILE EMPFILER
SSNUM 1 9 N
F-NAME 10 8 A
L-NAME 18 10 A
DEPT 28 5 A
SALARY 62 5 N 0
FILE SALSORT F(80) VIRTUAL
COPY EMPFILER
SORT EMPFILER SALSORT +
USING (DEPT SALARY D)
JOB INPUT SALSORT NAME SALARY
PRINT RPT1-SALARY
PRINT RPT2-SALARY
...
The program above also shows the use of another statement you
can use in the Library section -- COPY.
64 DPEC, Inc.
ENHANCING THE PROGRAM--Statements and Macros D1
FILE EMPFILER
SSNUM 1 9 N
F-NAME 10 8 A
L-NAME 18 10 A
DEPT 28 5 A
SALARY 62 5 N 0
FILE TRANS
COPY EMPFILER
JOB INPUT TRANS NAME SALARY
IF TRANS:DEPT = 'SYS'
... logic statements ...
END-IF
...
DPEC, Inc. 65
D1 ENHANCING THE PROGRAM--Statements and Macros
FILE EMPFILER
F-NAME 10 8 A
L-NAME 18 10 A
DEPT 28 5 A
FILE DEPTLST
COPY EMPFILER
JOB INPUT EMPFILER
MOVE LIKE EMPFILER TO DEPTLST
...
In this case
DEPTLST:F-NAME = EMPFILER:F-NAME
DEPTLST:L-NAME = EMPFILER:L-NAME
DEPTLST:DEPT = EMPFILER:DEPT
Code the PROC at the end of the activity where you will
invoke it, just as you coded report PROCs at the end of
a REPORT activity.
66 DPEC, Inc.
ENHANCING THE PROGRAM--Statements and Macros D1
JOB INPUT EMPFILER NAME COURSE-EXAMPLE º JOB INPUT EMPFILER NAME PROC-EXAMPLE
IF PAY-GRADE > 3 º IF PAY-GRADE > 3
NEW-VAC = TOTAL-VAC + 2 º PERFORM VAC-A
ELSE º ELSE
NEW-VAC = TOTAL-VAC + 1 º PERFORM VAC-B
END-IF º END-IF <ÄÄÄÄÄÄÄÄÄÄÄ¿
VAC-REMAIN = NEW-VAC - USED-VAC º VAC-REMAIN = NEW-VAC - USED-VAC ³
PRINT REPT1 º PRINT REPT1 ³
º VAC-A. PROC ³
º NEW-VAC = TOTAL-VAC + 2 ³
º END-PROC ³
º VAC-B. PROC ³
º NEW-VAC = TOTAL-VAC + 1 ³
º END-PROC ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
DPEC, Inc. 67
D1 ENHANCING THE PROGRAM--Statements and Macros
Code the procedure the same way you do any other user
procedure, but be sure to execute a SELECT statement for
records you want to go to the output file.
SEL-DEPT. PROC
IF DEPT = 'SYS' 'FIN'
SELECT
END-IF
END-PROC
68 DPEC, Inc.
ENHANCING THE PROGRAM--Statements and Macros D1
DPEC, Inc. 69
D1 ENHANCING THE PROGRAM--Statements and Macros
70 DPEC, Inc.
ENHANCING THE PROGRAM--Statements and Macros D1
Example: MACRO
FILE INVENTRY
PART-NUM 1 6 N
PART-NAME 7 20 A
INSTOCK 27 5 N 2
PRICE 32 6 N 2
MEND
DPEC, Inc. 71
D1 ENHANCING THE PROGRAM--Statements and Macros
Syntax: MACRO n pos1 pos2 ... key1 value1 key2 value2 ...
Example: MACRO 1 RAISE-PCT LGTH-OF-SVC 1
MACRO SUFX
NAME&SUFX 1 25 A HEADING 'EMPLOYEE NAME'
ADDRESS&SUFX 26 25 A
CITY&SUFX 51 15 A
STATE&SUFX 66 10 A
BIRTH-DATE&SUFX 76 6 N MASK '99/99/99'
SOC-SEC-NUM&SUFX 82 9 N MASK '999-99-9999'
SALARY&SUFX 91 9 N 2 MASK '$,$$$,$$9.99'
LGTH-OF-SVC&SUFX 100 3 N 1 HEADING ('YEARS' 'SERVICE')
72 DPEC, Inc.
ENHANCING THE PROGRAM--Statements and Macros D1
MACRO NEW
&NEW.NAME
&NEW.ADDRESS
FILE MSTRIN
%EMPEZT -01
FILE MSTROUT
%EMPEZT -02
FILE MSTRIN
NAME-01 1 25 A HEADING 'EMPLOYEE NAME'
ADDRESS-01 26 25 A
CITY-01 51 15 A
STATE-01 66 10 A
BIRTH-DATE-01 76 6 N MASK '99/99/99'
SOC-SEC-NUM-01 82 9 N MASK '999-99-9999'
SALARY-01 91 9 N 2 MASK '$,$$$,$$9.99'
LGTH-OF-SVC-01 100 3 N 1 HEADING ('YEARS' 'SERVICE')
FILE MSTROUT
NAME-02 1 25 A HEADING 'EMPLOYEE NAME'
ADDRESS-02 26 25 A
CITY-02 51 15 A
STATE-02 66 10 A
BIRTH-DATE-02 76 6 N MASK '99/99/99'
SOC-SEC-NUM-02 82 9 N MASK '999-99-9999'
SALARY-02 91 9 N 2 MASK '$,$$$,$$9.99'
LGTH-OF-SVC-02 100 3 N 1 HEADING ('YEARS' 'SERVICE')
DPEC, Inc. 73
D1 ENHANCING THE PROGRAM--Statements and Macros
EMP-NUM 1 5 A
L-NAME 6 10 A
F-NAME 16 10 A
ADDR-1 26 15 A
ADDR-2 41 15 A
CITY 56 10 A
STATE 66 2 A
ZIP 68 5 A
FILLER-A 73 7 A
MACRO PREFIX
&PREFIX.EMP-NUM 1 5 A
&PREFIX.L-NAME 6 10 A
&PREFIX.F-NAME 16 10 A
&PREFIX.ADDR-1 26 15 A
&PREFIX.ADDR-2 41 15 A
&PREFIX.CITY 56 10 A
&PREFIX.STATE 66 2 A
&PREFIX.ZIP 68 5 A
&PREFIX.FILLER-A 73 7 A
FILE OLDMSTR VS
%EMPLIB MST-
FILE TRANS
%EMPLIB TRN-
74 DPEC, Inc.
ENHANCING THE PROGRAM--Statements and Macros D1
DPEC, Inc. 75
D2 ENHANCING THE PROGRAM--File Processing
76 DPEC, Inc.
ENHANCING THE PROGRAM--File Processing D2
12. You can check for duplicate records with the following
syntax:
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
DPEC, Inc. 77
D2 ENHANCING THE PROGRAM--File Processing
• sequential
• VSAM
• IMS/DLI
• IDMS
• SQL
78 DPEC, Inc.
ENHANCING THE PROGRAM--File Processing D2
FILE INFILE
CUST-NAME 1 35 A
CUST-NO 36 7 N 0
PRICE-CODE 43 1 A
INF-ITEM 44 9 N 0
ITEM-NAME 54 40 A
OUT-PRICE W 6 N 2
FILE PRICE-FILE-1 VS
PF1-ITEM 1 9 N 0
PF1-PRICE 10 6 N 2
FILE PRICE-FILE-2 VS
PF2-ITEM 1 9 N 0
PF2-PRICE 10 6 N 2
DPEC, Inc. 79
D2 ENHANCING THE PROGRAM--File Processing
80 DPEC, Inc.
ENHANCING THE PROGRAM--File Processing D2
You must also test for end-of-file (EOF) and code the STOP
statement, otherwise your program will execute forever.
STOP ends the current activity and goes on to the next,
if there are any.
DPEC, Inc. 81
D2 ENHANCING THE PROGRAM--File Processing
FILE NEW-VAC
F-NAME 1 8 A
L-NAME 9 10 A
DEPT 19 5 A
NEW-VAC 24 2 N 0
USED-VAC 26 2 N 0
VAC-REMAIN 28 2 N 0
82 DPEC, Inc.
ENHANCING THE PROGRAM--File Processing D2
DPEC, Inc. 83
D2 ENHANCING THE PROGRAM--File Processing
84 DPEC, Inc.
ENHANCING THE PROGRAM--File Processing D2
FILE EMPIN
EMP-REC-IN 1 80 A
EMP-L-NAME 1 20 A HEADING 'LAST NAME'
EMP-F-NAME 21 10 A HEADING 'FIRST NAME'
FILE EMPVSAM VS (F UPDATE)
EMPVSAM-KEY 1 20 A
EMPVSAM-F-NAME 21 10 A
REVIEW-DATE 31 4 N
REV-MONTH 31 2 N
REV-YEAR 33 2 N
WORK-DATE W 4 N HEADING ('PRIOR' 'REVIEW' 'DATE') +
MASK (BWZ 'ZZ/ZZ')
WS-MONTH W 2 N VALUE 06
WS-YEAR W 2 N VALUE 97
ABEND-CODE W 2 B 0
DPEC, Inc. 85
D2 ENHANCING THE PROGRAM--File Processing
86 DPEC, Inc.
ENHANCING THE PROGRAM--File Processing D2
The listings below show you the contents of the EMPVSAM file
before and after the update process. Note that two new
records are added and all REVIEW-DATEs are 0697, which is
last month's date.
PRIOR
REVIEW
LAST NAME FIRST NAME DATE
DPEC, Inc. 87
D2 ENHANCING THE PROGRAM--File Processing
88 DPEC, Inc.
ENHANCING THE PROGRAM--File Processing D2
FILE OLDMSTR VS
MST-EMP-NUM 1 5 A ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
MST-L-NAME 6 10 A ³ The Library section defines ³
MST-F-NAME 16 10 A ³ a current master file (OLDMSTR), ³
MST-ADDR-1 26 15 A ³ a transaction file (TRANS) and ³
MST-ADDR-2 41 15 A ³ a new master file (NEWMSTR). ³
MST-CITY 56 10 A ³ ³
MST-STATE 66 2 A ³ The information in the ³
MST-ZIP 68 5 A ³ transaction file is used to ³
MST-FILLER-A 73 7 A ³ update general employee data. ³
FILE TRANS ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
TRN-EMP-NUM 1 5 A
TRN-L-NAME 6 10 A
TRN-F-NAME 16 10 A
TRN-ADDR-1 26 15 A
TRN-ADDR-2 41 15 A
TRN-CITY 56 10 A
TRN-STATE 66 2 A
TRN-ZIP 68 5 A
TRN-FILLER-A 73 7 A
FILE NEWMSTR FB(0,0)
DPEC, Inc. 89
D2 ENHANCING THE PROGRAM--File Processing
90 DPEC, Inc.
ENHANCING THE PROGRAM--File Processing D2
FILE OLDMSTR
MST-RECORD 1 80 A ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
MST-EMP-NUM 1 5 A ³ Once again, there are three ³
MST-L-NAME 6 10 A ³ files defined. ³
MST-F-NAME 16 10 A ³ ³
MST-ADDR-1 26 15 A ³ TRANS can contain one or more ³
MST-ADDR-2 41 15 A ³ records with the same employee ³
MST-CITY 56 10 A ³ number. ³
MST-STATE 66 2 A ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
MST-ZIP 68 5 A
MST-OT-HRS 73 8 N 0
FILE TRANS
TRN-EMP-NUM 1 5 A
TRN-OT-HRS 6 8 N 0
FILE NEWMSTR FB(0,0)
NEW-RECORD 1 80 A
DPEC, Inc. 91