COMPREHENSIVE DATA
HANDLING SYSTEM (CDHS),
EMISSIONS INVENTORY
SUBSYSTEM PROGRAM
DOCUMENTATION
U.S. ENVIRONMENTAL PROTECTION AGENCY
Office of Air and Water Programs
Office of Air Quality Planning and Standards
Research Triangle Park, North Carolina 27711
-------
APTD-1551
COMPREHENSIVE DATA
HANDLING SYSTEM (CDHS),
EMISSIONS INVENTORY
SUBSYSTEM PROGRAM
DOCUMENTATION
by
International Business Machines Corporation
Federal Systems Division
18100 Frederick Pike
Gaithersburg, Maryland 20760
Contract No. 68-02-0638
EPA Project Officer: Lloyd Hedgepeth
Prepared for
ENVIRONMENTAL PROTECTION AGENCY
Office of Air and Water Programs
Office of Air Quality Planning and Standards
Research Triangle Park, North Carolina 27711
July 1973
-------
The APTD (Air Pollution Technical Data) series of reports is issued by the
Office of Air Quality Planning and Standards, Office of Air and Water Pro-
grams, Environmental Protection Agency, to report technical data of interest
to a limited number of readers. Copies of APTD reports are available free of
charge to Federal employees, current contractors and grantees, and non-
profit organizations - as supplies permit - from the Air Pollution Technical
Information Center, Environmental Protection Agency, Research Triangle
Park, North Carolina 27711 or may be obtained, for a nominal cost, from the
National Technical Information Service, 5285 Port Royal Road, Springfield,
Virginia 22151.
This report was furnished to the Environmental Protection Agency by
International Business Machines Corporation, Federal Systems Division,
Gaithersburg, Maryland, in fulfillment of Contract No. 68-02-0638. The
contents of this report are reproduced herein as received from the con-
tractor. The opinions, findings, and conclusions expressed are those
of the author and not necessarily those of the Environmental Protection
Agency.
Publication No. APTD-1551
11
-------
TABLE OF CONTENTS
1.0 Introduction 1
2.0 Emissions Inventory Subsystem Overview 3
2.1 Organization 4
2.2 Communication and Data Formats 9
2.2.1 Master File 9
2.2.2 Transaction Records 17
3.0 File Maintenance and Retrieval 48
3.1 File Maintenance 49
3.1.1 Organization 50
3.1.2 Communication and Data Formats 53
3.1.3 Routines 56
3.2 Retrieval 64
3.2.1 Retrieval Language Processor 65
3.2.1.1 Organization 66
3.2.1.2 Communication and Data Formats 68
3.2.1.3 Routines 70
3.2.2 Retriever 76
3.2.2.1 Organization 77
3.2.2.2 Communication and Data Formats 79
3.2.2.3 Routines 81
4.0 Output Programs 85
4.1 File List Output 86
4,1,1 Organization 87
4.1.2 Communication and Data Formats 89
4.1.3 Routines 90
4,2 Summary Report Output 91
4.2.1 Organization 92
4.2.2 Communication and Data Formats 95
4.2.3 Routines 97
4.3 NEDS Point Source Output 98
4.3.1 Organization 99
4.3.2 Communication and Data Formats 102
4.3.3 Routines 103
iii
-------
4.4 NEDS Area Source Output 104
4.4.1 Organization 105
4.4.2 Communication and Data Formats 107
4.4.3 Routines 109
4.5 NEDS Area Source Report 112
4.5.1 Organization 113
4.5.2 Communication and Data Formats 115
4.5.3 Routines 116
5.0 Conversion Programs 118
5.1 NEDS Point Source to E1S 119
5.1.1 Organization 120
5.1.2 Communication and Data Formats 123
5.1.3 Routines 124
5.2 NEDS Area Source to EIS .,, 125
5.2.1 Organization 132
5.2.2 Communication and Data Formats 135
5.2.3 Routines 139
6.0 Emission Factors Programs 140
6.1 Emission Factors Table Generator 141
6.1.1 Organization 142
6.1.2 Communication and Data Formats 144
6.1.3 Routines 145
6.2 Emission Factors Transaction Generator 150
6.2.1 Organization 151
6.2.2 Communication and Data Formats 153
6.2.3 Routines 155
6.3 Emission Factors Insert 162
6.3.1 Organization 163
6.3.2 Communication and Data Formats 165
6.3.3 Routines 166
iv
-------
FIGURES
2.1-1 EIS System Flow 6
2.2.1-1 EIS Master Record Structure 10
2.2.1-2 EIS Master Record Format 11
2.2.2-1 EIS Transaction Cards . 18
3.1-1 File Maintenance Organization 52
3.1-2 File Maintenance Routine ADD-ROOT 59
3.1-3 File Maintenance Routine ADD-POINT 60
3.1-4 File Maintenance Routine CALCULATIONS 61
3.1-5 File Maintenance Routine CHANGES 62
3.1-6 File Maintenance Routine DELETES 63
3.2.1-1 Retrieval Language Processor Organization 67
3.2.1-2 Retrieval Language Processor Routine PROCESS-CARD 73
3.2.1-3 Retrieval Language Processor Routine IF-EDIT 74
3.2.1-4 Retrieval Language Processor Routine SORT-EDIT 75
3.2.2-1 Retriever Organization 78
3.2.2-2 Retriever Routine RETRIEVAL 84
4.1-1 File List Organization 88
4.2-1 Summary Report Organization 94
4.3-1 NEDS Point Source Output Organization 101
4.4-1 NEDS Area Source Output Organization 106
4.4-2 NEDS Area Source Output Routine PROCESS-2-REC Ill
4.5-1 NEDS Area Source Report Organization 117
5.1-1 NEDS Point Source to EIS Organization 122
5.2-1 NEDS Area Source to EIS Organization 134
6.1-1 Emission Factors Table Generator Organization 143
6.1-2 Emission Factors Table Generator Routine
READ-EMISSION-FACTORS 148
6.1-3 Emission Factors Table Generator Routine
BUILD-EMISSION-FACTORS-TABLE 149
6.2-1 Emission Factors Transaction Generator Organization 152
-------
6.2-2 Emission Factors Transaction Generator Routine
GET-FILE-LOGICAL-RECORD 157
6.2-3 Emission Factors Transaction Generator Routine
TYPE-2-RECORD-PROCESSING 160
6.2-4 Emission Factors Transaction Generator Routine
OUTPUT-TRANSACTIONS 161
6.3-1 Emission Factors Insert Organization 164
6.3-2 Emission Factors Insert Routine INPUT-TRANSACTION 169
6.3-3 Emission Factors Insert Routine WRITE-TRANSACTION 170
vi
-------
TABLES
5.2-1 Area Source Categories 126
5.2-2 E1S Area Source Records 128
vii
-------
1.0 INTRODUCTION
This document is intended to provide, a jiore detailed knowledge of the pro-
gramming logic of the Emission Inventory Subsystem (EIS) of the Comprehensive
Data Handling System (CDHS). With, this goal in mind the document is organized
in the following manner:
o Section 2.0 - Similar to Section 2.0 of the EIS users guide. Contains
an overview of the EIS system, a. brief functional description of each
component program comprising the system and a detailed discussion of the
system master file and the general transaction cards required to build
the master file.
o Section 3.0 - through 6.0 - Contain descriptions of the program logic,
organization, data formats and subroutines of each program in the EIS
system. The sections are organized as follows:
Section 3.0 - File Maintenance and Retrieval
Section 4.0 - Output programs
Section 5.0 - Data Conversion programs
Section 6.0 - Emission Factors Table programs
In general, each program in the EIS system is organized in the top-down
manner in which higher level programming modules execute one or more lower
level modules to perform specific functional tasks. These lower level modules
may in turn execute still lower level modules to perform other specific tasks.
Each module has one entry and one exit only. Thus, each program basically
consists of a hierarchical structure of programming modules.
-------
In addition, each, program in the EIS system is programmed using structured
programming techniques. These techniques include using only three basic types
programming construction blocks GIF/ELSE, DO and PROCESS) and preclude the use
of explicit branches. These techniques, along with the top-down organization,
make for programs which are extremely readable with straightforward logic and
no branching to confuse the program flow.
Because of the advanced manner in which the EIS system was developed, it be-
came obvious that the standard method of program documentation, instruction
by instruction and field by field, would not provide that level of information
about the programs that we deemed necessary for valid understanding. Therefore,
we have documented the EIS programs by first describing their hierarchical
top-down structure and then giving detailed descriptions of each main module
within the structure. Thus, the serious EIS user can find his way directly
into virtually any subroutine of a given program where he will then find the
programming details in the structured code.
In addition, we have provided descriptions of all the system inline and control
type data areas and hierarchical flow charts of each program as well as all
the crucial high level modules within each program.
-------
2.0 EMISSIONS INVENTORY SUBSYSTEM (EIS) OVERVIEW
When dealing with atmospheric pollution, it is necessary to amass, catalog,
sort, evaluate, and perform calculations upon large volumes of data. The
Emissions Inventory Subsystem of the Comprehensive Data Handling System
provides a systematic method for collecting this data in a data base that
will provide a central source fqr the information needed to help control
air pollution. If the system is to be helpful it must maintain the data
base, keeping the information current, and provide a means for access to
the information, presenting it in a usable form.
The Emissions Inventory Subsystem provides the ability to create and
maintain, and to retrieve and print data from the data base. The creation
and maintenance is accomplished with the File Maintenance program. This
program allows the user to keep his data base information current and useful.
Access to the data base information is provided by the Retrieval program
set. These programs provide the means of extracting desired information
from the data base. The output print programs are then used to convert
the extracted information to a form readable by the user. These three
functions form the basic system.
In addition to the basic system, several preprocessor and postprocessor
programs are provided which perform functions necessary to make this
system compatible with existing systems. Other programs provide services
which help make the maintenance process automatic. All of the system
programs are described in detail in the following sections.
-------
2.1 ORGANIZATION
The Emission Inventory Subsystem of CDHS is organized around two main
programs, File Maintenance and Retrieval. There are tan other programs
in the system that perform service functions. The interface for the pro-
grams that feed the File Maintenance program is the EIS transaction card.
The Master File serves as the interface for the rest of the programs.
The EIS components are:
o File Maintenance - This program is used to create and maintain
the Master File.
o Retrieval Language Processor - This program generates the retrieval
program.
o Retrieval - This program is used to extract information from the
Master File.
o File List - This program provides a detailed listing of the Master
File.
o Summary Report Output - This program will produce a listing of
emission totals for selected control breaks.
o NEDS Point Source Output - This program converts the Master File to
NEDS Point Source card formats.
o NEDS Area Source Output - This program converts the Master File area
records to NEDS Area Source card formats.
o NEDS Area Source Report - This program prints a formatted listing
of NEDS Area Source cards.
-------
o NEDS Point Source Conversion - This program converts NEDS Point
Source cards to EIS transaction cards.
o NEDS Area Source Conversion - This program converts NEDS Area
Source cards to EIS transaction cards.
o Emission Factor Table Generator - This program is used to generate
the emission factors table.
o Emission Factor Insertion - This program inserts the emission
factors into the (23 card) EIS transactions.
o Emission Factor Transaction Generator - This program generates
transaction cards to update emission factors in the Master File.
Figure 2.1-1 illustrates the flow of the EIS system.
-------
Keypunch EIS
Input Load
Sheet
1
r
TEIS
1 Transactions
File
Maintenance
Program
Master
File
(Master
File
EIS System Flow
Figure 2.1-1
-------
[Retrieval
Control Cards
NEDS Area
Source Out
Program
^
r
File List I
Program |
i
NEDS AREA
Source Cards
Detail List
of Master
File
EIS System Flow
Figure 2.1-1 (cont.)
-------
Master
File
Update
Control
flarHn
Emission
Factor Update
Program
EIS
Transactions
1
File
Maintenance
Program
Master
File
EIS System Flow
Figure 2.1-1 (cont.)
-------
2.2 COMMUNICATION AND DATA FORMATS
2.2.1 MASTER FILE
The EIS master file is a three level hierarchical file with three different
segment types. The highest, or Blaster record level segment is called the
PLANT
POINT SOURCE
MACHINE PROCESS
plant segment. There is no limit to the number of master records allowed
on an EIS master file. Subordinate to each master record (plant segment)
may be up to 99 point source segments, each describing a different source
of pollution (air stack) within the plant described by the plant segment.
And subordinate to each point source segment are 1 to 6 machine process
segments, each describing a different polluting process or machine feeding
into the given point source. Figure 2.2.1-1 illustrates the hierarchical
structure of an EIS master record.
The format of each segment type on the master file is illustrated in
Figure 2.2.1-2. Each field Illustrated relates directly to a field on
one of the input transaction cards.
-------
PLANT SEGMENT
Point Source 1
Machine Process 1
Machine Process 2
Machine Process 6
Point Source 2
Machine Process 1
Machine Process 2
Machine Process 6
Point Source 3
Type 0 Segment
Type 1 Segment
Type 2 Segment
Type 1 Segment
Type 2 Segment
Type 1 Segment
o unlimited plant segments (type 0)
o up to 99 point source
segments (type 1 subordinate to
each plant segment.
o up to 6 machine process segments
(type 2) subordinate to each point
source
EIS MASTER RECORD STRUCTURE
Figure 2.2.1-1
10
-------
Fixed (Plant) Segment (Segment 0)
Position
1 -
3 -
•j _
10 -
14 -
19 -
22 -
25 -
27 -
39 -
43 -
46 -
61 -
71 -
81 -
129 -
133 -
139 -
2
6
9
13
18
21
24
26
38
42
44
45
60
70
80
128
132
138
186
Format
XX
xxxx
XXX
xxxx
xxxxx
XXX
XXX
XX
x-x
xxxx
XX
A
A-A
x-x
x-x
x-x
xxxx
XXXXX. X
x-x
Symbol
Numeric
Numeric
Numeric
Numeric
* Numeric
* Numeric
* Alphanumeric
* Alphanumeric
* Alphanumeric
Numeric
Numeric
Alphabetic
Alphabetic
* Alphanumeric
* Alphanumeric
Alphanumeric
* Numeric
* Numeric
* Alphanumeric
Description
State Code
County Code
AQCR Number
Plant Id
Date of Segment
Segment Id
User Control Region
Local Control
User Plant Id
City
UTM Zone
Ownership
Contact
Telephone
Principal Product
Name and Address
Number of Employees
Property Area
Mailing Address
EIS Master Record Format
Figure 2.2.1-2
11
-------
Point Source Segment (Segment 1)
Position
1 -
3 -
7 -
10 -
14 -
20 -
22 -
24 -
27 -
31 -
33 -
37 -
42 -
48 -
55 -
63 -
68 -
73 -
76 -
80 -
83 -
2
6
9
13
18
19
21
23
26
30
32
36
41
47
54
62
67
72
75
79
82
86
Format
XX
xxxx
xxx
xxxx
xxxxx
X
XX
XX
xxx
xxxx
XX
xxx.x
xxxx.x
x-x
x-x
x-x
xxxxx
xxxxx
XX. X
xxxx
XX. X
xxxx
Symbol
Numeric
Numeric
Numeric
Numeric
* Numeric
* Numeric
Numeric
Numeric
* Alphanumeric
Numeric
Numeric
Numeric
Numeric
* Numeric
* Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Description
State Code
County Code
AQCR Number
Plant Id
Date of Segment
Segment Id
Segment Id Sequence
Point Id (NEDS)
Point Id (User)
SIC Code
IPP Code
UTM Horizontal Coordinates
UTM Vertical Coordinates
Latitude
Longitude
Annual Throughput
Normal Operating
Boiler Design Capacity
Space Heat
Stack Height
Stack Diameter
Stack Temperature
EIS Master Record Format
Figure 2.2.1-2 (Continued)
12
-------
Position
87
94
99
103
108
112
119
131
133
137
145
148
151
154
161
168
- 93
- 98
- 102
- 106
107
- Ill
- 117
118
- 130
- 132
- 137
- 144
- 147
- 150
- 153
- 160
- 167
- 174
175
176
177
Format
x-x
xxxxx
xxxx
xxxx
X
xxxx
x-x
X
x-x
XX
xxxxx
XXXXX. XX
XXX
XXX
XX. X
x-x
x-x
x-x
X
X
X
Symbol
Numeric
* Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
* Numeric
* Numeric
Numeric
Numeric
Numeric
Numeric
* Numeric
Numeric
* Numeric
Numeric
* Numeric
Description
Exhaust Flow Rate
Velocity
Plume-Height
Points with Common
Stack
Compliance Status
Compliance Schedule
Compliance Update
ECAP
Control Regulations
2
Number of Pollutants
Pollutant Id
Control Equipment Cost
Primary Control Equipment
Secondary Control Equipment
Estimated Control Efficiency
Emissions Estimate
Emissions Measured
Allowable Emissions
Emission Units
Estimation Method
Test Method
Note: Positions 133 - 177 may be repeated up to 15 times to allow
for 16 pollutants from a single source. The Number of
Pollutants field determines the number of repetitions.
EIS Master Record Format
Figure 2.2.1-2 (Continued)
13
-------
Machine Proceas Segment (Segment 2)
Position
1 -
3 -
7 -
10 -
14 -
20 -
22 -
24 -
32 -
38 -
45 -
52 -
55 -
58 -
65 -
91 -
93 -
2
6
9
13
18
19
21
23
31
36
37
44
51
54
57
62
63
64
89
90
92
97
Format
XX
xxxx
XXX
xxxx
xxxxx
X
XX
XX
x-x
xxxxx
X
x-x
XXXX. XXX
x.xx
XX. X
xxxxx
X
A
x-x
X
XX
xxxxx
Symbol
Numeric
Numeric
Numeric
Numeric
* Numeric
* Numeric
Numeric
* Numeric
Numeric
* Numeric
* Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Alphabetic
Alphanumeric
* Alphabetic
* Numeric
* Numeric
Description
State Code
County Code
AQCR Number
Plant Id
Date of Segment
Segment Id
Segment 1 Id
Segment 2 Id
SCC Code
BEC Code
Fuel Units
Fuel, Process, Solid Waste
Maximum Design
Sulfur Content
Ash Content
Heat Content
Confidentiality of Data
Source Code
Source Description
Emission Factor Source
2
Number of Emission Factors
Pollutant Id
EIS Master Record Format
Figure 2.2.1-2 (Continued)
14
-------
Position Format^ Symbol Description
98 - 106 xxxxxx.xxx * Numeric Emission Factor
107 A * Alphabetic Ash/Sulfur Code
108 x * Numeric Emission Factor Units
Note: Positions 93-108 may be repeated up to 15 times to allow
for 16 emission factors per process. The number of
Emission Factors field determines the number of repeti-
tions .
* Not part of NEDS point source file.
1 Only year portion of date obtained from NEDS point source
file. Remainder of field filled with zeroes.
2 Determined by File Maintenance program.
EIS Master Record Format
Figure 2.2.1-2 (Continued)
15
-------
Application EMISSION INVENTORY SYSTEM
PROPORTIONAL RECORD LAYOUT FORM
Type of Records MASTFIJ FII F By IBM- ESC_
Date
Page _L of _L
RECORD NAME AND REMARKS
i CTYPn (PLANT) SEGMENT 0
100
POINT SOURCE SEGMENT 1
100
MACHINE PROCESS SEGMENT 2
100
f
$
1 ' 1
COUNTS
CODE
AQCF p
NAME AND AD
5
t
E&
COUNTS
CODE
• • 1
f '
*13
£8«
g
•fcTATE
COUNTV
CODE
. . 1
1
EMISSION
FACTOR
|0
AQCM
i i
i , if
AOCF
t
J •
< i
LANT
ID
DATE
RESS
' ' ' ' 1
ID
O
h
I
s
•
DATE
i
1 <
f *«P".T,
O
o
w
I • '
ID
,
10 14
,1
I
a
t-i
z o
o,-,
w
E E
U
r
- -i
;|i
)
'I
a
— a
s
0.
1
LANT to
L,, i,L,,, ,
t:l
£si ,
\9
?"i
1
SIC
CODE
77771" ""'. ,
•
~ i ~
I 1 1 1 1
„ J» ...
, 1 , .
i ?*
i
PROP CRT1
AREA
t
^
!
, 1
1
•r
1
5
*
>
t 3
i
, , i ,
1
'"p
f '
U
_l
, i
v !
jv
!
CONTACT
1 < > i :
i
MAILING
LATITUDE
co-Xou
, F-+T, ,•
I"1" !
r J
1 z
J
l_k
^
FUEbj PRO-
, 7T7, ,
1 . , , , 1
1
1 ' ' ' 1
3? j*|3i r-
—
IS
*t
ADDRESS
LONG
-*"
SSt",
t
* ,1 j.
K(.
J Z
1
TELEPHONE
1
AN»
THRO
. 1 -i.,,
UAL ^
, , T "
~K—
"^MAJ*
..j._l..
k
Z
'3
_J_i_
— ,—
t 1 »
1
ORMAL
fc' i •
'
MEASURED
s
C
CON1JEH1 i
t i i <
i_t_t_i [ i ! -L .1 ,_:_L
1 t 1 1 1
,
• i •
* '
\ .
1
PRINCIPAL,
PRODUCT
i
i
BOILER
:APAt,,i-
NA»
1
IPACI
, , 1 , . , 1
AI_I_6W-
ABUC B
"T
-LO-
7
K J
^.iL^
STACK |
HC.OH,
M
' i
h- *
• H
u h t i
(E AND Al
| STACK EXAU
TEMP. FLOW
I
,,!..,.
__
-,|:
~J -4
1 n
i
III
J
B
T
,. . , t. . .,
•DRESS
• T /ELOCIT1 ^ Q
",Tr , . .
o
o
a.
o
ft
-------
2.2.2 TRANSACTION RECORDS
The master file is constructed from the information contained on the EIS
input transaction cards. There are three classes (or types) of cards: a
zero card, a one card and a two card. The zero card contains general
identification for the plant or source; the one card contains information
relative to specific emission points within a source; the two card contains
fuel and process information. The following paragraphs explain the contents
of each field on the transaction cards. Figure 2.2.2-1 illustrates the format
of the cards. The same formats are used to enter both point source data and
area source data. However, the meanings of some fields will be changed when
area source data is to be entered.
17
-------
Card Columns 1-18 of all Cards (Key)
CC
1-2
3-6
7-9
10 - 13
14 - 18
Format
XX
xxxx
XXX
xxxx
xxxxx
Symbol
Numeric Cod*
Numeric Code
Huaeric Coda
Numeric Code
Numeric
Description
State Code
County Code
AQCR Number
Plant Id
Date of Record
Card 01 - Plant Identification
CC
19 -
22 -
24 -
36 -
40 -
43 -
58 -
68 -
78 -
21
23
35
39
41
42
57
67
77
79
80
Format
XXX
XX
x-x
xxxx
XX
A
A-A
x-x
X-X
XX
X
Symbol
Alphanumeric Code
Alphanumeric Code
Alphanumeric Code
Numeric Code
Numeric Code
Alphabetic Code
Alphabetic
Alphanumeric
Alphanumeric
Numeric
Alphabetic Code
Description
Control Region
Local Control
Plant Id
City
UTM ZONE
Ownership
Contact
Telephone
Principal Product
Card Number
Transaction Code
EIS TRANSACTION CARDS
Figure 2.2.2-1
18
-------
Card 02 - Plant Identification
CC
19 -
67 -
71 -
78 -
66
70
76
77
79
80
Format
x-x
x-x
xxxxx.x
XX
X
Symbol
Alphanumeric
Numeric
Numeric
Numeric
Alphabetic Code
Description
Name and Address
Number of Employees
Property Area
Not Used
Card Number
Transaction Code
Card 03 - Plant Identification
CC
19 - 66
67 - 77
78 - 79
80
Format
s-x
XX
X
Symbol
Alphanumeric
Numeric
Alphabetic Code
Description
Mailing Address
Not Used
Card Number
Transaction Code
EIS TRANSACTION CARDS
Figure 2.2.2-1 (Cont.)
19
-------
Card 11 - Point Source Parameters
cc
19 -
21 -
23 -
26 -
30 -
32 -
36 -
41 -
47 -
54 -
62 -
67 -
72 -
75 -
78 -
20
22
25
29
31
35
40
46
53
61
66
71
74
77
79
80
Format
XX
XX
XXX
xxxx
XX
XXX. X
xxxx.x
x-x
x-x
x-x
xxxxx
xxxxx
XX. X
XX
X
Symbol
Numeric
Numeric
Alphanumeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Alphabetic C<
Description
Segment ID
Point Id (NEDS)
Point Id (Local)
SIC Code
IPP Code
UTM Horizontal Coordinates
UTM Vertical Coordinates
Latitude
Longitude
% Annual Throughput
Normal Operating
Boiler Design Capacity
Space Heat Z
Not Used
Card Number
Transaction Code
EIS TRANSACTION CARDS
Figure 2.2.2-1 (cont.)
20
-------
Card 12 - Point Source Parameters
cc
19 -
21 -
25 -
28 -
32 -
39 -
44 -
48 -
53 -
57 -
64 -
76 -
78 -
20
24
27
31
38
43
47
51
52
56
62
63
75
77
79
80
Format
XX
xxxx
XX. X
xxxx
x-x
xxxxx
xxxx
xxxx
• X
xxxx
xxxxxx
X
x-x
XX
X
Symbol
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Alphabetic Code
Description
Segment ID
Stack Height
Stack Equivalent Diameter
Stack Temperature
Exhaust Flow Rate
Velocity
Plume Height
Points with Common Stack
Compliance Status
Compliance Schedule
Compliance Update
ECAP
Control Regulations
Not Used
Card Number
Transaction Code
EIS TRANSACTION CARDS
Figure 2.2.2-1 (cont.)
21
-------
Card 13 - Point Source Parameters
cc
19 -
21 -
26 -
33 -
36 -
39 -
42 -
/ A
49 -
56 -
66 -
78 -
20
25
32
35
38
41
48
C C
55
62
63
64
65
77
79
80
Format
XX
xxxxx
xxxxxx.xx
XXX
XXX
XX. X
xxxxxxxx
XJuuuuuut
«X«K«VVTf
X
X
X
XX
X
Symbol
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
^« — • -.
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Alphabetic
Description
Segment ID
Pollutant ID
Control Equipment Cost
Primary Control Equipment
Secondary Control Equipment
Estimated Control Efficiency
Emissions Estimate
Emissions Measured
Allowable Emissions
Emission Units
Estimation Method
Test Method
Not Used
Card Number
Transaction Code
EIS TRANSACTION CARDS
Figure 2.2.2-1 (eont.)
22
-------
Card 21 - Fuel. Process Parameters
cc
19 -
21 -
23 -
31 -
37 -
44 -
51 -
54 -
57 -
62 -
78 -
20
22
30
35
36
43
50
53
56
61
77
79
80
Format
XX
XX
x-x
xxxxx
X
xxxxxxx
XXXXX. XXX
x.xx
XX. X
xxxxx
XX
X
Symbol
Numeric
Numeric
Numeric Code
Numeric Code
Numeric Code
Numeric
Numeric
Numeric
Numeric
Numeric
Numeric
Alphabetic Code
Description
Segment 1 ID
Segment 2 ID
SCC Code
BEC Code
Fuel Units
Fuel, Process, Solid Waste
Maximum Design
Sulfer Content
Ash Content
Heat Content
Not Used
Card Number
Transaction Code
EIS TRANSACTION CARDS
Figure 2.2.2-1 (cont.)
23
-------
Card 22 - Fuel. Process Parameters
cc
19 -
21 -
25 -
51 -
78 -
20
22
23
24
49
50
77
79
80
Format
XX
XX
X
X
x-x
X
XX
X
Symbol
Numeric
Numeric
Numeric
Alphabetic
Alphanumeric
Alphabetic
Numeric
Alphabetic
Code
Description
Segment 1 ID
Segment 2 ID
Confidentiality of data
Source Code
Source Description
Emission Factor Source
Not Used
Card Number
Transaction Code
BIS TRANSACTION CARDS
Figure 2.2.2-1 (cont.)
-------
Card 23 - Fuel, Process Parameters
CC
19 - 20
21 - 22
23 - 27
28 - 36
37
38
39 - 54
55 - 70
71 - 77
78 - 79
80
Format
xx
XX
xxxxxxx.xxx
X
Symbol
Numeric
Numeric
Numeric
Numeric
Alphabetic Code
Numeric Code
Numeric
Alphabetic Code
Description
Segment 1 ID
Segment 2 ID
Pollutant ID Code
Emission Factor
Ash/Sulfur Code
Emission Factor Units
Repeat CC 23 - 38
Repeat CC 23 - 38
Not Used
Card Number
Transaction Code
EIS TRANSACTION CARDS
Figure 2.2.2-1 (cont.)
25
-------
Card Columns 1-18 of all cards;
1. State Code: State identification number as defined by the
SAROAO air quality numbering system.
2. County Code: Codes to be used are listed in the SAROAD Station
Coding Manual for Aeroaetric Sampling Networks, Publication No.
APTD-0907 of the Environmental Protection Agency.
3. AQCR Number: Number for the Air Quality Control Region in
which the Plant is located.
4. Plant ID: This field identifies each source in a county. The
numbering system is sequential, starting with the number one
and continuing until all facilities containing point sources
that are located in a given county are assigned a number.
5. Date of Record: The Julian date for the data recorded on
the card. The format for this field is YYDDD.
26
-------
Card 01
1. Control Region: A user defined field to identify state or
county control areas.
2. Local Control: A user defined field to Identify plants that
are physically in one control region but have control responsi-
bility in another region.
3. Plant ID: A user defined field to be used if the local identi-
fication conventions differ from NEDS.
4. City: The four-digit SAROAD code number corresponding to the
city in which the source is located. There are a few cities
in the United States that are not considered to be inside any
county but are considered independent entities. In such cases,
enter the city code in both the City and County Code fields.
5. UTM Zone: The zone number must be known in order to locate
the point source via the UTM coordinate system; this number is
found on all USGS maps showing UTM coordinates. Although most
states are within a single UTM zone, a few states and counties
are in two UTM zones. For this reason a UTM zone number is
required for each record.
27
-------
6. Ownership: A single alphabetic character ownership code.
The code should be selected from the following list:
Symbol Ownership
P Private
L Local Government
S State Government
F Federal Government
U Utility
7. Contact: The last name of the person responsible for pollution
control activity at the source. If the responsible individual
is not identifiable, then record a descriptive and appropriate
title.
8. Telephone: The area code and telephone number of the person
to be contacted should be entered in this field.
9. Principal Product: A brief description of the principal product
produced by this plant.
10. Card Number: 01
11. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete.
28
-------
o Card 02
1. Name and Address: Provide a descriptive name for the
facility and a usable mailing address. Use common abbre-
viations as much as possible. The address should include a
street number, city and a zip code. The zip code should appear
in the last five positions of the field.
2. Number of Employees: Record the number of persons actually
working at this location.
3. Property Area: The area, to the nearest tenth acre, of the
land occupied by the facility.
4. Card Number: 02
5. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete.
29
-------
o Card 03
1. Mailing Address: The address of the person to contact If it
is different than the establishment name and address.
2. Card Number: 03.
3. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete.
30
-------
Card 11
1. Segment ID: Each point source set (11, 12, and a 13 card)
creates a point source segment in the master file. Each
point source segment under the same facility segment must
have a unique segment ID number. This number must also be
used to reference a particular segment when making a change
or deleting a segment.
2. Point ID (NEDS): This is a sequential number designated
for each pollutant discharge point within the facility.
3. Point ID (Local): This is a field for a user defined point
source identification when the NEDS Point Id is not sufficient
to show local control.
4. SIC code: This Information is necessary to use the source
data for modeling air quality. Enter the appropriate
Standard Industrial Classification code.
5. IPP code: This column should be completed with the standard
process code.
31
-------
6. UTH Horizontal and Vertical Coordinates: The UTM coordinate
system is another means of identifying*the location of the
point source. Coordinates are obtained from USGS maps or their
equivalent with scales less than 1:62,500. All spaces in these
columns must be filled in with numbers and zeros. Accuracy to
0.1 kilometer accuracy is desired.
7. Latitude and Longitude: This is an alternate means of identifying
the location of the point source. Coordinates may be obtained from
USGS maps or their equivalent.
8. % Annual Throughput: The annual production, consumption, throughput,
or other valid number representing the operating of the source should
be proportionally divided into the four 3-month categories listed
below. The wleghted portion of production occurring in each category
is reported as a percentage of total annual throughput. The field is
divided into four equal subfields of two numbers each. The first two
positions are for December through February. The next two are for
March through May. The next two are for June through August. The
last two are for September through November.
9. Normal Operating: The hours per day, days per week, and weeks per
year that the source operates under normal and usual conditions
should be entered here.
32
-------
10. Boiler Design Capacity: Numerical values in this field should
be entered if the boiler burns fuel to heat water or steam,
or if it is normally sold according to the heating capacity
(BTU per hour). Units are in millions of BTU per hour based
on the maximum capacity or design of the boiler.
11. Space Heat %: An estimate of the percent of total fuel used
for space heating at the plant should be entered here. If no
fuel is used for space heating, enter zeros in this field.
12. Card Number: 11
13. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete
33
-------
Card 12
1. Segment ID: Enter the same number as in the Segment ID
of the 11 card.
2. Stack Height: If the exact location of the discharge of
pollutants is well defined there will be a stack or some
other enclosed, constrained, or physically-bounded area where
pollutants are emitted. In such instances, the stack height
is the vertical distance between the point of emission and
ground level. If no stack can be identified or there is a
changing locus of emissions within the facility then complete
only the Plume Height field and leave the rest of the stack
data blank.
3. Stack Equivalent Diameter: The stack diameter is the inside
diameter of a round gas exit at the point of emission; for
non-round exits, it is an equivalent diameter calculated from
the cross-sectional area at point of discharge. Using a
measured or estimated cross-sectional area, the equivalent
diameter (De) is calculated as follows:
De - 1.128
where A is in square feet.
34
-------
4. Stack Temperature: The temperature of the exhaust stream at the
stack exit should be reported in degrees Fahrenheit under normal
operating conditions. If measured temperatures are not available,
an estimate to the nearest 50°F should be made.
5. Exhaust Flow Rate: This number should be specified by recording
the design or maximum exhaust-gas volume unless actual measurements
are available. Units are actual cubic feet per minute and represent
the total volume of exhaust gas released at the operating temperature
of the stack (assume gas pressure is the same as normal atmospheric
pressure).
6. Velocity: This number should be specified by recording the design
or maximum exhaust-gas velocity unless actual measurements are
available. Units are feet per minute.
7. Plume Height: This field is to be filled in if the previous fields
on stack data are all blank. The plume height is a gross estimate
and is used only when the source has no definable stack.
8. Points with Common Stack: Columns 48 and 49 contain the NEDS Point ID
of the first point source discharging through the stack. Columns 50
and 51 contain the NEDS Point ID of the last point source discharging
through the stack. For a complete definition of common stack see EPA
publication APTD-1135, Guide For Compiling A Comprehensive Emission
Inventory, for March 1973.
35
-------
9. Compliance Status: One of the following codes must be selected to
record the present status of the source under existing legal
requirements:
Code
1 Source is in compliance with the most stringent air
pollution control requirements.
2 Source is not in compliance with existing legislation
and no variance has been given.
3 Source is not in compliance with existing legislation
but a variance has been given.
4 Compliance status is unknown.
10. Compliance Schedule: If the compliance status code is 2 or 3,
enter the year and month by which this source must be in
compliance.
11. Compliance Update: The day, month, and year of the most recent
change in compliance status for the source be entered in this
field. Leave the field blank if compliance status has been
reported as unknown (code 4). If the source is in compliance
with existing air pollution control legislation, then record
the record the time that such legislation was enacted.
12. ECAP: Certain point sources are required to submit to
government agencies on Emergency Control Action Program
36
-------
that specifies a detailed plan for immediately reducing
emissions whenever air pollution in an area is considered an
emergency condition. The following list shall be used to
denote whether or not an ECAP has been submitted to an appro-
priate government agency. Leave blank if status is unknown.
0 ECAP is not required
1 ECAP is required but has not been submitted
2 ECAP has been submitted.
13. Control Regulations: This field is used to identify air pollu-
tion control regulations that are in effect and apply to the
source.
14. Card Number: 12
15. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete
37
-------
Card 13
1. Segment ID: Enter the same number as in the Segment Id of the
11 card.
2. Pollutant ID: This field is a fiv« digit code that represents
the pollutants whose emissions are being measured. Source is
SAROAD Parameter Coding Manual. EPA Publication No. APTD-0633.
3. Control Equipment Cost: Enter the annual cost of maintenance
and operation of pollution control equipment.
4. Primary Control Equipment: This field should be completed with
the Control Equipment Identification Code. Only control devices
that reduce the uncontrolled emission normally associated with
the specific source process should be reported.
5. Secondary Control Equipment: If there is an additional control
device installed for this pollutant enter the Control Equipment
Identification Code in this field.
38
-------
6. Estimated Control Efficiency: The overall collection effi-
ciencies in weight percent of all control equipment at the
point source should be entered. Assume that the pollutant
load entering the control equipment is the normal, uncontrolled
quantity for that specific process.
7. Emissions Estimate: The annual, controlled emissions from
the point source, in tons per year, should be entered here.
These calculations should Include the effect of pollutant
removal by installed control equipment.
8. Emissions Measured: The annual, controlled emissions from
the point source, in tons per year, as actually measured by
test equipment should be entered here. These measurements
can be compared against the estimates to check the validity
of the emission factors.
9. Allowable Emissions: Entered here should be the maximum
emissions, in tons per year, that the source is legally
allowed to discharge into the atmosphere.
10. Emission Units: This field is for future expansion of the
system. It will eventually allow the user to specify units for
the emissions in other than NEDS units. It is currently ignored
by the system.
39
-------
11. Estimation Method: The following code list must be used to
specify the method used to ascertain the estimated emissions:
Code Description of Method
0 Not applicable (if emissions are negligible)
1 Stack-test results or other emission
measurement
2 Material balance using engineering knowledge
and expertise of process
3 Emission calculated using emission factors
4 Guess
If code 3 is used the file maintenance program will calculate the
estimated emissions if all the factors are present.
12. Test Method: A user defined code to indicate the method used to
ascertain the measured emissions.
13. Card Number: 13
14. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete.
40
-------
Card 21
1. Segment 1 ID: Enter the same number as in the Segment ID of
the 11 card for the point source to which this segment belongs.
2. Segment 2 ID: Each Fuel-Process set (21,22,23) creates a Fuel-
Process segment in the master file. Each Fuel-Process segment
under the same point source segment must have a unique Segment
2 ID number. This number must also be used to reference a
particular segment when making a change or deleting a segment.
3. SCC Code: The Source Classification Code process description
that most nearly describes the process should be entered by
its eight-digit numerical code. If the most appropriate SCC
description appears to be significantly different from the
actual process, enter nothing in this field, but enter NEW
SCC NEEDED in the Source Description field of the 22 card.
4. BEC Code: Enter the Basic Equipment Classification Code that
describes the equipment or process for this source. The last
two digits are used to sequentially number identical units at
the same source.
41
-------
5. Fuel Units: This field is for future expansion of the system.
It will eventually allow the user to specify units for the fuel-
process field in other than NEDS units. It is currently ignored
by the system.
6. Fuel, Process, Solid Waste: The annual figures will be reported
in this field using the units associated with the SCC code for
this process.
7. Maximum Design: The maximum hourly design rate of the most
important process equipment, or the upper operating limit that
generally would not be exceeded in normal practice, should be
entered here. Units are expressed in those corresponding to
the SCC for the process.
8. Sulfur and Ash Content: Entries are to be made in these columns
for all combustion processes. If the process does not burn fuel,
leave the field blank.
9. Heat Content: This field is to be completed only when the process
involves combustion. Units are millions of BTU per SCC.
10. Card Number: 21
42
-------
11. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete.
43
-------
Card 22
1. Segment 1 ID: Enter the same number as on the Segment 1 ID
of the 21 card.
2. Segment 2 ID: Enter the same number as on the Segment 2 ID
of the 21 card.
3. Confidentiality of Data: Process information occasionally is
collected by a government agency under a guarantee that the
data will be treated in a confidential manner and will not
be released to the public. This column indicates whether or
not any data for this source are officially considered con-
fidential. A one (1) indicates confidential classification,
a two (2) no classifiaction and a blank indicates an unknown
status.
4. Source Code: this is needed for NEDS reporting. Enter the
following codes for the process category: B - Boiler, P -
Process, C - Other Combustion unit.
5. Source Description: Enter a brief description of the source
or comments as needed.
44
-------
6. Emission Factor Source: If this field contains a T the
Emission Factors insertion program will insert the appropriate
Emission Factors from a table of SCC codes.
7. Card Number: 22
8. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete.
45
-------
Card 23
1. Segment 1 ID: Enter the same number as in the Segment 1 ID of
the 21 card.
2. Segment 2 ID: Enter the same number as in the Segment 2 ID of
the 21 card.
3. Pollutant ID Code: This field is a five digit code that represents
the pollutant whose emissions are being measured. Source is SAROAD
Parameter Coding Manual, EPA Publication No. APTD-0633.
4. Emission Factor: The emission factor is a statistical average
of the rate at which a pollutant is released to the atmosphere
as a result of some activity, such as combustion or industrial
production, divided by the level of that activity. The emission
factors for each SCC may be found in the EPA publication Compilation
of Air Pollutant Emission Factors, Publication No. AP-42.
5. Ash/Sulfur Code: This code indicates whether or not the Ash or
Sulfur percentage is to be used in the calculation of the estimated
emissions. The codes are: A - Ash, S - Sulfur and blank is
neither apply.
6. Emission Factor Units: This field is for future expansion.
Eventually it will indicate the units in which the emission
46
-------
factors are expressed. The emission factors are now treated
as standard NEDS units. Reference OAF Publication No. AP-42.
7. Card Number: 23
8. Transaction Code: The transaction codes are:
A - Add
C - Change
D - Delete.
Note: Card columns 23 tc 38 may be repeated two more times on the
same 23 card. This allows the storing of up to three sets of
emission factors information on each card.
-------
3. 0 FILE MAINTENANCE AND RETRIEVAL
There are two major EIS programs for building, maintaining and retrieving
data from the EIS master file. These are the File Maintenance program and
the Retrieval program. The Retrieval program actually consists of two sep-
arate programs which work together to process a query to completion, the Re-
trieval Language Processor program and the Retriever program.
-------
3.1 FILE MAINTENANCE
File maintenance performs two basic functions, the creation of a new system
master file and the modification of an existing system master file. The pro-
gram can operate in any of three modes to support the two basic functions.
These modes are add, change and delete. Every transaction card input to the
file maintenance program must be either an add, change or delete card, iden-
tified by an A, C or D in card column 80.
Add cards are used to create a new system master file and to add new records
to an existing master file. Change cards are used to change any field in any
record on an existing master file except record keys, set ID's and pollution
ID's. Delete cards are used to delete an entire logical record (a plant seg-
ment with all subordinate point source and machine process segments), any
point source segment (with all subordinate machine process segments) or any
machine process segment from an existing master file.
The file maintenance program works in the following manner. The old system
master file is read in its entirety once from beginning to end. All input
transaction cards are passed against the file in the order they are read.
According to the action called for on the card records are added to the file,
changed on the file or deleted from the file. The result of the file main- -
tenance program is a new system master file, modified according to the trans-
action cards. In the case of file create, there is, of course, no old master
file. Thus, all the add transaction cards are used to create new records and
add them to the new master file.
49
-------
3.1.1 ORGANIZATION
The file maintenance program is organized in a top-down fashion in which
higher-level modules usually execute one or more lower-level modules to perform
specific functional tasks. Thus, the program is comprised of many relatively
small functional modules organized roughly into a hierarchical tree structure.
The following are the higher level routines of the file maintenance program.
o ROOT-SEGMENT
This is the highest level routine of file maintenance. All other pro-
gram subroutines are subordinate to this one. This routine performs
lower level routines which open all the required files, initialize data
fields, initiate processing of the old system master file (if any),
process all transaction cards, finish copying the old system master file
to the new and close all system files. The only STOP RUN statement in
the whole program is in this routine. Thus, through the use of perform
statements this top level routine is the whole file maintenance pro-
gram.
o MAIN-LOOP
This subroutine, performed by the ROOT-SEGMENT routine, performs a lower
level subroutine to read the next transaction card. Then, depending
on what type of card was read, another subroutine will be performed which
will add a record to the file, change a record on the file, delete a
record from the file or process an invalid transaction card.
o ADD-RECORD
This subroutine, performed by MAIN-LOOP, processes the adding of a
record to the system master file. Depending on the transaction type of
the add card, a subroutine will be performed which will add a root (plant)
segment to the file, add a point source and all related machine process
records to the file or process an invalid transaction card.
50
-------
o CHANGE-RECORD
This subroutine, performed by MAIN-LOOP, processes the changing of a
record on the system master file. This subroutine performs lower level
subroutines to edit the change transaction card, locate and read into
core the record to be changed, perform all changes to the record and
write the updated record back out on the new master file.
o DELETE-RECORD
This subroutine, performed by MAIN-LOOP, processes the deletion of a
record from the system master file. This subroutine performs lower level
subroutines to edit the delete transaction card, locate the record to be
deleted and delete the record from the new master file.
Figure 3.1-1 illustrates the organization of the File Maintenance component.
51
-------
File Maintenance Organization
Figure 3. 1-1
52
-------
3.1.2 COMMUNICATION AND DATA FORMATS
The following COBOL working storage section fields are the major control and
data areas internal to the file maintenance program.
ERR-1 thru ERR-19 - The number of each of the nineteen error messages,
corresponding to the messages themselves in ERROR-MSGS.
ERR-CODE - Contains the number of the error message to be printed
whenever an error is detected.
LINE-MAX - Number of lines to print per page of file maintenance
output listing. Currently set to 52.
MAX-CARD-1 - Maximum number of type 13 transaction cards allowed.
Currently set to 16.
MAX-CARD-2 - Maximum number of type 23 transaction cards allowed.
Currently set to 16.
MAX-SET-2 - Maximum number of type two segments subordinate to a
single type one segment. Currently set to six.
53
-------
CONTROL-SWITCHES - These are the program switches to control internal
logic. The main switches are:
EOF-SW - Controls the top level looping of the MAIN-LOOP
subroutine. Turned on at transaction file end.
READ-SW - Determines whether or not the next transaction card
should be read (in MAIN-LOOP), depending on whether or not the
current card has yet to be processed.
ERROR-MSGS - The nineteen messages used to describe any detected
errors. These messages are referenced by setting the field ERR-CODE
to one of the values contained in ERR-1 thru ERR-19.
OLD-CONTROL - Contains the record Key, date and segment 1 and 2 ID
fields of the current old master file record residing in core.
SAVE-ALL-SET-2 - Contains all the type two segments (up to six)
subordinate to the type 1 segment contained in SAVE-POINT during
change and delete logic.
SAVE-POINT - Contains the type one segment related to the type two
segments stored in SAVE-ALL-SET-2 during change and delete logic.
54
-------
SAVE-CARD - Contains the first two cards of any three card set (01,
02, and 03; 11, 12 and 13; 21, 22 and 23) during the building of
that set during add processing.
The Working Storage fields MAX-CAKD-1 and MAX-CARD-2 indicate the maximum
number of pollutants each record in the master file will now handle. To
increase or decrease the number change the "OCCURS 1 TO 16 TIMES" clause
for the repeating portion of the MSTR-POINT-SOURCE record and the MSTR-
MACHINE-PROCESS record. MAX-CARD-1 and MAX-CARD-2 must be changed to the
same number as the 16 is changed to. All of the programs using the master
file must be recompiled to incorporate this change.
The Working Storage field MAX-SET-2 determines the maximum number of two
segments that can be held in core at any given time. If this number is
changed the "SAVE-SET2 OCCURS 6 TIMES" statement must be changed also.
Whenever any of these "MAX" fields are increased the amount of core storage
must be increased when the programs are to be run.
55
-------
3.1.3 ROUTINES
The higher level file maintenance routines ROOT-SEGMENT, MAIN-LOOP, ADD-
RECORD, CHANGE-RECORD and DELETE-RECORD are described in section 3.1.1. The
routines described here are the lower level routines which are performed by
those higher level routines.
The routines described here basically consist of one structured paragraph
which performs other subroutines to carry out the necessary functions. Thus,
each routine is relatively easy to follow in a functional manner since the
detailed code resides in lower level performed subroutines.
o ADD-ROOT
This subroutine, performed by ADD-RECORD, will add a root segment
(plant segment, type zero) record to an EIS master file. The re-
quired 01,02 and 03 type transaction cards are read and edited
and subroutine LOCATE-SET0 is performed to read the old master file
(if any) and determine where on the file the new root segment should
be added. The segment is then built from the three input cards and
added to the new master file.
o ADD-POINT
This subroutine, performed by ADD-RECORD, will add a point source
segment (type 1 segment) and all subordinate machine process segments
(type 2 segments) to an EIS master file. The 11, 12, multiple 13,
and all occurrances of the 21, 22 and multiple 23 type transaction cards
are read and edited. Subroutine ADD-SET1 is performed to locate the
place in the old master file (if any) where the new segments are to be
added, perform the CALCULATIONS subroutine to calculate the estimated
emissions, and add the new segments to the new master file.
56
-------
CHANGES
This subroutine., performed_by CHANGE-RECORD, actually performs the
changes, as defined by the change transaction card, to the old mas-
ter file. The record that the changes are to be made to is read
Into core and the change card is then scanned for non-blank data
fields. Each such field is used to replace the corresponding field
in the record. After all the change fields on the card are updated
to the record, the updated record is written into the new master
file.
DELETES
This subroutine, performed by DELETE-RECORD, actually performs the
deletion of the logical segment type as specified on the delete trans-
action card. If segment type zero (plant segment) is to be deleted,
all physical records with the specified key will be deleted from the
file. If segment type one (point source segment ) is to be deleted,
all physical records with the specified key and the specified set one
ID will be deleted from the file. If segment type two (machine pro-
cess segment) is to be deleted, the one physical record with the spe-
cified key, set one ID and set two ID will be deleted from the file.
CALCULATIONS
This subroutine is performed whenever a type 1 segment is added to
the master file or changed,or whenever any type two segment is changed
or deleted. The subroutine calculates the estimated-emissions for each
pollution ID in the type 1 and type 2 segments. Basically, the compu-
tation is performed in three parts. First, in subroutine PRELIMINARY-
COMPUTATION, the fuel process rate is multiplied by the emission fac-
tor. Next, in subroutine ASH.-SULFUR-ADJUSTMENT, the product of the
previous multiplication is multiplied by whichever (if any) content
57
-------
Is specified, ash-or sulfur. Last, in subroutine FINAL-COMPUTATION,
the adjusted product is stultiplLed hy the control efficiency factor,
reduced by tfie. emission reduction amount and divided By pounds per
ton. A field over-flow during any arithmetic operation will result
in a final estimated emission of zero.
Figures 3.1-2 through. 3.1-6 illustrate the organization of the File Main-
tenance routines.
58
-------
f ENTER 1
•RITE MASTER
" "
( RETURN I
File Maintenance Routine ADD-ROOT
Figure 3. 1-2
59
-------
CH»RT in: 003
3.1-3
File Maintenance Routine ADD-POINT
Figure 3. 1-3
60
-------
File Maintenance Routine CALCULATIONS
Figure 3. 1-4
61
-------
I ENTER 1
—
GET RECORD TO
BE CHANCED INTO
WORK AREA
CHANCE 01 CARD
CHANGE 02 CARD
CHANGE 03 CARD
CHANGE 1 1 CARD
CHANCE 12 CARD
FIELDS
CHANCE 13 CARD
CHANGE 21 CARD
CHANGE 22 CARD
—
CHANGE RECORD
DATE
RETURN RECORD
f ^\
CHANGE 23 CARD
File Maintenance Routine CHANGES
Figure 3.1-5
62
-------
c
I RETURN 1
File Maintenance Routine DELETES
Figure 3. 1-6
63
-------
3.2 RETRIEVAL
The EIS retrieval function Is performed .Ey two separate programs, the
Retrieval Language Processor and tfie Retriever.
64
-------
3.2.1 RETRIEVAL LANGUAGE. PROCESSOR
The Language Processor component reads a set of retrieval cards, edits
toe cards and generates a COBOL program which when executed will per-
form the specified retrieval and sort functions.
The working storage section of the language processor contains several
sets of COBOL skeleton statements. These are statements which when taken
together do not form a valid COBOL program since some are out of sequence,
others are incomplete and additional ones must be generated. As the lan-
guage processor edits a user query, it completes, selects and writes the
skeleton statements in a sequence determined by the user specified cards.
When editing is completed, a valid COBOL program has been assembled and
written on the COBOL input data set.
The generated COBOL program is in one of two forms depending on whether
or not the query specifies a sort. The two forms are essentially simi-
lar except that all statements required by the sort function are not
generated when the query does not specify a sort.
65
-------
3.2.1.1 ORGANIZATION
The Language Processor component is organized as a control segment with three
subordinate routines; the control card processing routine, the if editing routine
and the sort editing routine.
o CONTROL SEGMENT - Opens the data sets required by the component, passes
control to the card processing routine and when control is returned
closes the data sets and terminates the run.
o CONTROL CARD PROCESSING - Reads the retrieval control cards, identi-
fies each as to type and passes control to the appropriate processing
paragraph. When an end-of-file is detected on the input data set con-
trol returns to the main routine.
o IF EDITING - Reads and edits the EIS format retrieval specification
cards.
o SORT EDITING - Reads and edits the sort specification cards.
Figure 3.2.1-1 illustrates the organization of the Retrieval Language Processor
component.
66
-------
EDIT EIS IF
FORMAT
Retrieval Language Processor Organization
Figure 3.2. 1-1
67
-------
3.2.1.2 COMMUNICATION AND DATA FORMATS
The following defines the usage of the main working storage data areas.
o SK-INDEX-L - Contains a subscript value for the skeleton statement in
which the next sort key length will be placed.
o SK-INDEX-N - Contains a subscript value for the skeleton statement in
which the next sort key name will be placed.
o ' SK-INDEX'-T .- Contains a subscript value for the skeleton statement in
which the next sort key type will be placed.
o COPY-SW - May contain ON or OFF. If ON retrieval specifications in
inline COBOL format were read. If OFF the cards were not read.
i
o EDIT-SW - May contain ON or OFF. Contains ON when performing the if
editing or sort editing routine. Contains OFF after detecting a blank
logical connector field or after five soft cards.
o EOJ-SW - May contain ON or OFF. If ON, a data set end-of-file has been
detected.
o ERROR-SW - May contain ON or OFF. If ON, some type of editing error
has been detected.
o FOUND-SW - May contain ON or OFF. If ON, the argument being searched
for was found.
o INPUT-SW - May contain ON or OFF, If OFF no input cards were read.
o READ-SW - May contain ON or OFF. If OFF a card is not to be read from
the input data set.
68
-------
REL-OPERATOR-VALUES - A table containing the translation of the EIS
fixed format relational operator code to COBOL relational operator
words.
SET-1-IMAGES - Contains the skeleton statements for the identification
division, the data division and first part of the procedure division.
SET-2-IMAGES - Contains the skeleton statements for the middle portion
of the procedure division.
SET-3-IMAGES - Contains the skeleton statements for the end of the
procedure division.
SORT-1-IMAGES - Contains the skeleton statements which complete the build .
sort key paragraph.
IF-1-IMAGES - Contains the skeleton statements which are added to the
qualification paragraph for each EIF fixed format IF clause.
ELEMENT-NAME-VALUES - Contains all data file field names which can be
referenced in a query. The first byte indicates the field mode. The
next two bytes contain the field length. The next byte is an indicator
(I) if the field is in the type 1 repetitions. The remaining 30 bytes
contain the field name.
ROUTINE-COPE-VALUES - Contains the sequencing control matrix for the
control card processing routine. The EXPECTED-CARD-TYPE and CARD-CODE
values determine the i. entry of the matrix. This entry contains the
argument of a go to depending on statement to pass control to the
various paragraphs of the control card processing routine.
CARD-SEQUENCE-VALUES - A table containing valid control card names and two
numbers. The first is the CARD-CODE which is used with the sequencing
control matrix and the second is the code of the next expected control
card.
69
-------
3.2.1.3 ROUTINES
The following subroutines are in the PROCESS-CARD main routine.
o PROCESS-CARD - This paragraph, reads a card from the input data set,
determines what type it is and passes control to one of the following
paragraphs.
o CARD-INVALID-ERROR - This paragraph issues an error message indicating
that the card just read is not a valid $$ control card.
o CARD-SEQUENCE-ERROR - This paragraph issues an error message indicating
that the card just read is a $$ control card but it is out of sequence.
o QUERY-CARD - This paragraph performs the initialization that is required
for the beginning of a query. It passes control to INITIALIZE-SORTKEY
to initialize the sortkey length and name fields in the skeleton state-
ments.
o . .END-CARD - This paragraph performs the required end of query functions.
It-; adds the final skeleton statements to the COBOL program.
o SORT-CARD - This paragraph performs the initialization that is required
to process the sort specification cards. These cards are processed, by
the SORT-EDIT routine which receives control from this paragraph. The
skeleton statements necessary for the retriever sort function are written
on the COBOL input data set.
o SORT-CARD-DEFAULT - This paragraph outputs the skeleton statements that
do not pertain to retriever sort.
o IF-CARD - This paragraph performs the initialization required to process
the EIS fixed format qualification specification cards. The IF-EDIT
70
-------
routine receives control and processes these cards. This paragraph adds
the skeleton statements to complete the qualification paragraph of the
retriever.
o IF-CARD-USER-INLINE - This paragraph passes control to the COPY-CARDS
paragraph to copy the. user specification cards from the input data set
to the COBOL input data set.
o IP-CARD-USER-LIBRARY - This paragraph inserts the user member name into
a skeleton statement and adds the statement to the COBOL input data set.
The following subroutines are in the IF-EDIT main routine-.
o IF-EDIT - This paragraph passes control to the IF-EDIT-SEQUENCING para-
graph if the edit switch is on. If not, an error message is issued,
0 IF-EDIT-SEQUENCING - This paragraph passes control sequentially to each
of the following paragraphs and then adds the four line clause to the
COBOL input data set.
o IF-EDIT-LEFT-PARENS - This paragraph counts the number of left parentheses
which precede the subject name.
o IF-EDIT-SUBJECT-NAME - This paragraph examines the subject name field
for a valid name. If the name is invalid an error message is issued.
o IF-EDIT-RELATIONAL - This paragraph examines the relational operator field
for a valid relational operator. If the operator is invalid an error
message is issued.
o IF-EDIT-RIGHT-PARENS - This paragraph counts the number of right paren-
theses which follow the object name.
71
-------
o IF-EDIT-OBJECT-LITERAL - This paragraph examines the object name field
for an alphanumeric or numeric literal.
o IF-EDIT-OBJECT-NAME - This paragraph examines the object name field for
a valid data file field name. If the name is invalid an error message
is issued.
o LF-EDIT-LOGICAL - This paragraph examines the logical connector field for
a valid connector. If not found, an error message is issued. The edit
switch is turned off when the logical connector field is blank.
The following subroutines are in the SORT-EDIT main routine:
o SORT-EDIT - This paragraph passes control to the SORT-EDIT-SEQUENCING
paragraph if the edit switch is on. If not, an error message is issued.
o SORT-EDIT-SEQUENCING - This paragraph passes control to each of the
following paragraphs.
o SORT-EDIT-SUBJECT-NAME - This paragraph examines the subject name field
for a valid data file field name. If invalid, an error message is
issued. The sort type field is examined for a valid sort type word.
The sortkey lengths and names are adjusted by this paragraph.
o SORT-NAME--CQUNT - This paragraph counts the number of sort specifica-
tion cards processed. When the count exceeds 5, the edit switch is turned
off.
Figures 3.2.1-2 through 3.2.1-4 illustrate the organization of the Retrieval
Language Processor routines.
72
-------
Retrieval Language Processor Routine PROCESS-CARD
Figure 3. 2. 1-2
73
-------
Retrieval Language .Processor Routine IF- EDIT
Figure 3. 2. 1-3
74
-------
Retrieval Language Processor Routine SORT-EDIT
Figure 3. 2. 1-4
75
-------
3.2.2 RETRIEVER
The Retriever component sequentially processes all logical records of a data
file. Each, logical record read is examined to determine if the qualification
specifications are met. If so, the qualified record is placed either on the
answer data set or the sort input data set. Qualified records on the sort data
set will be sorted according to the sort specifications and then placed on the
answer data set.
76
-------
3.2.2.1 ORGANIZATION
The Retriever is organized as a control segment with, three subordinate rou-
tines, the retrieval routine, the strip key routine and the set parameters
routine. When a sort Is not specified in the query, the strip key routine
is omitted.
o CONTROL-SEGMENT - Opens the data sets required by the component and
passes control to the set parameters routine which sets switches to
indicate the retrieval functions. The control segment then either per-
forms the retrieval routine if a sort was not specified or passes control
to COBOL sort. The SORT statement, in turn, passes control to the re-
trieval routine, sorts the qualified records and then passes control to
the strip key routine which removes the sortkeys from the sorted records
and places them on the answer data set. The control segment will then
close the data sets and terminate the run.
o RETRIEVAL - Reads a logical record from the data file, performs the
qualification tests in the sequence determined by the switches set by
the set parameters routine and writes the qualified record, if any,
on the answer data set or the sort input data set.
o STRIP-KEY - Reads a physical record from the sort output data set and
writes it on the answer data set.
o SET-PARAMETERS - Sets the switches which indicate the retrieval environ-
ment.
Figure 3.2.2-1 illustrates the organization of the Retriever component.
77
-------
Retriever Organization
Figure 3. 2. 2-1
78
-------
3.2.2.2 COMMUNICATION AND DATA FORMATS
o EMQSW - May contain TRUE or FALSE. If TRUE, the query is qualify-
ing on a field name in the type 1 repetitions.
o EMSSW - May contain TRUE or FALSE. If TRUE, the query is sorting on a
field name in the type 1 repetitions.
o EOJSW - May contain TRUE or FALSE. If TRUE, a data set end-of-file has
been detected.
o FRDSW - May contain TRUE or FALSE. If TRUE, the first physical record
read during the logical record-reading is not to be performed.
o LGLSW - May contain TRUE or FALSE. If TRUE, the logical record may be
processed.
o LGLCSW - May contain TRUE or FALSE. If TRUE, the logical record read-
ing is completed.
o QRSLT - May contain TRUE or FALSE. If TRUE, the type 0 record, the
type 1 record and a single repetition has met the qualification speci-
fication.
o QRSLTA - May contain TRUE or FALSE. If TRUE, the type 0 record, the
type 1 record and one or more of the repetitions has met the qualifi-
cation specification.
o SRTSW - May contain TRUE or FALSE. If TRUE, the query has specified
a sort.
o T2RSW - May contain TRUE or FALSE. If TRUE, the query has specified that
the type 2 records are to be part of each qualified record.
79
-------
RECORD-EXPECTED - Contains the code of the next physical record that
should be read in the logical record reading.
RECORD-FOUND - Contains the code of the physical record that was just
read.
ROUTINE-CODE-VALUES - Contains the sequencing control matrix for the
logical record reading. The RECORD-FOUND and RECORD-EXPECTED codes
determine the i. entry of the matrix. This entry contains the argu-
ment of a go to depending on statement to pass control to the various
paragraphs of logical record reading routine.
NRC0 - Contains the type 0 record.
NRC1 - Contains the type 1 record fixed portion and one repetition.
Retrieval qualification is performed on the data in the NRC0 and
NRC1 areas.
WRC1 - Contains the type 1 record and all its repetitions. During quali-
fication the repetitions may be moved from this area to the NRC1 area.
WRC2 - Contains the type 2 records.
80
-------
3.2.2.3 ROUTINES
The following subroutines are In the RETRIEVAL main routine:
o PROCESS-FILE - This paragraph is the high level control for the retrie-
val routine. It passes control to the GET-LOGICAL-RECORD paragrapn which
reads a logical record. Then, depending on the switch settings control
passes to either EMQUAL-EMSORT, EMQUAL-NO-EMSORT, or NO-EMQUAL-NO-EMSORT
which performs the qualification. This process continues until an end-
of-file occurs.
o EMQUAL-EMSORT - This paragraph together with paragraph EMQUAL-EMSORT-A
control the qualification tests when a repetition field is referenced
in both the retrieval and sort specification. The repetitions of the
type 1 record are processed in the following manner. The nth repetition
in the WRC1 area is moved to the first repetition in the WRC1 area and
the single repetition in the NRC1 area. The qualification paragraph is
performed and if true the logical record consisting of the type 0 and
the type 1 with one repetition is given to sort. This process repeats
n times, the number of repetitions in the type 1 record.
o EMQUAL-NO-EMSORT - This paragraph together with paragraph EMQUAL-NO-
EMSORT-A control the qualification tests when a repetition field is
referenced in a retrieval specification. The nth repetition in the WRC1
area is moved to the mth repetition in the WRC1 area and the single re-
petition in the NRC1 area. The qualification is performed and if true
m is stepped. The subscription steps from 1 to the number of repetitions
while m steps from 1 to k where k is the number of repetitions that
qualified. After all repetitions have been tested, the logical record
consisting of the type 0 and the type 1 with m repetitions is written on
the answer set or the sort input data set.
o NO-EMQUAL-NO-EMSORT - This paragraph is performed when the query does
not reference a repetition field. The qualification is performed and
81
-------
If true the logical record consisting of the type 0 and the type 1 with
all Its repetitions are written on the answer set or the sort input data
set.
o OUTPUT-SORT-RECORDS - This paragraph performs the BUILD-SORTKEY para-
graph which builds the sortkey. The sortkey is added to the type 0
record and the type 1 record. The records are then given to sort.
o OUTPUT-SORT-RECORDS-A - This paragraph builds the sortkey and adds it
to each type 2 record. The record is then given to sort.
o OUTPUT-RECORDS - This paragraph writes the type 0 and type 1 record
on the answer data set.
o OUTPUT-RECORDS-A - This paragraph writes each type 2 record on the
answer data set.
o GET-LOGICAL-RECORD - This paragraph is the high level control for read-
ing a logical record. It performs the LGL-RECORD paragraph until the
logical record is complete.
o LGL-RECORD - This paragraph passes control to one of the following six
paragraphs depending on what was selected from the sequencing control
matrix.
o PROCESS-ERROR - This paragraph is entered when a file sequencing error
was detected. It issues an error message and terminates the run.
o PROCESS-TYPE0 - This paragraph is entered when a type 0 record was read.
It moves the record to the NRC0 area.
o PROCESS-TYPEl - This paragraph is entered when a type 1 record was read.
It moves the record to the WRC1 area and NRC1 area.
82
-------
o PROCESS-TYPE2 - This paragraph- is entered when a type 2 record was read.
It moves the record to the WRC2 area.
o LOGICAL-RECORD-COMPLETE - This paragraph Is entered when the logical
record Is complete in working storage and contains all the data neces-
sary for processing. '<-••
o LOGICAL-RECORD-INCOMPLETE - This paragraph is entered when the logical
record is complete-in working- storage but does not contain the neces-
sary data for processings
o QUALIFICATION -"'This paragraph contains the retrieval qualification
specification stated by the user. Its contents vary.
o BUILD-SORTKEY - This paragraph contains the sort specification stated
by the user. Its contents vary.
Figure 3.2.2-2 illustrates the organization of the Retriever routines.
83
-------
Retriever Routine RETRIEVAL
Figure 3. 2. 2-2
84
-------
4.0 OUTPUT PROGRAMS
There are five output programs In the EIS system, each producing a different
form of output. These five are the File List, Summary Report, NEDS Point
Source, NEDS Area Source, and NEDS Area Source Report output programs.
85
-------
4.1 FILE LIST OUTPUT
The File List program produces a detail listing of the EIS master file and the
EIS retrieval answer files. The files will be listed with one point source
record per page. If a single plant has more than one point the plant informa-
tion is repeated for each point source page.
86
-------
4.1.1 ORGANIZATION
The File List program is organized in a top down modular structure. There is
one main module where the program is entered and left. This main module exe-
cutes six subordinate modules. The program contains six other modules which
are subroutines used by all other modules.
o ROOT-SEGMENT
This is the highest level module in the program. This module opens all
of the files used in the program, and then initializes the Master File
work area. It then executes the main program loop until all master records
have been read and printed. After the last line has been printed, the
master record count line is printed as an indication that all records
have been printed.
o MAIN-LOOP
This routine is performed by the ROOT-SEGMENT until the end of file on
the master file is reached. This routine determines the record type and
performs the appropriate subroutine to print that record type.
o STAT-PRINT
This routine formats and prints the master record count line at the .end
of the program.
Figure 4.1-1 illustrates the organization of the File List component.
87
-------
File List Organization
Figure 4. 1-1
88
-------
4.1.2 COMMUNICATION AND DATA FORMATS
The following COBOL WORKING-STORAGE fields are the major control flags
internal to File List.
o ZERO-PRINT-SWITCH - Used by the MAIN-LOOP subroutine to determine if a
zero record has been printed for the current one record (ZERO-PRINT-
SWTICH= 1) or if the zero record has yet to be printed (ZERO-PRINT-
SWITCH= 0).
o EOF-SWITCH - Used by the ROOT-SEGMENT to determine if any of the sub-
routines have read the last record on the master file (EOF-SWITCH=
1).
89
-------
4.1.3 ROUTINES
There are no major subroutines in thfs program.
90
-------
4.2 SUMMARY REPORT OUTPUT
This program will produce a summary based on control breaks specified by the
user. It accumulates number of sources, estimated emissions, actual emissions,
allowable emissions and control costs. The data must be sorted in the order
of the specified control breaks. One of the control breaks must be pollu-
tion ID to produce a meaningful report.
The Emissions Summary program utilizes the Report Writer feature of COBOL.
Therefore, the remaining portion of the program consists of routines which
prepare the data and "drive" the Report Writer.
91
-------
4.2.1 ORGANIZATION
The report summary capability consists of the following routines:
o ROOT-SEGMENT - This is the highest level routine. It opens and closes
data sets, initiates and terminates the COBOL Report Writer and con-
trols processing of the summary report.
o CTL-READ-INIT - This is a second level routine which controls the
reading and initialization of the summary header control cards.
o CTL-CARD-LOOP - This is a third level routine which reads control cards
and controls processing of the control cards.
o CTL-CARD-OP1 - This is a fourth level routine which processes the
"OP1" control card.
o CTL-CARD-OP2 - This is a fourth level routine which processes the "OP2"
control card.
o CTL-CARD-OP3 - This is a fourth level routine which processes the "OP3"
control card.
o CTL-CARD-OP4 - This is a fourth level routine which processes the "OP4"
control card.
o GEN-SUM-REPORT - This is a second level routine which controls reading
of the EIS file data and preparation of that data. It also "drives"
the portion of the Report Writer which generates the summary.
o READ-ZERO-ONE-REC - This is a third level routine which reads an EIS
file record and moves it to working storage.
92
-------
o FIELD-INET - This is a third level routine which assures that all
accumulated values are numeric.
o SET-BREAK-VALUES - This is a third level routine which sets the user
specified break control values.
Figure 4.2-1 illustrates the organization of the Summary Output component.
93
-------
f ST»RT . J
READ
READ AND
PROCESS CTL
CARDS
1 ' I I
DPI
CTL CARD
PROCESSOR
OP2
CTL CARD
PROCESSOR
OP3
CTL CARD
PROCESSOR
OP4
CTL CARD
PROCESSOR
Summary Report Organization
Figure 4. 2-1
94
-------
4.2.2 COMMUNICATION AND DATA JORMATS
The summary program uses the. following data sets:
o EISFILE - This is an input data set and contains the sorted answer
file.
o SUMCARDS - This is an input data set and contains the summary header
control cards.
o CARDLOG - This is an output data set for logging the summary header
control cards.
o SUMFILE - This is an output data set for the summary report.
The summary program uses the following data/communication array:
o OLD-CONTROL - This array resides in the file section and defines
the EIS record key.
o OLD-MAST0 - This array resides in the file section and defines the
EIS zero segment.
o OLD-MAST1 - This array resides in the file section and defines the
EIS one segment.
o OLD-MAST2 - This array resides in the file section and defines the
EIS two segment.
o BREAK-ONE - Lowest level control value in working storage.
BREAK-TWO - Second lowest level control value in working storage.
BREAK-THREE - Third lowest level control value in working storage.
95
-------
BREAK-FOUR - Fourth lowest level control value In working storage.
BREAK-FIVE - Highest level control value In working storage.
o CTL-CRD-ONE - This array resides In working storage and describes control
card one.
o CTL-CRD-TWO - This array resides In working storage and describes control
card two.
o CTL-CRD-THREE - This array resides in working storage and describes
control card three.
o CTL-CRD-FOUR - This array resides In working storage and describes control
card four.
o EMT-SET-INDEX - This data name must be used as a subscript when referring
to any data Item In the repeating portion of the record. For example,
if Primary Control Equipment is to be the second control break, the state-
ment would be written - MOVE MSTR-PRIMARY (EM-SET-INDEX) TO BREAK-TWO.
o MSTR-FIXED-SEGMENT - This array resides in working storage and describes
the EIS zero record.
o MSTR-POINT-SOURCE - This array resides in working storage and describes
the EIS one record.
o SUM-BUCKETS - This array resides in working storage. It defines tem-
porary storage for values being accumulated.
96
-------
4.2.3 ROUTINES
o COBOL Report Writer
The COBOL Report Writer section has seven control fields. These are in
order of level (high to low):
1 - Final
2 - Control-Separate
3 - Break-Five
4 - Break-Four
5 - Break-Three
6 - Break-Two
7 - Break-One
It has a page heading and a page footing. Ther* is a detail line, without
output, to trigger the summary accumulation. There is a heading control on
CONTROL-SEPARATE which can be used to create a separation line (should only be
used when all five breaks are specified). There are control footings for each
break.
97
-------
4.3 NEDS POINT SOURCE OUTPUT
The NEDS point source output program produces NEDS point source records from
the records in an EIS file. The EtS records are converted as follows: the
type 0 record produces an API record; the type 1 record produces AP2, APS,
AP4 and APS records; and each type 2 record produces an AP6 record. If a
single plant (type 0 record) has more than one point source (type 1 record),
the API record is repeated for each new type 1 record.
98
-------
4.3.1 ORGANIZATION
The NEDS point source output program Is organized in a top down, modular struc-
ture. There is only one entrance and one exit from the program, both contained
in the highest level module. Each lower level module invoked has the same
characteristics: one entrance and one exit.
o ROOT-SEGMENT
This is the highest level module in the program. As such, it controls
the execution of all modules subordinate to it. The first routine per-
formed by ROOT-SEGMENT opens all files used by the program and initia-
lizes all switches. The second routine is the main processing loop and
is executed until all EIS records have been converted to NEDS records
and output. The final routine performed by ROOT-SEGMENT prints a ter-
mination record and closes all files.
o MAIN-LOOP
This routine is performed by ROOT-SEGMENT until an end of file is
detected on the EIS file. It determines the record type and invokes
the appropriate conversion routine. If the record type is invalid, a
diagnostic message is printed and processing continues with the next
EIS record.
o ZERO-RECORD-CONVERSION
This routine initializes all NEDS records to blanks and saves the key
portion of the type 0 EIS record. It then converts the EIS record to
a NEDS API and outputs it.
99
-------
o ONES-RECORD-CONVERSION
If the NEDS API record has yet to be wrLtten (i.e., this is not the first
type 1 EIS record with this key), this routine will write the previously
created NEDS API record and then proceed to convert the EIS type 1 record.
A routine named EXTRACT-POLLUTANT-DATA is invoked to extract variable
length pollutant data from the type 1 record. After the NEDS AP2, AP3,
AP4 and APS records are built, they are output.
o TWOS-RECORD-CONVERSION
This routine converts the EIS type 2 record to a NEDS AP6 record and
outputs it.
Figure 4.3-1 illustrates the organization of the NEDS Point Source Output
component.
100
-------
f START J
F
L°
CINES-RECORD-CNV
CONVERT El 5
ONES RECORD TO
NEDS
EXTRACT-POLL-DATA
EXTRACT VARIABLE
LENGTH POLLUTANT
DATA
NEDS Point Source Output Organization
Figure 4. 3-1
101
-------
4.3.2 COMMUNICATION AND DATA FORMATS
The following COBOL WORKING-STORAGE fields are the major control flags internal
to NEDS point source output program.
o NEDS-01-WRITTEN-SW .- Used by the ONES-RECORD-CONVERSION routine to
determine if the NEDS API record has been written (NEDS-01-WRITTEN-
SW = 1) or if it has to be written (NEDS-01-WRITTEN-SW = 0).
o END-OF-FILE-SW - Used by the ROOT.-SEGMENT to determine when all records
from the EIS file have been written (END-OF-FILE-SW = 1).
102
-------
4.3.3 ROUTINES
There are no jnajor subroutines tn. tEis program.
103
-------
4.4 NEDS AREA SOURCE OUTPUT
This program will produce NEDS format Area Source Records from EIS Area
Source data. The program expects only Area Source data. Therefore, if both
Point and Area Source data is contained in the EIS file, the Area Source records
must be retrieved before execution of this capability. This program can be
better understood if one is familiar with the process of converting from NEDS
Area Source to EIS format Csection 5.2).
NEDS Area Source Records are generated by creating a set of records from a
logical EIS record. This is done by accumulating the estimated emissions and
moving the values from the EIS record to the NEDS record. When all values
have been set in the NEDS records, the entire set is output.
104
-------
4.4.1 ORGANIZATION
The program consists of the following routines:
o ROOT-SEGMENT - This is the highest level routine. It opens and closes
files and controls processing until all EIS data has been processed.
o GEN-NEDS-AS-RECS - This is a second level routine. It reads the EIS
records and controls processing until a logical record has been processed.
It then causes the NEDS records which have been generated as a result
of this processing to be output.
o EIS-FILE-EOF - This is a third level routine. It is executed when the
EIS end of file has been encountered. It determines whether NEDS
records need to be output and causes them to be output where required.
0 OUTPUT-NEDS-AREA-SOURCE - This is a third level routine. It converts
the accumulated emissions to hundreds of tons. These emissions are moved
to the NEDS Al card. All NEDS cards are then logged on the printer and
written on the output data set.
o PROCESS-0-REC - This is a third level routine. It initializes the NEDS
record areas and the emissions accumulators.
o PROCESS-1-REC - This is a third level routine. This routine causes
emissions to be accumulated for all pollutants.
o ACCUM-EMISSIONS - This is a fourth level routine. It causes emissions
to be accumulated in the appropriate pollutant accumulator.
o PROCESS-2-REC - This is a third level routine. It controls execution
of the routines which set the fuel/pollution source values.
Figure 4.4-1 illustrates the organization of the NEDS Area Source Output Com-
ponent .
105
-------
I START 1
NEDS Area Source Output Organization
Figure 4. 4-1
106
-------
4.4.2 COMMUNICATION AND DATA FORMATS
The NEDS Area Source Output program uses the following data sets:
o EISFILE - This is the input data file. It may be a master file or an
answer file provided that it contains only area source data records.
o NEDASFIL - This is the output file for the NEDS format Area Source
records.
o NEDASLOG - This is the printer log for the NEDS format Area Source
records.
The NEDS Area Source Output program uses the following data/communication
arrays:
o MSTR-FIXED-SEGMENT - This data array resides in the file section and
describes the format of the EIS master fixed (record 0) segment.
o MSTR-POINT-SEGMENT - This data array resides in the file section and
describes the format of the EIS master point (record 1) segment.
o MSTR-MACHINE-PROCESS - This data array resides in the file section and
describes the format of the EIS master machine (record 2) segment.
o CARD-STORAGE-AREA - This data array resides in the working storage sec-
tion and describes the format of NEDS Area Source records A1-A5.
o AA6-CARD-OUTPUT - This data array resides in the working storage section
and describes the format of NEDS Area Source record A6.
o WORK-SCC - This data array resides in the working storage section and
describes the format of the SCC..
107
-------
o POLL-ID-TABLE - This data array resides in the working storage section
and defines the Area Source Pollutant codes.
o AS-FUEL-CODES - This data array resides in the working storage section
and defines the fuel/pollutant source codes.
o SUL-ASH-CODES - This data array resides in the working storage
section and defines the Sulfur/Ash codes.
108
-------
4.4.3 ROUTINES
For each Area Source category there is a subroutine to set the fuel/
pollutant source value. The PROCESS-2-REC routine controls the execu-
tion of these subroutines and of the subroutine which sets the percentages
of sulfur and/or ash.
The routine consists of the following subroutines:
RES-FUEL - This subroutine sets the Residential fuel values.
COMM-AND-INST-FUEL - This subroutine sets the Commercial and
Institutional Fuel values.
INDUST-FUEL - This subroutine sets the Industrial Fuel values.
ON-SITE-INCIN - This subroutine sets the On Site Incineration
Pollutant values.
OPEN-BURN - This subroutine sets the Open Burning Pollutant values.
GAS-FUEL - This subroutine sets the Gasoline Fuel values.
DIES-FUEL - This subroutine sets the Diesel Fuel values.
109
-------
AIR - This subroutine sets the Aircraft Pollutant values.
VES - This subroutine sets the Vessels Pollutant values.
EVAPOR - This subroutine sets the Evaporation Pollutant values.
MEAS-VEH-MILE - This subroutine sets the Measured Vehicle Mile
Pollutant values.
MISC-DUST - This subroutine sets the Miscellaneout Dust Pollutant
values.
MISC-BURN - This subroutine sets the Miscellaneout Burning
Pollutant values.
Figure 4.4-2 illustrates the organization of the NEDS Area Source Output
routines.
110
-------
NEDS Area Source Output Routine PROCESS-2-REC
Figure 4. 4-2
111
-------
4.5 NEDS AREA SOURCE REPORT
The NEDS area source report program produces a formatted listing of the
information contained in NEDS area source records. Each AAl card starts
a new page and the entire set (AAl through AA6) is listed on one page.
112
-------
4.5.1 ORGANIZATION
The NEDS area source report program is organized in a top down, modular
structure. There is only one entrance and one exit from the program, both
contained in the highest level module. Each lower level module invoked
has the same characteristics: one entrance and one exit.
o ROOT-SEGMENT
This is the highest level mdoule in the program. As such,
it controls the execution of all modules subordinate to it.
The first routine performed by ROOT-SEGMENT opens all files
used by the program and initializes all switches. The second
routine is the main processing loop and is executed until all
NEDS records have been formatted and listed. The final routine
performed by ROOT-SEGMENT prints a termination message and
closes all files.
o MAIN-LOOP
This routine is performed by ROOT-SEGMENT until and end of file
is detected on the NEDS file. The NEDS record is edited and,
if no severe errors are found, formatted and listed.
113
-------
o EDIT-ROUTINE
This routine edits each of the six different types of NEDS
.e
records. A^diagnostic message is issued for each error found.
If invalid data on the NEDS cards is encountered, the record
is rejected.
O GENERATE-REPORT
This routine formats and lists all NEDS records passed by the
EDIT-RODTINE.
Figure 4.5-1 illustrates the organization of the NEDS Area Source Report
component.
114
-------
4.5.2 COMMUNICATION AND DATA FORMATS
The following COBOL WORKING-STORAGE fields are the major control flags
internal to the NEDS area source report program.
o ERROR-FOUND-SW - Used by MAIN-LOOP to determine if EDIT-ROUTINE
has detected any serious errors in the NEDS record (ERROR-FOUND-
SW = 1).
o END-OF-FILE-SW - Used by ROOT-SEGMENT to determine when all
NEDS records have been processed (END-OF-FILE-SW = 1).
115
-------
4.5.3 ROUTINES
There are no major subroutines in this program.
116
-------
NEDS Area Source Report Organization
Figure 4.5-1
117
-------
5.0 CONVERSION PROGRAMS
There are two EIS conversion programs which, convert other types of data
to EIS format. These are the NEDS Point Source to EIS and the NEDS Area
Source to EIS.
118
-------
5.1 NEDS POINT SOURCE TO EIS CONVERSION
This Program converts NEDS Potnt Source Input Data to the emission inventory
transaction record format. All input cards not containing the Point Source
Code and Point Source Input card numbers ranging from one (1) to six (6) are
rejected and listed as invalid.
119
-------
5.1ol ORGANIZATION
The NEDS point source.to EIS conversion program is organized in a top down,
modular structure. There is only one entrance and one exit from the program,
both contained in the highest level module. Each lower level module invoked
has the same characteristics: one entrance and one exit.
o ROOT-SEGMENT
This is the highest level module in the program. As such, it
controls the execution of all modules subordinate to it. The
first routine performed by ROOT-SEGMENT opens all files used
by the program and initializes all switches. The second routine
is the main processing loop and is executed until all NEDS
records have been converted to EIS transactions and output.
The final routine performed by ROOT-SEGMENT prints execution
statistics and closes all files.
o MAIN-LOOP
This routine is performed by ROOT-SEGMENT until an end of file
is detected on the NEDS file. It determines the record type
and invokes the appropriate conversion routine. If the record
type is invalid, a diagnostic message is printed and processing
continues with the next EIS record.
120
-------
o CONVERT-API through CONVERT-AP6
Each type of NEDS record has its own conversion routine. In
general, these routines accumulate the information contained
in the NEDS records until sufficient information is available
to generate the EIS transaction sets. At that point, the
appropriate transaction generation routines are invoked.
Figure 5.1-1 illustrates the organization of the NEDS Point Source to EIS
conversion component.
121
-------
NEDS Point Source to EIS
Figure 5.1-1
122
-------
5.1.2 COMMUNICATION AND DATA FORMATS
The following COBOL WORKING-STORAGE fields are the major control flags
internal to the NEDS point source to EIS conversion program.
o END-OF-FILE-SW - Used by the ROOT-SEGMENT to determine when
all records from the NEDS file have been written (END-OF-FILE-
SW - 1).
o GEN-1-SET-SW - Used primarily by the conversion routines to
determine when sufficient information has been accumulated to
allow the generation of the EIS transaction sets (GEN-1-SET-SW
- 1).
o CARD-13-WRITTEN-SW - Used by the EIS transaction set 1 gen-
eration routine to determine whether the pollution data
extraction routine has generated any 13 transactions. If it
has not, a dummy 13 transaction is written to the output file
(GEN-13-WRITTEN-SW - 0).
123
-------
5.1.3 ROUTINES
The following are major subroutines of the NEDS point source to EIS conversion
program.
o EXTRACT-POLLUTANT-DATA
This routine extracts any information present relating to each
of the five pollutants contained in NEDS and places it in EIS
13 transactions. If no information is present on any of the
pollutants, no 13 transactions are written by this routine.
o GENERATE-0-set
This routine generates the EIS set 0 transactions from the
information contained in the API card.
o GENERATE-1-SET
This routine generates the EIS set 1 transactions from the
information contained in the AP2 through APS cards.
o GENERATE-2-SET
This routine generates the EIS set 2 transactions from the
information contained in the AP6 card.
124
-------
5.2 NEDS AREA SOURCE TO EIS CONVERSION
This program will accept NEDS Area Source input records and will generate
EIS format records which- can he processed by the EIS Tile Maintenance
Program. The program works only with a full set of NEDS records, i.e.,
Al, A2, A3, A4 and A5 records. The A6 record is read, but not processed
by the program.
An area is divided into thirteen categories Ca category can be equated
to a pollutant source). These categories and the associated fuels or
pollutant sources are identified in Table 5.2-1. This becomes the basis
for the Area Source conversion, i.e., on this basis, EIS format records
are generated which describe the area and provide information which can
be used by EIS File Maintenance to calculate estimated emissions by pollu-
tant. The contents of the EIS transaction records are described in Table
5.2-2.
125
-------
Category
Residential Fuel
EIS ID
(USER-POINT-ID)
901
Commercial and Insti-
tutional Fuel
902
Industrial Fuel
903
ON
n w
On Site Incineration
Open Burning
Gasoline Fuel
Diesel Fuel
904
905
906
907
Fuel/Pollutant Source
Anthracite Coal
Bituminous Coal
Distillate Oil
Residual Oil
Natural Gas
Wood
Anthracite Coal
Bituminous Coal
Distillate Oil
Residual Oil
Natural Gas
Wood
Anthracite Coal
Bituminous Coal
Coke
Distillate Oil
Residual Oil
Natural Gas
Wood
Process Gas
Residential
Industrial
Commercial/Institutional
Residential
Industrial
Commercial/Institutional
Light Vehicle
Heavy Vehicle
Off Hiway
Heavy Vehicle
Off Hiway
Rail Locomotive
(AREA) SCC
90100111
90100222
90100330
90100440
90100500
90100600
90200111
90200222
90200330
90200440
90200500
90200600
90300111
90300222
90300700
90300330
90300440
90300500
90300600
90300800
90401100
90401200
90401300
90501100
90501200
90501300
90602100
90602200
90602300
90702200
90702300
90702400
-------
KJ
Category
Aircraft
Vessels
Evaporation
Measured Vehicle Miles
Miscellaneous Dust
Miscellaneous Burning
EIS ID
(USER-POINT-ID)
908
909
910
911
912
913
Fuel/Pollutant Source
Military
Civil
Commercial
Anthracite Coal
Diesel Oil
Residual Oil
Gasoline
Solvent Purchased
Gasoline Marketed
Limited Access Roads
Rural Roads
Suburban Roads
Urban Roads
Dirt Roads Traveled
Dirt Air Strips
Construction Land Area
Rock Handling & Storing
Forest Fires
Slash Burning
Frost Control
Structure Fires
Coal Refuse Burning
(AREA) SCC
90803100
90803200
90803300
90900111
90904230
90900440
90904430
91005100
91005200
91106100
91106200
91106300
91106400
91207100
91207200
91207300
91207400
91308100
91308200
91308300
91308400
91308500
-------
CARD 01:
FIELD
State
County
AQCR
Plant ID
Date of Record
User Plant ID
Own
Action
Card Number
All Other Fields
CONTENTS
NEDS State
NEDS County
NEDS AQCR
9999
NEDS Year of Record-Day
AREA SOURCE
NEDS Density
NEDS Action
01
Blanks
CARD 02;
FIELD
State through Date of Record
Number of Employees
Action
Card Number
All Other Fields
CONTENTS
Same as Card 01
NEDS County Population
NEDS Action
02
Blanks
CARD 03;
FIELD
State through Date of Record
Action
Card Number
All Other Fields
CONTENTS
Same as Card 01
NEDS Action
03
Blanks
EIS AREA SOURCE RECORDS
Table 5.2-2
128
-------
CARD 11:
FIELD
State through Date of Record
Set ID
Point ID - NEDS
Point ID-User
SIC
IPP
Action
Card Number
All Other Fields
CONTENTS
Same as Card 01
Emission Source Count
Internally Generated
99
Category Code
9999
99
NEDS Action
11
Blank
CARD 12:
FIELD
CONTENTS
State through Set ID
Action
Card Number
All Other Fields
Same as Card
NEDS Action
12
Blanks
11
CARD 13:
FIELD
State through Set ID
Pollutant ID
Estimate Control Efficiency
Estimation Method
Action
Card Number
All Other Fields
CONTENTS
Same as Card 11
Pollutant ID Cod
Particulates - 11101
S02 - 42401
NOX - 42602
HC - 43101
CO - 42101
NEDS Action
13
Blanks
EIS AREA SOURCE RECORDS
Table 5.2-2 (cont.)
129
-------
CARD 21:
FIELD
State through segment 1 ID
Segment 2 ID
SCC
Fuel, Process, Solid Waste
Percent Sulfur
Percent Ash
Heat Content
Action
Card Number
All Other Fields
CONTENTS
Same as Card 11
Internally Generated
Segment Count
NEDS Fuel/Pollution times
Heat Content if not
zero
NEDS Percent Sulfur
NEDS Percent Ash
Zero or NEDS quantity (Forest
fires, slash burning,
frost control and coal
refuse burning)
NEDS Action
21
Blanks
CARD 22:
FIELD
State through Segment 2 ID
Action
Card Number
All Other Fields
CONTENTS
Same as Card 21
NEDS Action
22
Blanks
CARD 23:
FIELD
State through Segment 2 ID
Action
Card Number
All Other Fields
CONTENTS
Same as Card 21
NEDS Action
23
Blanks
EIS AREA SOURCE RECORDS
Table 5.2-2 (cont.)
130
-------
A single set of NEDS Area Source records, can cause jmany EIS transaction
records to he generated. A set of EIS "ones" records are generated for
each, category- having at leas± one. fuel value. This Includes five 13
records, I.e., one for each, of the five pollutants. Then for each set
of "ones" records, a set of "two"records Is generated for each fuel value
within that category.
131
-------
5.2.1 ORGANIZATION
The program consists of the following routines:
o ROOT-SEGMENT - This Is the highest level routine. It performs the file
open and close functions and controls performance of the other routines,
i.e., the second level conversion routine is performed until the NEDS
Area Source input has been exhausted.
o CONVERT-NEDS-AREA-DATA - This is a second level routine which controls
reading of an Area Source set of records and the generation of EIS
transactions when a complete set has been read.
o READ-A-NEDS-CARD - This is a fourth level routine which reads a NEDS
Area record, logs it on the printer, moves the record into working
storage and sets the appropriate indicator.
o GEN-EIS-TRANS - This is a third level routine which initializes the
output records and controls processing of the zero, one and two EIS
records.
o GEN-ZERO-RECS - This is a fourth level routine which sets all values for
the EIS 01, 02 and 03 cards. It also causes the records to be output.
o GEN-ONE-RECS - This is a fourth level routine which sets all values for
the EIS 11, 12 and 13 records. Note 13 records are produced for each
of the five pollutants. Each record generated is caused to be written.
o GEN-TWO-RECS - This is a fourth level routine which sets all values for
the EIS 21, 22 and 23 records. Each record generated is caused to be
written.
o WRITE-ROUTINE - This is the lowest level routine. It logs the EIS
record on the printer and writes it to be processed in the next File
Maintenance step.
132
-------
Figure 5.2-1 illustrates the organization of the NEDS Area Source to EIS
component.
133
-------
NEDS Area Source to EIS Organization
Figure 5. 2-1
134
-------
5.2.2 COMMUNICATION AND DATA FORMATS
The NEDS Area Source to EIS Conversion program uses the following data
sets:
o NEDSFILE - This is the input file which contains the NEDS format Area
Source records.
o EISATRAN - This is the output file for the EIS format area source re-
cords .
o EISAERRS - This is the output file for logging input and output records.
The NEDS Area Source to EIS Conversion program uses the following communication/
data arrays:
o CARD-STORAGE-AREA - This is a working storage area. It is used for stor-
age of and describes the format of the NEDS Area Source records.
o TRANS-NN - This is a working storage area. It is used for storage of
and describes the format of the EIS records.
o AREA-INDICATORS - This array resides in working storage. The indicators
are used to designate presence of a NEDS Area Source record. There is
one indicator per NEDS record (5). Zero indicates no record present.
One indicates a record present.
o SET-REC-KEY-BUC - This is a working area for building a record key.
o PROCESS-TABLE - This is a Table of SCC's. There is a one to one rela-
tionship between the entries in this table and the fuel/pollutant values
in the NEDS Area Source records. The table is most critical to the
135
-------
conversion program. Though the codes were arbitrarily generated, they
have significance as follows:
SCC Format AAABBBCD
A - Corresponds to the category code (see Table 5.2-1)
B - Fuel/Pollution Source Code as follows:
Code Fuel
001 Anthracite Coal
002 Bituminous Coal
003 Distillate Oil
004 Residual Oil
005 Natural Gas
006 Wood
007 Coke
008 Process Gas
Oil Residential
012 Industrial
013 Commercial/Institutional
021 Light Vehicle
022 Heavy Vehicle
136
-------
Code Fuel
023 Off Hiway
024 Rail Locomotive
031 Military
032 Civil
033 Commercial
042 Diesel Oil
044 Gasoline
051 Solvent Purchased
052 Gasoline Marketed
061 Limited Access Roads
062 Rural Roads
063 Suburban Roads
064 Urban Roads
071 Dirt Roads Traveled
072 Dirt Air Strips
073 Construction Land Area
074 Rock Handling & Storing
081 Forest Fires
082 Slash Burning
083 Frost Control
084 Structure Fires
085 Coal Refuse Burning
137
-------
C - Sulfur Code as follows:
Code Fuel
0 No Sulfur
1 Use % Anthracite Coal
2 Use % Bitumous Coal
3 Use % Distillate Oil
4 Use % Residual Oil
D - Ash Code as follows:
Code Fuel
0 No Ash
1 Use % Anthracite Coal
2 Use % Bitumous Coal
138
-------
5.2.3 ROUTINES
There are no major subroutines in this program.
139
-------
6.0 EMISSION FACTORS PROGRAMS
There are three EIS programs to.facilitate the creation, maintenance and use
of the emissions factors tables. These are the Emissions Factors Table Gen-
erator, Emission Factors Transaction Generator and Emission Factors Insert
3
programs.
140
-------
6.1 MISSION FACTORS TABLE GENERATOR
The Emission Factors Table Generator component creates a two page (two
physical records) emission factors table from an input data set containing
SCC numbers and emission factor values. The first pago of the table, the
SCC index page contains an entry for each type 1 card in the input data
set. The type 1 card contains the SCC number, the effective date of the
SCC and the ash and/or sulfur percentages associated with this SCC. Two
additional items generated by this component are added to each SCC index
entry. They are the number of emiosion factor values assigned to the SCC
and an index pointer to their location in the emission factor value paga.
The second page of the table, the emission factor value page contains an
entry for each type 2 card in the input data set. The type 2 card contains
the SCC number to which this emission factor value is assigned, a pollution
identification number, the emission factor value and two code values, the
units of measure code and the ash/sulfur indicator code.
The generated table has a capacity of 800 SCC numbers and 1200 emission
factor values. There may be up to 16 emission factor values for an individual
SCC.
141
-------
6.1.1 ORGANIZATION
The Emission Factors Table Generator component is organized as a control seg-
ment with, two subordinate routines, the read cards routine and the build table
routine. Since the control segment contains a SORT statement, linkage to the
subordinate routines is accomplished internally by the SORT statement. The two
subordinate routines are COBOL sections, the read cards routine is the SORT
input procedure and the build table routine is the SORT output procedure.
o CONTROL-SEGMENT - Opens the data sets required by the component and gives
control to the SORT statement. The SORT statement in turn passes control
to the read cards routine, performs the SORT and then passes control to
the build table routine. The control segment then closes the data sets
and terminates the run.
o READ-CARDS - Reads a card from the input data set, checks the card for
correct content and type and then gives the card to SORT.
o BUILD-TABLE - Reads a card from the sorted data set, identifies it as
to type and builds the appropriate table entry. When the last entry is
processed the emission factors table is written on the output data set.
Figure 6.1-1 illustrates the organization of the Emission Factors Table
Generator component. .
142
-------
Emission Factors Table Generator Organization
Figure 6. 1-1
143
-------
6.1.2 COMMUNICATION AND DATA FORMATS
The following defines the usage of certain working storage names:
o EOFSW - May contain TRUE or FALSE. If true a data set end-of-file has
been detected.
o ERRSW - May contain a TRUE or FALSE. If true an error has been detected
during the read cards routine processing.
o FRDSW - May contain a TRUE or FALSE. If true the first SCC index entry
is not to be moved until the number of emission factor values has been
determined.
o EMFI-INDEX - Contains a count of type 1 cards read during the read cards
routine and the subscript of the next SCC index entry during the build
table routine.
o EMFT-INDEX - Contains a count of type 2 cards read during the read cards
routine and the subscript of the next EMF table entry during the build
table routine.
-------
6.1.3 ROUTINES
The following suBroutfUes are part of the READ^EMISSIDN-FACTORS main
routine.
o READ-EMISSION-FACTORS-CARDS SECTION - This paragraph defines the begin-
ning of the SORT input procedure section which receives control from
the SORT statement. Initialization is performed and paragraph PROCESS-
EMF-CARDS is performed until an end-of-file is detected on the input
data set. When this occurs control is passed to EMISSION-FACTORS-
CARDS-END paragraph.
o PROCESS-EMF-CARDS - This paragraph reads a card from the input data
set, determines the card type and passes control to paragraph PROCESS-
CARD-INVALID-ERROR, PROCESS-CARD-TYPE1 or PROCESS-CARD-TYPE2.
0 PROCESS-CARD-INVALID-TYPE - This paragraph issues an error message
when an invalid card is detected.
o PROCESS-CARD-TYPE1 - This paragraph processes the SCC number card.
All fields of the SCC number card are checked for content and the
card is then released to COBOL sort. This paragraph issues an error
message for incorrect field content or when the SCC index table capa-
city is exceeded.
o PROCESS-CARD-TYPE2 - "his paragraph processes the emission factor
value card. All tie-Ids of this card are checked for content and the
card is then released to COBOL sort. This paragraph issues an error
message for incorrect field content or when emission factor value table
c ••> p P. c i ty is exceeded .
o FBOCSSS-E?F-CARDS-F,ND - This paragraph contains an EXIT statement only.
Its purpose is to return control to the PROCESS-EMF-CARDS paragraph.
145
-------
o ERROR-ROUTINE - This paragraph- writes an error message on the list/error
data set. An error flag is turned on upon entry to this paragraph.
o EMISSION-FACTORS-CARDS-END - This paragraph contains an EXIT statement
only. Its purpose is to pass control back to the SORT statement when
an end-of-file is detected on the input data set. It indicates to SORT
that the input procedure is completed and the actual sort can be per-
formed.
The following subroutines are part of the BUILD-EMISSION-FACTORS-TABLE main
routine.
o BUILD-EMISSION-FACTORS-TABLE SECTION - This paragraph defines the be-
ginning of the output procedure section which receives control from SORT
statement after the actual sort has been performed. If an error was
detected in the input procedure, the emission factors table is not con-
structed and the run is terminated. This paragraph performs output
initialization and paragraph BUILD-TABLE-ENTRIES is performed until an
end-of-file is detected on the sorted data set. When this occurs con-
trol is passed to paragraph OUTPUT-EMISSION-FACTORS-TABLE.
o BUILD-TABLE-ENTRIES - This paragraph reads a card from the sorted data
set by means of the RETURN statement. The card type is determined and
control is passed to either paragraph BUILD-INDEX-ENTRY or BUILD-TABLE-
ENTRY.
o BUILD-INDEX-ENTRY - This paragraph converts the SCC number card field
content to table format and puts the entry into the next available index
entry table position.
o BUILD-TABLE-ENTRIES-END - This paragraph contains an EXIT statement only.
Its purpose is to pass control back to the BUILD-TABLE-ENTRIES paragraph.
146
-------
o OUTPUT-EMISSION-FACTORS-TABLE - This paragraph, moves the two table pages
from working storage to an output buffer and then writes the table pages
on the output table data set. Paragraphs OUTPUT-INDEX-ENTRY and OUTPUT-
TABLE-ENTRY are performed to list the contents of the two table pages.
o OUTPUT-INDEX-ENTRY - This paragraph lists all the entries in the SCC
index table page.
o OUTPUT-TABLE-ENTRY - This paragraph lists all the entries in the emission
factor value table page.
o ERROR-ROUTINE-1 - This paragraph writes an error message on the list/
error data set.
o EMISSION-FACTORS-TABLE-END - This paragraph contains an EXIT statement
only. Its purpose is to pass control back to the SORT statement when
an end-of-file is detected on the sorted data set. It indicates to SORT
that the output procedure is completed.
Figures 6.1-2 and 6.1-3 illustrate the organization of the Emission Factors
Table Generator routines.
147
-------
Emission Factors Table Generator Routine
READ-EMISSION-F ACTORS
Figure 6. 1-2
148
-------
Emission Factors Table Generator Routine
BUILD-EMISSION-FACTORS-TABLE
Figure 6. 1-3
149
-------
6.2 EMISSION FACTORS TRANSACTION GENERATOR
The Emission Factors Transaction Generator component reads all the logical
records of an existing data set and examines each type 2 record in each logical
record. The SCC number in each type 2 record is the argument of an emission
factors table search. If the table contains a corresponding SCC number and the
date of the table SCC is equal to or greater than the user specified date,
emission factor values will be inserted into this particular type 2 record.
If any type 2 record in this particular logical record had emission factor values
inserted, then transactions will be generated to update this logical record.
There are two forms of emission factor value insertion, an unconditional in«-
sertion Can A or X is specified by the user) or selective insertion (a T or
N is specified by the user).
In the unconditional insertion mode, all emission factor values associated
with the SCC number are inserted into the repetition fields of the type 2
record overlaying any existing ones. This operation may result in one or more
pollution identification numbers having no corresponding entry in the repeti-
tions of the type 1 record. In X mode, the pollution identification numbers
in the type 1 record are searched to insure that all pollution identification
numbers inserted in the type 2 record exist in the type 1 record. If not so,
then additional entries will be added to the type 1 record repetitions. In
the A mode, the type 1 record search is not performed.
In the selective insertion mode, each pollution identification number in the
type 2 record repetitions, is used to search for a corresponding pollution
identification number in the set of emission factor values associated with the
SCC number. If found the table emission factor value replaces the one in the
record repetition. In the N mode, this operation is performed for each type
2 record. In the T mode, this operation will be performed only if the EF-
SOURCE field of the type 2 record contains a T.
150
-------
6.2.1 ORGANIZATION
The Emission Factors Transaction Generator component is organized into four
routines, the. main routine, the get file logical record routine, the type
2 record processing routine and the output transactions routine.
o MAIN-ROUTINE - Opens the data sets required by the component, reads the
user parameter card, reads the emission factor table and processes the
data file until an end-of-file is detected. In processing the file,
the main routine passes control to the get file logical record routine.
When control returns to the main routine an indicator ADDSW is tested.
If on, control passes to the output transaction routine to generate and
output the transactions. If the indicator is off, the logical record
is skipped because emission factor value insertion did not occur. This
process repeats until end-of-file and then the main routine closes the
data sets and terminates the run.
o GET-FILE-LOGICAL-RECORD - Reads a logical record from the data file and
puts it in working storage. This routine passes control to the type 2
record processing routine if a type 2 record was read and the SCC num-
ber in it exists in the emission factors table.
o TYPE-2-RECORD-PROCESSING - Performs the emission factor value insertion
according to the user specified mode.
o OUTPUT-TRANSACTION - Generates EIS format transactions from the type 1
record and all its associated type 2 records of the logical record curr-
ently in working storage.
Figure 6.2-1 illustrates the organization of the Emissions Factors Transaction
Generator component.
151
-------
Emission Factors Transaction Generator Organization
Figure 6. 2-1
152
-------
6.2.2 COMMUNICATION AND DATA FORMATS
The following defines the usage of certain working storage names:
o ADDSW - May contain TRUE or FALSE. If true emission factors were
inserted into a type 2 record.
o CHGSW - May contain TRUE or FALSE. If true an entry was added to the
type 1 record repetitions.
o EOFSW - May contain TRUE or FALSE. If true, a data set end-of-file has
been detected.
o EXCSW - May contain TRUE or FALSE. If true, the number of entries added
to the type 1 record repetitions exceeded the maximum of 16.
o FNDSW - May contain TRUE or FALSE. If true an SCC number was found
in the emission factors table.
o FRDSW - May contain TRUE or FALSE. If true, the first physical record
read of the get logical record is not to be performed.
o LGLSW - May contain TRUE or FALSE. If true, the logical record may be
processed.
o LGLCSW - May contain TRUE or FALSE. If true, the logical record reading
process is complete.
o SCCSW - May contain TRUE or FALSE. If true, the SCC number was found
in the emission factors table and the SCC date test passed.
o T1RSW - May contain TRUE or FALSE. If true, the type 1 record repeti-
tion count has been initialized.
153
-------
o T2RSM - May contain a T, N, A or X. Contains the user specified emission
factor insertion mode of operation.
o RECOBD-EXPECTED - Contains the code of the next physical record that should
be read.
o RECORD-FOUND - Contains the code of the physical record that was just
read.
o ROUTINE-CODE-VALUES - Contains the sequencing control matrix for the get
file logical record routine. The RECORD-FOUND and RECORD-EXPECTED
codas determine the i,, entry of the matrix. This entry contains the
argument of a go to depending on statement to pass control to the
various paragraphs of the get file logical record routine.
o MASTER-TYPE-0 - Contains the type 0 record.
o MASTER-TYPE-1 - Contains the type 1 record.
o MASTER-TYPE-2 - Contains a single type 2 record.
o MASTER-TYPE-2-SAVE - Contains all the type 2 records belonging to this
logical record.
154
-------
6.2.3 ROUTINES
The following subroutines are part of the MAIN-ROUTINE.
o READ-DATE-CARD - This paragraph reads the card containing the SCC date
and insertion mode. A read error will terminate program operation.
o READ-EMISSION-FACTORS-TABLE - This paragraph reads the two pages of the
emission factors table. A read error will terminate program operation.
o PROCESS-DATA-FILE - This paragraph performs initialization and performs
paragraph PROCESS-FILE-LOGICAL-RECORD until an end-of-file is detected
on the data file.
o STOP-RUN - This paragraph closes the data sets and terminates program
operation.
o PROCESS-FILE-LOGICAL-RECORD - This paragraph reads a logical record
from the data file and tests if any emission factor insertion was per-
formed. If so, control passes to the output transaction routine to
generate transactions.
The following subroutines are part of the GET-FILE-LOGICAL-RECORD main rou-
tine:
o GET-RECORD - This paragraph reads a physical record from the data file
and sets a code in RECORD-FOUND indicating the record type.
o GET-LOGICAL-RECORD - This paragraph receives control from the control
segment when a logical record is to be read. It sets LGLCSW false and
performs paragraph LGL-RECORD until LGLCSW is set true.
o LGL-RECORD - This paragraph provides the control logic to read physical
records and assemble them into a logical record. This paragraph performs
155
-------
GET-RECORD and then one.of the following five paragraphs to process
the. physical record just read. Paragraph. GET-RECORD is not performed
upon ftrst entry- since the. physical record Is already In the buffer.
This record was read 5y- tEe previous get logical record request.
o LGL-RECORD-ERROR - This paragraph, is entered when a file sequencing
error has been detected. It issues an error message and terminates
the run.
o LGL-RECORD-TYPE0 - This paragraph, is entered when a type 0 record
has been read. It moves the record to working storage.
o LGL-RECORD-TYPE1 - This paragraph is entered when a type 1 record
has been read. It moves the record to working storage and sets up
for the type 2 record reading.
o LGL-RECORD-TYPE2 - This paragraph is entered when a type 2 record
has been read. It counts the number of type 2 records read and moves
the record to working storage. Paragraph SCC-SEARCH is performed to
determine if the SCC number is in the emission factors table. If so,
control is passed to the type 2 record processing routine to perform
the specified emission factors insertion. The record is then moved
to the save all type 2 records area of working storage.
o LGL-RECORD-COMPLETE - This paragraph is entered when the record just
read belongs to the next logical record. The LGLCSW, LGLSW and FRDSW
are set true.
o LGL-RECORD-INCOMPLETE - This paragraph is entered when an end-of-file
has been detected on the data file and the logical record in working
storage is incomplete. The LGLCSW is set true and LGLSW is set false.
o LGL-RECORD-END - This paragraph contains an exit statement only. Its
purpose is to pass control back to the GET-LOGICAL-RECORD paragraph.
156
-------
The following subroutines are part of the TYPE-2-RECORD-PROCESSING main routine:
o T2RECORD-PROCESSING - This paragraph is the control routine for the type
2 record processing. It examines the user specified mode and performs
one or more of the following paragraphs.
o SCC-SEARCH - This paragraph does a binary search of the SCC index entries
in the first page of the emission factors table. The SCC number from the
type 2 record is used as the search argument. If found and the date
check passes, the index entry is saved and the ash and/or sulfur percen-
tage values are inserted into the corresponding fields of the type 2
record.
o POLID-SEARCH-T2RECORD - This paragraph cycles through the pollutant iden-
tification numbers in the repetitions portion of the type 2 record.
This paragraph is used in conjunction with POLID-SEARCH-EMF-TABLE para-
graph to determine if the pollutant identification number in the type 2
record is in the emission factors table.
o POLID-SEARCH-EMF-TABLE - This paragraph searches the emission factors
table to determine if a specified pollutant identification number is
in the table.
o EMISSION-FACTORS-INSERTION - This paragraph converts an emission factor
value entry to the transaction form and inserts it into a specified
repetition of the type 2 record.
o POLID-INSERTION-T2RECORD - This paragraph replaces all existing emission
factor values in the type 2 record repetitions with the emission fac-
tor values from the emission factors table.
o POLID-SEARCH-T1RECORD - This paragraph examines all the pollutant iden-
tification numbers in the type 2 record and determines if a pollutant
identification entry must be created as a new type 1 record repetition.
157
-------
The following subroutines are part of the. OUTPUT-TRANSACTIONS main routine:
o OUTPUT-TYPE1-TRANSACTIONS - This paragraph formats and outputs the
EIS 11 and 12 transactions.
o OUTPUT-TYPE13-TRANSACTIONS - This paragraph formats and outputs the EIS
13 transactions.
o OUTPUT-TYPE2-TRANSACTIONS - This paragraph formats and outputs the
EIS 21 and 22 transactions.
o OUTPUT-TYPE23-TRANSACTIONS - This paragraph formats and outputs the EIS
23 transactions.
Figures 6.2-2 through 6.2-4 illustrate the organization of the Emission Fac-
tors Transaction Generator routines.
158
-------
RECORD-TYPES
PROCESS TYPE 2
RECORD
COMPLETE
INDICATE
COMPLETE
LOGICAL RECORD
SCC-SEARCH
SEARCH TABLE
FOR SCC NUMBER
TYPE2-RECORD
PROCESS THE
EMISSION FACTOR
VALUES
Emission Factors Transaction Generator Routine
GET-FILE-LOGICAL-RECORD
Figure 6. 2-2
159
-------
T2-RECORD
DETERMINE MODE
OF INSERTION
EARCH
TYPE 2
POL ID
T2- INSERT ION
INSERT ALL
EMISSION
FACTORS
TI-SE
SEARCH
FOR P
Emission Factors Transaction Generator Routine
TYPE-2-RECORD-PROCESSING
Figure 6. 2-3
160
-------
Emission Factors Transaction Generator Routine
OUTPUT-TRANSACTIONS
Figure 6. 2-4
161
-------
6.3 EMISSION FACTORS INSERT
The Emission Factors Insertion component reads an input data set containing
EIS format transactions, sorts the transactions in ascending key sequence and
where required inserts emission factor values into the 23 format transactions.
There are two forms of emission factor value insertion, an unconditional in-
sertion (an A in the EF-SOURCE field) or a selective insertion (a T in the
EF-SOURCE field). In the unconditional insertion mode, all emission factor
values associated with the SCC number will be inserted into the output data
stream, one emission factor value for each 23 transaction. In the selective
insertion mode, the pollution identification number in the 23 transaction
is used to search all the emission factor values associated with the SCC num-
ber. If a corresponding pollution identification number is found, its emis-
sion factor value will be inserted into the 23 transaction.
162
-------
6.3.1 ORGANIZATION
The Emission Factors Insertion component is organized as a control segment with
two subordinate routines, the read transaction routine and the write transac-
tion routine. The control segment contains a SORT statement which provides
the Internal linkage to the subordinate routines. The subordinate routines
are COBOL sections, the read transaction routine Is the SORT input procedure
and the write transaction routine Is the SORT output procedure.
o CONTROL-SEGMENT - Opens the data sets required by the component and gives
control to the SORT statement. The SORT statement in turn passes control
to the read transaction routine, performs the sort and then passes con-
trol to the write transaction routine. After all transactions have been
written on the output data set, the control segment closes the data sets
and terminates the run.
o READ-TRANSACTION - Reads a transaction from the input data set, assigns it
a type code, extracts certain transaction fields to build the sortkey
and then gives the transaction with its attached sortkey to sort.
o WRITE-TRANSACTION - Reads a transaction from the sorted data set, deter-
mines the transaction type and inserts emission factors where required.
Figure 6.3-1 illustrates the organization of the Emission Factors Insert com-
ponent .
163
-------
Emission Factors Insert Organization
Figure 6.3-1
164
-------
6.3.2 COMMUNICATION AND DATA FORMATS
The following defines the usage of certain working storage names:
o EOFSW - May contain TRUE or FALSE. If true, a data set end-of-file has
been detected.
o FNDSW - May contain TRUE or FALSE. If true the SCC number was found in
the emission factors table.
o WORK-RECORD-KEY - Contains the key from the type 21 transaction. Sub-
sequent 22 and 23 transactions must have the same key. If not this field
is set to blanks.
165
-------
6.3.3 ROUTINES
i
The following subroutines are part of the. INPUT-TRANSACTION main routine:
o PROCESS-INPUT-TRANSACTIONS SECTION - This paragraph defines the be-
ginning of the SORT input procedure section which recieves control from
the SORT statement. This paragraph will perform paragraph PROCESS-
INPUT-CARDS until an end-of-file is detected on the input transaction
data set.
o PROCESS-INPUT-CARDS - This paragraph reads a transaction from the input
transaction data set, identifies the transaction type and builds the
sortkey for this transaction. The transaction with the attached sort-
key is released to COBOL SORT by means of the RELEASE statement.
o PROCESS-INPUT-CARDS-EOF - This paragraph is entered when an end-of-file
is detected on the input transaction data set. An end-of-file type
transaction is created and released to COBOL SORT. This transaction
is used to stop the output routine processing.
o PROCESS-INPUT-TRANSACTION-END - This paragraph contains an EXIT statement
only. Its purpose is to pass control back to COBOL sort.
The following subroutines are part of the WRITE-TRANSACTION main routine:
o PROCESS-OUTPUT-TRANSACTIONS SECTION - This paragraph defines the beginning
of the SORT output procedure section which receives control from the^ SORT
statement after the actual sort has been performed. Initialization is
performed and the emission factors table is read. Program termination
will occur if the emission factors table read was in error. Paragraph
PROCESS-OUTPUT-CARDS is performed until an end-of-file is detected on the
sorted data set.
-------
PROCESS-OUTPUT-CARDS - This paragraph, reads a transaction from the sorted
data set and passes control to one of the following five paragraphs
depending on the transaction type. At end-of-file, control is passed
to the PROCESS-OUTPUT-TRANS-END paragraph.
PROCESS-INVALID-CARD - This paragraph outputs an error message for
an invalid type of transaction.
PROCESS-SKIP-CARD - This paragraph writes the transaction on the output
transaction data set. All transactions other than the 21, 22 and 23
are processed by this paragraph.
PROCESS-21-CARD - This paragraph moves the 21 transaction to working
storage, saves the transaction key and converts the SCC number to internal
format.
PROCESS-22-CARD - This paragraph moves the 22 transaction to working
storage and examines the transaction key and the code in the EF-SOURCE
field. If correct an SCC search is performed.
PROCESS-23-CARD - This paragraph moves the 23 transaction to working
storage. If the SCC search was successful and EF-SOURCE contains a T,
paragraph EMISSION-FACTORS-INSERTION is performed. If an A, paragraph
POLID-INSERTION is performed. If neither T nor A nor the key check failed,
the 23 transaction is written on the output transaction data set.
PROCESS-OUTPUT-CARDS-END - This paragraph contains an EXIT statement
only. Its purpose is to pass control back to the PROCESS-OUTPUT-TRANS-
ACTIONS paragraph.
SCC-SEARCH - This paragraph does a binary search of the SCC index entries
in the first page of the emission factors table. The SCC number from
the 21 transaction is used as the search argument. If found, the index
entry is saved and the ash and/or sulfur percentage values in the index
entry is inserted into the corresponding fields of the 21 transaction
if those fields are zero.
167
-------
o EMISSION-FACTORS-INSERTION - This paragraph cycles through the pollutant
identification numbers in the 23 transaction. If non-zero, paragraph
POLID-SEARCR is performed to find the corresponding emission factor
value. If found, the value is inserted into the 23 transaction.
o POLID-SEARCH - This paragraph searches for the emission factor values
associated with an SCC number.
o POLID-INSERTION - This paragraph inserts an emission factor value into
a 23 transaction and writes the transaction on the output transaction
data set.
Figures 6.3-2 and 6.3-3 illustrate the organization of the Emission Factors
Insert routines.
168
-------
Emission Factors Insert Routine INPUT-TRANSACTION
Figure 6.3-2
169
-------
Emission Factors Insert Routine WRITE-TRANSACTION
Figure 6.3-3
170
------- |