Docstoc

A Multimedia Waste Reduction Management System ... - P2 InfoHouse

Document Sample
A Multimedia Waste Reduction Management System ... - P2 InfoHouse Powered By Docstoc
					3ESEARCH         TRIANGLE              INSTITUTE


                                                                       April 1993



                        A MULTIMEDIA WASTE REDUCTION
                              MANAGEMENT SYSTEM FOR
                         THE STATE OF NORTH CAROLINA

                                                                FINAL REPORT



                                                                       Prepared for

                                            North Carolina Department of Health,
                                            Environment, and Natural Resources
                                                   Pollution Prevention Program


                                                                       Prepared by

                                                        Research Triangle Institute
                                                 Center for Environmental Analysis




'OST OFFICE BOX 12194   RESEARCH TRIANGLE PARK,              NORTH CAROLINA   27709-2194
                              Printed nn r e m ~ i n d
                                                     n9n-r
RTI Report Number                                                         State of North Carolina
5270-000-01F                                                               Contract No. C-28026




                    A MULTIMEDIA WASTE REDUCTION
                       MANAGEMENT SYSTEM FOR
                     THE STATE OF NORTH CAROLINA
                                             FINAL

                                           April 1993



                                            Prepared for
                               North Carolina Department of Health,
                               Environment, and Natural Resources
                                   Pollution Prevention Program
                                         3825 Barrett Drive
                                        Raleigh, NC 2761 1



                                           Prepared by

                                  Terrence K. Pierson, Ph.D.
                                        Anne E. Crook
                                      Donna S. Womack
                                              and
                                     Stephen M. Beaulieu
                                  Research Triangle Institute
                                        P.O. Box 12194
                               Research Triangle Park, NC 27709




Submitted by:                                             Approved by:



T.K. Pierson. Project Leader                              D.F. Naubie. Ddector
                                                          Center for Environmental Analysis
                                   ACKNOWLEDGEMENTS

    The authors would like to thank the staff of the North Carolina Pollution Prevention Program
                                                                          ay
who have worked with us on the development of the WRMS data base: G r Hunt, Sharon Johnson,
Ron Pridgeon, Stephanie Richardson, and David Williams; their assistance and ideas were invaluable.
We would also like to thank Patrick Graham of RTI for his assistance in developing the relative
toxicity indexing scheme.
                      A MULTIMEDIA WASTE REDUCTION MANAGEMENT
                        SYSTEM FOR THE STATE OF NORTH CAROLINA

                                          EXECUTIVE SUMMARY


    The North Carolina Pollution Prevention Program (NCPPP) is committed to multimedia waste
reduction. To enhance their efforts, NCPPP initiated a project to integrate information on air emissions,
water discharges, toxic chemical releases, and generation of hazardous waste. Under this project,
Research Triangle Institute @TI) developed a multimedia waste reduction management system (WRMS)
that maintains environmental release data collected and maintained by various State and Federal agencies.
Additionally, a relative toxicity indexing scheme was developed and incorporated into the data base to
assist in evaluating the relative risk posed by toxic chemical releases. The WRMS data base will serve as
a useful tool to NCPPP in identifying pollution prevention opportunities, targeting State resources, and
tracking pollution prevention progress in the State.


    The following provides an overview o the content and potential uses of the WRMS data base. A
                                       f
detailed discussion of the development and utility of the data base is provided in a separate document, A
Multimedia Waste Reduction Management System for the State of North Carolina. The Waste Reduction
Management System User's Guide provides detailed information on how to use the data base.


    WRMS was implemented as a relational data base that integrates several years of existing multimedia
release data collected in response to Federal and State reporting requirements. The data maintained in
WRMS include facility information, quantities of pollutants @e., toxic chemicals, hazardous wastes,
conventional water pollutants, and criteria a r pollutants) released to all media, production indexes, and
                                             i
information on waste minimization. Theses data were extracted from several data sources. The Toxic
Release InventoIy (TRIS)was selected as the primary data source since it is the most comprehensive
multimedia release data source available. To provide information on releases of other pollutants (Le.,
other than toxic chemicals) the following data bases were selected as secondary sources: the North
Carolina Annual Report on Hazardous Wse Data Base; the National Pollutant Discharge Elimination
                                     at
System (NPDES) Data Base; the Municipal/Indusmal Pretreatment Monitoring Data Base; and the Air
Quality National Emissions Data System (NEDS).'



             These data will be incorporated into EPA's Aerometric Information Retrieval System (AIRS) in future
             years, but were not available from AIRS for the years covered (1987 to 1990).
    To provide the user with the ability to compare risks associated with toxic chemical releases, a
relative toxicity indexing scheme was developed and incorporated into the WRMS data base. The relative
toxicity indexing scheme consists of two distinct pats: (1) a relative toxicity index provides a quantitative
scale to evaluate the relative acute, chronic, and ecological toxicity of constituents; and (2) an
environmental mobility and persistence scoring system provides an environmental mod8k.r to evaluate the
relative hazard associated with air, water, and s i releases.
                                                 ol
                                                                                                                         -
    The WRMS data base maintains data that are useful for characterizing releases of pollutants to all
media. Through the use of these characterizations, NCPPP will be able to idenufy areas (e.& facilities,
indusmes, and geographical regions) with the greatest potential to reduce toxic chemical releases,
hazardous waste generation, conventional water pollutant discharges, and criteria air pollutant emissions.
Consequently, they will be able to develop strategic plans that will allow them t concentrate their efforts
                                                                                 o
on developing comprehensive pollution prevention options specitk to these areas, thus maximizing the
benefits from their efforts.


    Additionally, the WRMS data base will serve as a valuable tool for evaluating pollution prevention
progress in the State. The data base maintains several years of pollutant release data. By establishing a
baseline year and analyzing data maintained for subsequent years, NCPPP will be able to identify release
trends over time. These trends will provide them with an indirect measurement of pollution prevention
progress in the State2


   WRMS can also serve as a prototype data base for other state and federal agencies to develop their
own data bases. WRMS provides a basic structure for a multimedia environmental release data base that
draws on readily available idonnation from existing State and Federal reporting requirements. By
developing similar data bases, these agencies will be enhancing their abilities to establish and achieve
pollution prevention goals.




             It should be noted that adequate data for establishing direct cause and effect relationships between
             pollution prevention activities and pollutant releases are currently not available. However, results from
             trend analyses can be used cautiously to provide an indirect measurements of pollution prevention
             progress.
                                                       TABLE OF CONTENTS

                                                                                                                                      @gg
1.0INTRODUCTION ........................................................                                                                1-1
  1.1 BACKGROUND ........................................................                                                               1-1
  1.2 DOCUMENT OVERVIEW .................................................                                                               1-2

2.0 WRMS DATA BASE DEVELOPMENT                 ........................................      2-1
   2.1 RELEASE DATA SOURCES ...............................................                  2-1                                                .
   2.2 DATA BASE STRUCTURE ................................................                  2-7
   2.3 RELEASE DATA CONVERSION . . . . . . . . . . : ................................       2-12
      2.3.1 Toxic Release Inventory System (TRIS) ....................................      2-15
      2.3.2 North Carolina Annual Report (NCAR) ....................................        2-20
      2.3.3 NPDES Permit Monitoring Data Base .....................................         2-22
      2.3.4 Municipal/lndushial Pretreatment Monitoring Data Base ........................  2-27
      2.3.5 National Emissions Data System (NEDS) ...................................       2-30
   2.4 RELATIVE INDEXJNG SCHEME FOR TOXICITY AND HAZARD . . . . . . . . . . . . . . . . . . 2-31
      2.4.1 Relative Toxicity Indices ..............................................        2-33
      2.4.2 Environmental Mobility and Persistence Scoring System ........................  2-38

3.0 WRMS DATA BASE MANAGEMENT                                 ........................................                                  3-1
   3.1 RELEASE DATA UPDATES ...............................................                                                             3-1
      3.1.1 Using the Conversion Program ...........................................                                                    3-2
      3.1.2 Toxic Release Inventory System (TRIS) .....................................                                                 3-5
      3.1.3 North Carolina AMWI Report (NCAR) ....................................                                                     3-11
      3.1.4 NPDES Permit Monitoring Data Base .....................................
      3.1.5 Municipal/Industrial Pretreatment Monitoring Data Base ........................
      3.1.6 National Emissions Data System (NEDS) ...................................
   3.2 RELATIVE TOXICITY AND HAZARD INDEXING SCHEME UPDATES . . . . . . . . . . . . . .
                                                                                                                                       3-13
                                                                                                                                       3-17
                                                                                                                                       3-19
                                                                                                                                       3-21
                                                                                                                                                -
                                                                                                                                                -

      3.2.1 Relative Toxicity Index Updates .........................................                                                  3-21
      3.2.2 Environmental Mobility and Persistence Score Updates .........................                                             3-22

4.0 USES AND LIMITATIONS OF WRMS                              ........................................                                  4-1
  4.1USESOFWRMS .......................................................                                                                 4-1
  4.2 LIMlTATIONS OF WRMS ................................................                                                              4-3
     4.2.1 Limitations Affecting Restriction .........................................                                                  4-3
     4.2.2 Limitations Affecting Ordering ...........................................                                                   4-3

5.0 POTENTIAL APPLICATION BY STATE AND FEDERAL AGENCIES                                                     . . . . . . . . . . . . . . . 5-1
   5.1 STATE AGENCIES ......................................................                                                            5-1
   5.2 FEDERAL AGENCIES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           5-2

REFERENCES            ..............................................................                                                   R-1

Appendix A. Data Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    A-1
Appendix B. Source Data File Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        B-1
Appendix C. Conversion Program Code ............................................                                                       C-1
Appendix D. Toxicity and Fate Data ...............................................                                                     D-1
Appendix E. Relative Indexing Scheme Program Code and File Structures ....................                                             E-1
Appendix F. Sample Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      F-1



                                                                                                                                      Page i
                                                 LIST OF TABLES

                                                                                                                  m
Table 2.1 . Indicator Data Used from TRIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Table 2.2 . Indicator Data Used from North Carolina Hazardous Waste Annual Report . . . . . 2-4                             -

Table 2.3 . Indicator Data Used from NPDES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          2-5
Table 2-4 . Indicator Data Used from Pretreatment Data Base . . . . . . . . . . . . . . . . . . . . . .               2-6
Table 2.5 . Indicator Data Used from NEDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         2-8
Table 2.6 . Summary of Data Included in W R M S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           2-9
Table 2.7 . File Structure for Facilify File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Table 2.8 . File Structure for Status File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Table 2.9 . File Structure for Chemical File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   2-11
Table 2.10 . File Structure. for Emission File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13
Table 2.11 . Fields Used in W R M S from TIUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      2-19
Table 2.12 . Fields Used in W R M S from NCAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        2-23
Table 2.13 . Fields Used in W R M S from NPDES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         2-26
Table 2.14 . Fields Used in W R M S from Pretreatment . . . . . . . . . . . . . . . . . . . . . . . . . . . .        2-29
Table 2.15 . Fields Used in WRMS from NEDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           2-32
Table 2.16 . Data Collection Guidelines for Toxicity Benchmarks ....................                                 2-36
Table 2.17 . Toxicity Benchmarks Used for Each Toxicity Index . . . . . . . . . . . . . . . . . . . .                2-39
Table 2.18 . Data Collection Guidelines for Fate and Transport Parameters . . . . . . . . . . . . . 2-43
Table 2.19 . Matrix for Evaluating Mobility and Persistence of TRI Consistuents . . . . . . . . . 2-44



                                                 LIST OF FIGURES

Figure 2.1 . WRMS Data Base Linkage Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Figure 3.1 . Data Entry Screen for Toxicity Benchmark Data (Benchmar.fmt) . . . . . . . . . . . . 3-23
Figure 3.2 . Data Entry Screen for Fate and Transport Data (Fate.fmt) . . . . . . . . . . . . . . . . .3-23




Page ii
                                        1.0 INTRODUCTION


    To support North Carolina in its pollution prevention efforts, Research Triangle Institute (RTI)
has developed a multimedia waste reduction management system (WRMS) for use in identifying
pollution prevention opportunities, targeting State resources, and tracking pollution prevention
progress in the State. W R M S is a relational data base that integrates existing multimedia
environmental release and waste generation data. The purpose of this report is to document the
development and management of WRMS and discuss the utility of W S .


1.1      BACKGROUND

    In 1984, North Carolina established a state-wide, multimedia waste reduction program. The lead
agency is the N o h Carolina Pollution Prevention Program (NCPPP). Activities and resources of
several additional agencies are also devoted to waste reduction. The coordinated activities of these
agencies have led to the development of a very strong and effective State effort for pollution
prevention.

     While considerable activity and State resources are available for source reduction and recycling,
it is the intent of the NCPPP to develop a more effective and targeted effort specific to multimedia
waste reduction across the State. The goal of such an effort is to integrate specific waste reduction
infomation for planning, managing, and evaluating reductions in air emissions, water discharges,
toxic releases and generation of hazardous waste. Therefore, NCPPP initiated a pollution prevention
demonstration project to develop a multimedia waste reduction management system (WRMS).

    The resulting data base maintains several years of data that were identified as relevant and useful
for identifying and assessing pollution prevention opportunities and activities. These data include
facility information, quantities of pollutants (i.e., toxic chemicals, hazardous wastes, conventional
water pollutants, and criteria air pollutants) released to all media, production indexes, and
information on waste minimization activities. In addition to these data, W R M S maintains relative
toxicity indices for each toxic chemical reported. These indices were developed based on a
constituent’s acute health effects, chronic health effects, and ecological toxicity. These indices used
in conjunction with release quantities can be used to assess the relative toxicity associated with each
toxic chemical release. The following paragraphs discuss some of the intended uses of WRMS.

    The WRMS data base maintains data that are useful for characterizing releases of pollutants to all
media. Through the use of these characterizations, NCPPP will be able identify areas (e.g.,
facilities, industries, and geographical regions) with the greatest potential to reduce toxic chemical
releases, hazardous waste generation, conventional water pollutant discharges, and criteria air
pollutant emissions. Consequently, they will be able to develop strategic plans that will allow them
to concentrate their efforts on developing comprehensive pollution prevention options specific to
these areas, thus maxknizig the benefits from their efforts.

    Additionally, WRMS will serve as a valuable tool for evaluating pollution prevention progress in
the State. The data base maintains several years of data on pollutant releases that have occurred in
the State over time. By establishing a baseline year and analyzing data maintained for subsequent


                                                                                              Page 1-1
years, NCPPP will be able to identify release trends over time. These trends wiU provide them with
an indirect measurement of pollution prevention progress in the State1.

    W R M S can also serve as a prototype data base for other state and federal agencies to develop
their own data bases. W R M S provides a basic structure for a multimedia environmental release data
base that draws on readily available information from existing state and federal reporting
requirements. By developing similar data bases, these agencies will be enhancing their abilities to
establish and achieve pollution prevention goals.


1.2        DOCUMENT OVERVIEW

    This report documents the development and management of a waste reduction management
system and discusses how WRMS can serve as a prototype data base to other state and federal
agencies. Section 2 provides a detailed discussion on the development of WRMS including release
data source review and data selection, data base structure development, release data conversion, and
relative toxicity indexing scheme development. Section 3 provides guidance on updating
environmental release data, hazardous waste generation data, and the WRMS relative toxicity
indexing scheme. A discussion of suggested uses and limitations of using WRMS is provided in
Section 4 Section 5 discusses how W R M S and multimedia environmental release data bases l i e
          .
W R M S can be used to support other state and federal agencies in their pollution prevention efforts.
Additionally, five appendices containing the following are attached data dictionary; source data
structure; conversion programs, relative toxicity indexing scheme spreadsheets; and sample outputs.




       '    It should be noted that adequate data for establishing direct cause and effect relationships between
            pollution prevention activities and pollutant releases axe currently n t available. However, results from
                                                                                  o
            trend analyses can be used cautiously to provide an indirect measurements of pollution prevention
            progress.



Page 1-2
                            2.0 WRMS DATA BASE DEVELOPMENT


    WRMS was implemented as a relational (multi-file) data base using dBase IV,version 1.5 on an
IBM-compatible PC. dBase was chosen because it is NCPPP's standard for data base software, and
is therefore the most accessible to NCPPP staff, and because it is commonly used by other State
government agencies as well as widely used by North Carolina industry.

    This section describes the development of the WRMS data base. Section 2.1 describes the data
sources used for release data incorporated in WRMS. Section 2.2 describes the structure of the
WRMS data base. Section 2.3 describes the process of converting release data from its native
structure to the WRMS structure. This section focuses on the conceptual aspects of data conversion;
Section 3.1, which describes how to perform future updates to the data base, focuses on the more
concrete aspects of data conversion. The reader wishing to follow the example of W R M S in
developing a similar data base will need to read both Sections 2.3 and 3.1 to get complete details of
how WRMS was developed. Section 2.4 describes the development of the relative toxicity indexing
scheme used to compare the toxicity of releases.


2.1 RELEASE DATA SOURCES

    WRMS was developed to characterize releases of pollutants (Le., toxic chemicals, hazardous
wastes, conventional water pollutants, and criteria air pollutants) to all media. These
characterizations wiU be useful to NCPPP in identifying and assessing pollution prevention
opportunities and activities in the State. To ensure that W R M S maintained sufficient data for
developing comprehensive multimedia release characterizations, numerous existing data sources were
reviewed. Based on analyses of each data source, a subset of parameters was identified as the most
relevant and useful for characterizing releases. Only these "indicator data" were extracted from the
data sources and integrated into WRMS. This section discusses the data sources and the data that
were included in WRMS.

   The Toxic Release Inventory System (TRIS) is the most comprehensive multimedia release data
base available. Therefore, NCPPP selected TRIS as the primary data source for WRMS. TRIS is
maintained by EPA and compiles data on over 300 toxic chemicals released to air, water, and land.
These data are collected under the statutory authority of the Superfund Amendments and
                                    I,
Reauthorization Act (SARA), Title I I Section 313. The facilities required to submit these data on
TRI Reporting Form R include those facilities that meet the following specifications:

   .    Classified as a manufacturer under the Standard Industrial Classification (SIC) system (i.e.
        SIC codes 20-39);

   .'   Employs 10 or more individuals; and

   .    Manufactures, processes, of uses a substance on the SARA Title 11 List of Lists in amounts
                                                                            1
        greater than specified threshold limits. In 1987, the threshold for manufactured and processed
        was 75,000 lbs; in 1988, 50,000 lbs.; and in 1989 and thereafter, 25,000 lbs. The threshold
        for otherwise used was 10,000 lbs. for all reporting years.


                                                                                               Page 2-1
Since TRIS is WRMS' primary data source, the population included in WRMS is limited to only
those NC facilities that are required to submit TRI data.

   As discussed above, only those data that were identified as most relevant and useful for
characterizing releases were extracted for inclusion in WRMS. Table 2-1 identifies the data that
were extracted from TFUS. Currently, WFWS maintains four years (1987-1990) of these data.

   Since TRIS only provides data on toxic chemical releases, additional "indicator data" were
needed to provide information on releases of other pollutants @e., other than toxic chemicals). To
provided these data the following were identified as secondary sources:

   -   North Carolina Annual Report (NCAR) Data Base;
   -   National Pollutant Discharge Elimination System (NPDES) Permit Monitoring Data Base;
   -   MunicipallIndustrial Pretreatment Monitoring Data Base; and
   -   Air Quality National Emissions Data System WEDS).

"Indicator data" from each of these sources were identified and integrated into WRMS. To avoid
double-counting and over-estimating releases, data that duplicated release information extracted from
another data source were not included in WRMS. The following paragraphs discuss these secondary
data sources and "indicator data" extracted from them for inclusion in WRMS.

   North Carolina Annual Report (NCAR) Data Base: Facilities that generate, store, treat, or
   dispose of hazardous waste are required by NC Rule 10 NCAC 10F .0037 to submit an annual
   report to the Hazardous Waste Section. Data collected under the statutory authority provided by
   this Rule are maintained in the NCAR data base. Three years (1988 - 1990) of these data were
   obtained and integrated into WRMS. NCAR data from 1987 were not used because of problems
   with data format and quality. The data used from this data base include facility location, SIC
   code, EPA identification number, waste quantity generated, quantity of waste treated on-site or
   shipped off-site, and information on the type of waste and waste minimization activities. Due to
   changing reporting requirements, not all these data were available for each year. Table 2-2
   identifies all the "indicator data" extracted from this data base.

   National Pollutant Discharge Elimination System (NPDES) Permit Monitoring Data Base: All
   NPDES-permitted facilities must comply with all monitoring and reporting requirements specified
   in NC Rule 15 NCAC 2B .0500. Data collected in response to these requirements are maintained
   in the NPDES data base. These data consist of monthly surface water discharge data for a
   variety of STORET parameters from NPDES-permitted facilities. The STORET parameters
   include physical parameters, such as flow and temperature; conventional pollutants, such as BOD
   and Total Suspended Solids; and many toxics. Four years of data (1987-1990) reported by major
   and minor industrial dischargers were downloaded and integrated into WRMS. Table 2-3
   identifies the "indicator data" extracted from this data base.

   Municipalhdustrial Pretreatment Monitoring Data Base: All permitted industrial facilities
   discharging into Publicly Owned Treatment Works (POTWs) must comply with reporting and
   monitoring requirements specified in NC Rule 15 NCAC 2B .0205. These data are compiled and
   maintained by the State in the Pretreatment data base. Data reported in 1987-1990 were
                                                                            hs
   downloaded and integrated into WRMS. The data fields extracted from t i data base are


Page 2-2
Table 2-1. Indicator Data Used from TRIS


 Data Description
 Document control number (identifies a specific Form R submission)
 Reporting year
 Facility name
 Facility location:
    Street address
    City
     county
    Zip code
    Latitude/longitude coordinates
 Facility contact person
 Contact telephone number
 SIC Codes (up to 4)
 TRI Facility ID
 EPA ID
 NPDES Permit Number
 Chemical name
 CAS Number
 Production index
 Waste quantity generated in current reporting year
 Waste quantity generated in previous reporting year
 Waste minimization activities
 Reasons for waste minimization activities
 Release medium:
     Stack a r
            i
     Fugitive air
     Water
     Land
     POW
     Transfer off-site
 Release quantity
 Basis of release estimate
 Estimate based on a reported range
 Receiving waterbody (for water releases)
 POTW name (for release to POTW)




                                                                     Page 2-3
   Table 2-2. Indicator Data Used from NC Annual Report on Hazardous Waste


    Data Description                                      Reporting Years
    Facility location county                              all
    EPA ID                                                all
    EPA Hazardous Waste code (1)                          1988
    EPA Hazardous waste codes (up to 4)                   1989 and 1990
    Waste description                                     1988
    Waste form code                                       1989 and 1990
    Waste source code                                     1989 and 1990
    Total quantity generated                              all
    Total quantity treated                                all
    Treatment code                                        all
    Total quantity shipped off-site                       311
    Production index                                      1989 and 1990
    Waste minimization activities (up to 4)               1989 and 1990
    Basis of quantity estimates                           1989 and 1990




Page 2-4
Table 2-3. Indicator Data Used from NPDES
                                            ~~~   ~




 Data Description

 NPDES Permit Number
 Facility name
 Facility location:
    Street address
    City
    county
    zip
    Latitudebongitude coordinates
 SIC code
 Pipe number
 Parameter (pollutant or flow) code
 Parameter (pollutant or flow) name
 Average flow
 Average concentration or emission
 Reporting units
 Number of momhs reported i these units
                              n




                                                      Page 2-5
    presented in Table 2 4 .

    Air Ouality National Emissions Data System WEDS): This data base compiles criteria air
    pollutant emissions information collected under the statutory authority of NC Rule 15A NCAC
    2H ,1105. As specified in Table 2-5, information extracted and integrated into WRMS includes
    data on stack air emissions of particulates, SO,, NO,, VOC and CO. Four years (1987-1990) of
    data were integrated into WRMS. These data were maintained by the State for the years
    currently incorporated in WRMS; in future years, these data will also be maintained in EPA's
    Aerometric Information Retrieval System (AIRS).

    In summary, WRMS compiles data that are extremely useful in characterizing toxic chemical,
hazardous waste, conventional water pollutant, and criteria air pollutant releases to all media. Table
2-6 identifies the WRMS data sources and the types of "indicator data" obtained from each source.
Additional information on the data sources and the conversion of "indicator data" into the WRMS
data base format is provided in Section 2.4.


2.2 DATA BASE STRUCTURE

    WRMS was implemented as a relational (multi-fide) data base using dBase IV. A relational data
base consists of multiple data fides, which are linked to each other using common fields. The
common fields are also called key fields when they uniquely identify a particular record in a file.
The identifiers used in key fields must be unique, with one value of the identifier uniquely
identifying one facility, etc., and universal, with the same type of identifier existing for all facilities,
etc., of interest.

   WRMS is composed of four main data fides. The following paragraphs describe the general
content and structure of each of these fides. Tables 2-7 through 2-10 show the field structure for
each fie. The WRMS Data Dictionary in Appendix A provides a detailed description of each field
and the types of values allowed.

    The Facility file contains facility information that does not change over time, such as location
information, or for which only the current information is of interest, such as facility identification
numbers or contact person. The Facility N e has one record per facility and is linked to other files
by the facility ID. The Facility file contains data on about 1,200 facilities. Table 2-7 lists the fields
included in the Facility file.

    The Sfatus fide contains facility-related information that may change over time and for which
historical information is of interest, such as the POTW to which the facility discharges pollutants.
Each record represents one facility for one year. The Status fide contains about 3,600 records. The
Status file is linked to other files by the facility ID and year. Table 2-8 shows the fields contained
in the Status fiie.

   The Chemical file contains the names and identifiers for pollutants (toxic chemicals, hazardous
wastes, conventional water pollutants, and criteria air pollutants) contained in W R M S . Each record
represents one pollutant. Information on about 4,000 chemicals, wastes, and other pollutants is
contained in Chemical. T h i s fiie also includes several relative toxicity indices for toxic chemicals.


Page 2-6
Table 2-4. Indicator Data Used from Pretreatment Data Base




    Reporting year
    Industrial User name (facility)
    P O W name
    P O W NPDES Permit Number
    P O W Pipe number
    P O W location:
       City
       Zip
    Industrial User number
    Facility location:
       Street
       City
       Zip
    SIC code
    Flow
    Concentration (for each pollutant requested)
       Biological Oxygen Demand
       Chemical Oxygen Demand
       Total suspended solids
       Oil
1      Total Kjeldahl nitrogen
1      NO3
       Total phosphorus
1      Chloride
1       i
       Tn
       Ammonia
       MBAS (surfactants)
'      Color
       Sulfide
       Fluoride




                                                             Page 2-1
  Table 2-5. Indicator Data Used from NEDS


    Data Description
                                             I
    Plant ID number
    Facility name
    Facility address
    County code
    Emissions (for each pollutant):
       Particulates
       so2
        O
       N;
       Volatile Organic Chemicals
       Carbon monoxide




Page 2-8
Table 2-6. Summary of Data Included i W R M S
                                    n

                                                           -
                                                           ~




                                                               _




                                                Page 2-9
  Table 2-7. File Structure for F A C I L N File


                                               Data
    Field Name                  Format         Sources     Data Element
    FAC-ID                      c10*                       Facility ID
    FAC-NAME                    C40            T           Facility name
    STREET-1                    C30            T           Street address, fist line
    STREET-2                    C30            T           Street address, second line
    CITY                        C15            T           Facility location city
    COUNTY                      c12            T           Facility location county
    ZIP                         c5             T           Facility location zip code
    CONTACT                     C30            T           Public contact name
    PHONE                       c10            T           Phone number
    SIC-1                       c4             T           First SIC Code
    SIC-2                       c4             T           Second SIC Code
    SIC-3                       c4             T           Third SIC Code
    EPA-ID                      c12            TS          EPA ID number
    NPDES                       c9             TN          NPDES permit number
    PRE-ID                      C13            P           Pretreatment source ID
    AIR-ID                      C8             A           Air quality ID number
    TRI-ID                      C15            T           TRI facility ID
    LAT                         c7             T           Latitude coordinate
    LONG                        c7             T           Longitude coordinate
    YEm-ADDED                   N4                                                   R
                                                           Year facility added to W IS
    CREATED                     D                          Date record created
    UPDATED                     D                          Date record last updated
    TEMP-ID                     c10                        Temporaq facility ID




  Format key:     C = Character (number indicates length), N =Numeric (numbers indicate total length and decimal
                  places), D = Date, L = Logical (YeslNo); * indicates key field.

  Data sources:   T = TRIS. S = State (NC) Annual Report. N = NPDES, P = Pretreatment, A = AIRSINEDS



Page 2-10
Table 2-8. File Structure for STATUS File
                 _          _   ~~~    ~         ~~                ~~




                                             Data
  Field Name                  Format         Sources     Data Element
  FAC-ID                      c10*                       Facility ID
  YEAR                        N4*                        Reporting year
  RECEIV-H20                  C25            TN          Receiving waterbody name
  POTW                        C30            TP          P O W name




Table 2-9. File Structure for CHEMICAL Pile


                                             Data
  Field Name                  Format         Sources     Data Element
  CHEM-ID                     c10*                       Chemical ID
  CAS-NUM                     c11            TNPA        CAS number
  WASTE-CODE                  C16            S           RCRA waste code(s)
  FORM-CODE                   c4             S           RCRA waste physical form code
  SRCE-CODE                   c3             S           RCRA waste source code
  STORET-NUM                  CS             N           STORET parameter code
  USE-NAME                    C60            TSNP        Common chemical name or waste description
  CAS-N AME                   C50            T           CAS Registry name
  CHRONIC                     N19.4                      Chronic relative toxicity index
  ACUTE                       N19.4                      Acute relative toxicity index
  ECOLOGICAL                  N19.4                      Ecological relative toxicity index




                                                                                                                -




Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places). D = Date, L = Logical (YeslNoJ;* indicates keyjield.

Data sources: T = TRIS, S = State (NC) Annual Repoit, N = NPDES, P = Pretreatment, A = MRSNEDS




                                                                                                    Page 2-11
These indices are described in Section 2.4. The Chemical fide is linked to other fides by the chemical
ID. The fields included in the Chemical fide are listed in Table 2-9.

    The Emission fide is the core of WFWS. It contains annual emissions data for all media as well
as data on annual pollutant quantities treated or disposed on-site, sent off-site for treatment or
disposal, or released to a P O W . Data on waste minimization activities and production levels are
also included, although these data are not reported by a l facilities. Each record represents emissions
                                                        l
of one pollutant from one facility in one year, and each record contains data from only one data
source. The Emission fide contains over 24,000 records. The Emission file is linked to other files by
the facility ID, chemical ID, and year. The fields contained in the Emission file are shown in Table
2-10.

    The linkages between the four main W R M S data base files are shown in Figure 2-1. Each line in
the figure represents a link that can be made using dBase queries. The type of link, such as one-to-
one or one-to-many, and the key field or fields used to implement the link are shown in Figure 1
beside each line. As mentioned before, the key fields must contain a unique and universal identifier.
No such identifier existed for facilities or pollutants; for example, the CAS number is not universal,
because certain groups of chemicals reported under TRI have no CAS number, not does it apply to
hazardous wastes or conventional water pollutants or criteria air pollutants. Similarly, a number of
unique identifiers exist for facilities, such as EPA ID and "DES permit number, but none are
universal to all facilities of interest. Therefore, unique codes for all facilities and pollutants in
W R M S were created and assigned as needed. These codes are described in more detail in the
W R M S Data Dictionary in Appendix A.

2.3 RELEASE DATA CONVERSION

   The W      S data base was designed to consolidate selected "indicator data" from the following
sources (see Section 2.1 for a discussion of "indicator data"):

        Toxic Release Inventory System (TRIS)
        North Carolina Annual Report (NCAR)
        NPDES Permit Monitoring Data Base
        Municipalhdusuial Pretreatment Monitoring Data Base
    *   Air Quality National Emissions Data System (NEDS)

As discussed in Section 2.1, TRIS is the primary data source, and the others are secondary data
sources used to supplement TRIS.

    Naturally, each of these data sources had a different format; therefore, some manipulation of the
data had to be done to convert the data into a common format. This common format consisted of
four main data fides: Facility, for facility data; Chemical, for chemical and pollutant data; Emission,
for emissions data; and Status, for data on receiving waterbodies and POTWs. The WRMS format is
described in Section 2.2. Because the format of each data source was different, the conversion
process was different for each; however, they did have some features in common. These are
described below.



Page 2-12
Table 2-10. File Structure for EMISSION File


(I                                            Data
  Field Name                  Format          Sources     Data Element
  FAC-ID                      c10*                        Facility ID
  CHEM-ID                     c10*                        Chemical ID
  YEAR                        N4*                         Reporting year
  SOURCE                      c1*                         Data source
  SOURCE-ID                   C18            TSNPA        Data source record identifier
  FUGIT-AMT                   N7             T            Fugitive emissions
  FUGIT-B AS                  c1             T            Basis of fugitive emissions estimate
  FUGITRNGE                   L              T            Fugitive emissions range flag
  STACK-AMT                   N7             TA           Stack emissions
  STACK-BAS                   c1             TA           Basis of stack emissions estimate
  STACK-RNGE                  L              T            Stack emissions range flag
  WATER-AMT                   N8             TN           Water emissions
  WATER-B AS                  c1             TN           Basis of water emissions estimate
  WATER-RNGE                  L              T            Water emissions range flag
  LAND-AMT                    N7             T            Land emissions
  LAND-B AS                   c1             T            Basis of land emissions estimate
  LAM-RNGE                    L              T            Land emissions range flag
  POTW-AMT                    N10            TP           POTW emissions
  POTW-BAS                    c1             TP           Basis of POTW emissions estimate
  POTW-RNGE                   L              T            POTW emissions range flag
  OFF-AMT                     N10            TS           Amount sent off-site
  OFF-BAS                     c1             TS           Basis of off-site estimate
  OFF-RNGE                    L              T            Off-site range flag
  ON-AMT                      N10            S            Amount of waste treated or disposed on-site
  ON-BAS                      c1             S            Basis of on-site estimate
  CURR-AMT                    N10            TS           Amount of waste generated in current year
  PREV-AMT                    N10            T            Amount of waste generated in previous year
  PCI'-CHANGE                 N4.2           T            Percent change in amount of waste generated
  PROD-NDX                    N7.4           TS           Production index
  WASTE-MIN                   c2
                               1             T            Waste minimization activity
  MIN-REASON                  c2             T            Reason for waste minimization activity




Format key:     C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
                places), D = Date, L = Logical (YeslNo); * indicates keyfield.

Data sources:                          Annual Repon. N = NPDES, P = Pretreatment, A = AIRSINEDS
                T = TRIS, S = State (NC)



                                                                                                      Page 2-13
                 c
                     1

                                  -
                             fac-id

                                    -                   N

                                                        N
                                                            >   FAC-ID
                                                                CHEM-ID
                                                                YEAR
                                                                SOURCE
                                                                SOURCE-ID
                                                                                     chemid
                                                                                     N       1
                                                                                                  ~
                                                                                                           .. .. .. .... . . .




                                                                                                      CHEM-ID
                                                                                                      CAS-NUM
                                                                                                      WASTE-CODE
                                                                                                      FORM-CODE
                                                                FUGIT-AMT                             SRCE-CODE
                                                                FUGIT-BAS                             STORET-NUM
                                                                FUGIT-RNGE                            USE-NAME
                                                                STACK-AMT                             CAS-NAME
                                                                STACK-BAS                             AIR-CHR
                                                                STACK-RNGE                            AIR-ACUTE
                                                                WATER-AMT                             SOIL-CHR
                                                                WATER-BAS                             SOIL-ACUTE
                                                                WATER-RNGE                            WAT-CHR
                                                                LAND-AMT                              WAT-ACUTE
                                                                LAND-BAS                              WAT-ECO
                                                                LAND-RNGE                             AIR-MOB
                                      fac-id       + year                                             AIR-PER
                                                                POW-AMT




                                                                                                      -
                                                                POTW-BAS                              SOIL-MOB
                                                                POW-RNGE                              SOIL-PER
                                                                OFF-AMT                               WAT-MOB
                                                                OFF-BAS                               WAT PER
                                                                OFF-RNGE
                                                                ON-AMT
                                                                ON-BAS
                                                                CURR-AMT
                                                                PREV-AMT
                                                                PCT-CHANGE
                                                                PROD-NDX
                                                                WASTE-M IN
                                                                MIN REASON


                 f-  --
                   1


                                        Legend:
                                               chem-id
                                                                one-to-many relationship, linked on chemjd
                                               1            N   l=one
                                                                N = many




Figure 2-1. WRMS Data Base Linkage Diagram

Page 2-14
    All of the source data used were available in electronic format. Therefore, the fist step for all
data sources was to obtain the data needed on floppy disk. In some cases, this involved downloading
the data directly from a mainframe computer; in others, requesting a download or electronic report
from the agency maintaining the data; and in some cases, requesting a copy of PC-based data base
files.

   The second step was to match facilities. For the first year of TRIS data, the facility data from
TRIS was simply converted into the format of the WRMS Facility file. After that, facilities from the
secondary data sources and subsequent years of TRIS data had to be matched to the facilities already       _
described in WRMS, so that facility information would not be duplicated.

    The third step was to match chemicals. The SARA List of Lists chemicals, the conventional
water pollutants typically reported to NPDES and the Pretreatment data base, and the criteria air
pollutants typically reported to NEDS had been entered into the WRMS Chemical file before data
conversion. Chemicals and pollutants reported by these sources had to be matched to those
pollutants. Hazardous wastes reported in NCAR were added as those data were converted, since
there was no list available as a basis for the wastes that might be reported.

    The fourth step was to convert and copy emissions data to the WRMS Emission file. Emissions
were converted to lbs/yr and aggregated to the facility level if necessary before incorporation into the
Emission file. In addition, information on waterbodies and POTWs receiving discharges were copied
to the WRMS Status f i e in this step.

   The following sections describe the conversion process in more detail for each data source.
Within each section, the following topics will be covered getting the data, facility matching,
chemical matching, emissions conversion, and problems encountered.


                                         Sl
   2.3.1 Toxic Release Inv&tow System (TRI

   2.3.1.1 Getting the Data

                                                   B
       TRIS is maintained on the EPA’s NCC I M computer in Research Triangle Park. It consists
   of three files: the Submission file, the Release-Transfer file, and the Treatment file. The
   Submission f i e contains facility and chemical information specific to each TRI Reporting Form
   R submission, which provides information on one facility and one chemical. This file also
   contains information on waste minimization for each facility and chemical. Each Form R
   submission is identified in TRIS by a document control number; this number is found in all three
   files and may be used to link them. The Release-Transfer file contains information on releases to
   different media (fugitive air, stack air, water, underground injection, and land) and transfers off-
   site, to a P O W or a Treatment, Storage, and Disposal Facility (TSDF). This f i e typically
   contains multiple records for each Form R submission. Each record represents a release to one
   media or a transfer to one type of facility. There may also be multiple records for one type of
   release or transfer when the releases are to different waterbodies or reflect a different type of
   release to land (e.g., landfill vs. surface impoundment) or when transfers are to two or more
   different facilities. The Treatment file contains information on the treatment of the chemical
   reported; it is not used in WRMS.


                                                                                              Page 2-15
       The TRIS data were downloaded from the EPA mainframe using a combination of
    NATURAL and SAS programming. Samples of the programs used are shown in Appendix C.
    Only records for facilities in North Carolina were downloaded, and Release-Transfer records for
    underground injection were omitted. Only selected fields were downloaded from the Submission
    and Release-Transfer files. Once downloaded, these subset files were reconstructed in dBase
    format, and Submission records missing both CAS number and chemical name were deleted, as
    were Release-Transfer records reporting a release of zero. The structures for the downloaded
    Submission and Release-Transfer files are shown in Appendix B, Tables B-1 and B-2.


    2.3.1.2 Facility Matching

        Before matching facilities, if any of the EPA IDS or NPDES permit numbers contained the
    capital letter 0 instead of zero, they were edited to correct that problem. Similarly, identifiers
    not beginning with NC (as would be expected for facilities in North Carolina) were inspected and
    edited if there appeared to be an obvious typographical error (e.g., an identifier starting with
    MC).

       The facility matching process for the TRIS data was fairly rigorous, to ensure the most
    accurate possible matching of facilities. The following steps were performed for each facility:

         1. Automated facility matching using EPA ID, NPDES pennit number, and TRI facility ID.
         2. Manual check of facilities unmatched after step 1.
         3. Automated assignment of W R M S Facility IDS to facilities still unmatched after step 2.
         4. Manual check of matched facilities from step 1 for which discrepancies exist between
             other identifiers or the facility name or address.
         5 . Automated update of selected facility data in WRMS using TRIS data.

    This process was designed to automate the facility matching as much as possible while still
    providing a manual check for both missed matches and incorrect matches. The steps are
    described in more detail in the following paragraphs.

        In the first step, the following fields (or parts of fields) for the facilities reported in the data
    being converted were compared to the same fields for facilities already described in WRMS: EPA
    ID, NPDES pennit number, lXI Facility ID,l city, facility name (first 5 characters), and street
    address (fist 10 characters). Each facility fell into one of the following categories:

             Solid match found: a WRMS facility was found for which at least one of the 3 identifiers
             (EPA ID, NPDES permit number, TRI Facility ID) matched, and all other fields listed
             above that were not blank matched. Solid matches were not reviewed manually for
             accuracy.

             Tentative match found: a WRMS facility was found for which at least one of the 3


'                      D
    The TRI Facility I consists of the 5-digit zip code, the first 5 consonants of the facility name, and the first 5 nonblank
    characters of the facility address. If it ended i POBOX (indicating a mailing address rather than a location), the TRI
                                                    n
    Facility ID was not used for facility matching.


Page 2-16
       identifiers (EPA ID, NPDES permit number, TRI Facility ID) matched, but one or more
       of the other fields listed above that were not blank did not match. Tentative matches
       were reviewed manually for accuracy (step 4).
                                                                                                       -
       No match found: no WRMS facility was found for which any of the 3 identifiers (EPA
       ID, NPDES permit number, TRI Facility ID) matched. Unmatched facilities were                    ~




       reviewed manually for missed matches (step 2).

    If no match was found in the WRMS Facility file, a new W R M S Facility record was created.
If a correct match existed but had been missed by the automated matching routine, the new
Facility record duplicated an existing Facility record. For example, if the matching routine was
trying to match the ABC Company in Raleigh, and this facility was already in the FaciZity file,
but the matching routine missed the match, a new record would be created for the ABC Company
in Raleigh, which would duplicate the old record for the facility. The automated matching
routine usually missed a match because the facility did not report an EPA ID or "DES permit
number and the TRI Facility ID w s not usable or had changed since the previous year.
                                   a

    In the second step, the new Facility records were checked manually for matches among
existing WRMS Facility records. The Facility f i e was browsed in order by city and facility
name to facilitate the identification of duplicated facility records; in this order, most duplicated
facility records were adjacent to each other or only a few records apart. In determining whether
two records represented the same facility, all the data for the two facilities were compared and
weighed.

    Once all facilities for which new Facility records were created were checked and either
matched or verified as new, the third step of the facility matching process was to assign a
WRMS Facility ID to the unmatched facilities. The WRMS Facility ID consists of the first 5
characters of the facility name and a unique, 6-digit serial number. Section 2.2 discusses the
reasons for creating a new Facility ID for use in WRMS.

    In the fourth step of facility matching, tentative matches were checked manually and either
verified or rejected. Again, all data for a facility were considered and weighed in making this
decision. If a match was rejected, and no correct match was found, a new Facility record was
created and a WRMS Facility ID assigned to the facility.

    The fifth and fmal step of facility matching for TRIS was to f i in missing data in the
Facility file with any available data from TRIS. For example, if county had not been reported
for a facility in previous years (and was therefore missing from WRMS), but was available in the
current TRIS data, the county field in the Facility file was filled in with the county reported in
the current TRIS data. Contacts and phone numbers were also updated, even if the Facility file
contained data on contact and phone number, to ensure that the most recent contact information
was available.

    Note that TRIS data for any given year were converted before data from any other source for
that year, so that the appropriate facilities were included in the Facility file.




                                                                                           Page 2-17
   2.3.1.3 Chemical Matching

       Chemicals were matched by computer based on CAS number or chemical name. CAS
   numbers are reported in TRIS in an all numeric format with leading zeros and no hyphens (e&.
   000123456). WRMS uses a more readable right-justified format with hyphens and no leading
   zeros (e.g. 123-45-6; in this format, there are 2 to 6 digits before the first hyphen, two digits
   between the hyphens, and one digit following the second hyphen). Before chemical matching
   was done, the format of the CAS numbers in TRIS was changed to match that used in WRMS.

     If any chemicals remained unmatched after automated chemical matching, they were matched
   manually, and any new chemical records were added to the Chemical file as needed.


   2.3.1.4 Emissions Conversion

       The TRIS Release-Transfer file contains one record for each different type of release or
   transfer reported for a particular facility and chemical. The types of releases or transfers are as
   follows:

            Fugitive air release
            Stack air release
            Surface water release
            Land release
            Transfer to POTW
            Transfer off-site

       The WRMS Emission file stores each of these release or transfer types in a separate field in a
   single record for the facility and chemical. There can only be one record in the Release-Transfer
   file for a particular submission for fugitive air release and stack air release, and this single value
   is placed in the corresponding Emission field; however, there may be multiple records for any of
   the other release or transfer types, reflecting releases to different waterbodies, different types of
   release to land (e.g., landfill vs. surface impoundment), transfers to different POTWS,and
   transfers to different off-site facilities. Multiple records for surface water release, land release,
   transfer to P O W , or transfer off-site were aggregated to obtain a single, total amount released or
   transferred for each of the release or transfer types, and these values were placed in the
   corresponding fields in the Emission fiie. An estimate basis was assigned to each aggregated
   quantity by using the basis associated with the largest portion of the aggregated value.

       Release quantities are occasionally reported in TFUS as one of three ranges of values: 0-10
   lbs, 11-499 lbs or 500-999 lbs. These were replaced with the midpoint of the range (5, 250, and
   750 respectively) and a flag set to indicate that the data were originally reported as a range.

       Table 2-1 1 summarizes the fields used from TFUS and the corresponding fields where these
   data were placed in WRMS. If data were available on receiving waterbody or POTW, these were
   entered in the Status fiie. The document control number was used as the source ID.




Page 2-18
Table 2-11. Fields Used i WRMS from TRIS
                        n
                                                                                       ~~




 TRIS Data Element                            WRMS File               WRMS Field
 Document control number                      EMISSION                SOURCEJD
 Reporting year                               EMISSION, STATUS        YEAR
 TRI Facility ID                              FACILITY                TRI_ID
 Facility name                                FACILITY                FAC NAME
 Street address                               FACILITY                 STREET-I, STREET-2
 city                                         FACILITY                 CITY
 county                                       FAClLiTY                COUNTY
 ZIP Code                                     FACILITY                zip
 Latiiude                                     FACILITY                LAT
 Longitude                                    FACILITY                LONG
 Contact                                      FACILITY                CONTACT
 Phone                                        FACILITY                PHONE
 EPA ID                                       FACiLlTY                EPA-ID
 CAS Number                                   CHEMICAL                CAS-NUM
 Chemical name                                CHEMICAL                USE-NAME
 Production index                             EMISSION                PROD-NDX
 Reason for waste minimization activities     EMISSION                MIN-REASON
 Waste minimization activities                EMlSSiON                WASTE-MIN
 Waste quantii generated in current year      EMiSSlON                CURR-AMT
 Waste quantity generated in previous year    EMISSION                PREV-AMT
 P E " t change in waste quantity generated   EMISSION                PCT-CH ANGE
 NPDES Permit No.                             FACILITY                NPDES
 SIC Codes (3)                                FACILITY                SIC-i. SIC-2, SIC-3
 Release medium                               Determines fields for   1 = FUGIT, 2 -STACK,


Release quantity
                                              Release, Basis. and
                                              Range
                                              EMISSION
                                                                                   -
                                                                      3 = WATER, 5 = LAND,
                                                                      6 = POTW, 7 OFF
                                                                      *-AMT
Basis of release estimate                     EMISSION                '-BAS
Estlmated reported as a range                 EMISSION                  RNGE
Stream name                                   STATUS                  RECEIV-HZO
Transfer site name                            STATUS                  POW

May be FUGIT, STACK, WATER, LAND, POTW or OFF, depending on value of REL-MEDIUM




                                                                                             Page 2-19
   2.3.1.5 Problems Encountered

       The problems encountered in using the TRIS data were related to identifying facilities
   consistently. TRIS identifies facilities using the TRI Facility ID. This ID consists of the 5-digit
   zip code, the first 5 consonants of the facility name, and the fnst 5 nonblank characters of the
   facility address. Typographical errors or changes in these fields from year to year can result in
   inconsistencies in the TRI Facility ID from year to year. Fottunately, EPA has detected this
   problem and taken steps to prevent it by assigning the original TRI Facility ID even when it is
   not consistent with the currently reported facility name and address. A few new TRI Facility IDS
   do still appear in TRIS,even when an earlier ID exists. As a result, if facilities were matched
   only on TRI Facility ID, a number of correct matches might be missed.

       Matching on the TRI Facility ID can also result in mismatches. Many facilities report their
   address as a post office box; for these facilities, the TRI Facility ID ends in POBOX. If a cluster
   of similarly named facilities exists in the same zip code, several facilities can easily have
   identical TRI Facility IDS.

       Because the TRI Facility IDSwere not always reliable for matching facilities, EPA ID and
   NPDES permit number were also used. However, in a few cases where a company has several
   facilities in the same area, these facilities may share an EPA ID or NPDES permit number, but
   be reported separately in TRIS. This made it difficult to match these facilities with TRIS data;
   and impossible with the NCAR and NPDES data, where a facility is always defmed by a single
   EPA ID or NPDES permit number. In general, these facilities were retained as separate facilities
   in W R M S , but the EPA ID and NPDES permit number were arbitrarily assigned to one of the
   facilities in the cluster and deleted from the rest. This resulted in the hazardous waste and
   NPDES data being associated with only one of the facilities in the cluster.


   2.3.2 North Carolina Annual Report (NCAR)

   2.3.2.1 Getting the Data

       The North Carolina Annual Report (NCAR) hazardous waste data base is maintained by the
   State in dBase format. These data include a data file containing one record for one waste at one
   facility and a facility fide containing information about the facilities. In addition to waste
   descriptions, the data fides contain data on total quantity generated, quantity treated or stored on-
   site, and quantity shipped off-site. In addition, since 1989, they include information on waste
   minimization practices and methods used for verifying the quantity estimates. These data were
   not available for 1987. The forms used to collect these data changed significantly in 1989;
   therefore, the data fde for 1988 is somewhat different from the data files from subsequent years.
   In 1988, data were reported on three different forms: one for generators only, one for generators
   that treat on-site, and one for off-site TSD facilities. In 1989, the two generator forms were
   combined. Future data are expected to be in the 1989/1990 format.

      A copy of the data file and the facility file was requested for each reporting year. Only
   generator data were requested. Records reporting only on-site storage were deleted. The 1989
   data f i e contained a header record for each facility that summarized some of the data, such as


Page 2-20
quantity verification techniques, for the facility. These header records contained no new
information and were deleted from the fie. These header records were not present in the 1988 or
1990 data files.

    The structures for the 1988, 1989, and 1990 NCAR data fies are shown in Appendix B,
Tables B-3 through B-5. Some of the field names in the original 1988 file were not descriptive
of the data in the fields; these were renamed manually before data conversion to reflect the
contents of the fields. The structure shown in Table B-3 shows the field names after renaming.
This was not necessary with the 1989 or 1990 data files, nor is it expected to be necessary in the
future.


2.3.2.2 Facility Matching

    Before matching facilities, if any of the EPA IDScontained the capital letter 0 instead of
zero, they were edited to correct that problem. Similarly, EPA IDS not beginning with NC (as
would be expected for facilities in North Carolina) were inspected and edited if there appeared to
be an obvious typographical error (e.g., an EPA ID starting with MC).

    The first step in facility matching was to compare the NCAR facility file and the WRMS
Facility f i e closely to add and correct as many EPA IDS in the WRMS Facility file as possible.
                              l
This was done manually. Al facilities were examined for the first data year; thereafter, only new
TRI facilities added from TRIS for the data year being converted were compared. Additional
facilities were not added to the Facility fie from NCAR, as WRMS covers only facilities
reporting to TRI. The TRIS data for each reporting year were always converted before the
NCAR data so that the appropriate facilities for that year were already included in the WRMS
Faciliay fie.

             D
  After EPA I Swere verified and corrected, facilities were matched by computer using the
EPA ID. Any unmatched facilities remaining after this process were deleted.


2.3.2.3 Chemical Matching

    In 1988, wastes were described by a single RCRA waste code and a short (15 character)
description of the facility’s choosing (thus, two facilities might describe the same waste two
different ways). In 1989, to standardize waste descriptions, the data collection form was changed
so that wastes could be described by up to four RCRA waste codes plus a source code and a
physical form code. A list of the allowed physical form and source codes was provided to all
facilities with the form; no free-form text descriptions were allowed.


   For the 1988 data, no chemical matching was attempted, due to the nonstandard nature of the
waste descriptions. Each waste reported in 1988 was considered to be a new waste and was
added to the WRMS Chemical fie. The text descriptions were used as the chemical name for the
waste.



                                                                                        Page 2-21
        Starting with the 1989 data, wastes were matched based on the RCRA waste codes, physical
    form code, and source code. If these aU matched, the wastes were considered to be the same.
    Waste codes were sorted into alphabetical order before chemical matching so that the order the
    waste codes were reported would not affect matching. If no match was found, a new Chemical
    record was created. Unmatched wastes were not checked manually. No attempt was made to
    match these wastes with the 1988 wastes reported by description. The chemical name for these
   wastes was constructed from descriptions of the physical form and source, in the form "physical
   form description FROM source description."


   2.3.2.4 Emissions Conversion

     The NCAR data file records correspond to one facility and one waste, the same as the WRMS
   Emission records. Therefore, one NCAR record was converted into one Emission record.

       Total amount shipped was placed in the OFF-AMT field and total amount treated (but not
   just stored) was placed in the ON-Ah4T field. Data on total generated were placed in the
   CURI-AMT field. Waste minimization activity codes were concatenated and placed in the
   WASTE-"          field. The PERCENT field in NCAR was converted to numeric format and placed
   in the PROD-NDX field. Quantity verification techniques were reported in four fields
   corresponding to measured, estimated, calculated, and other, any or all of which could have an X
   in it to indicate that method had been used. These were converted to a single coded field
   containing a letter corresponding to the least rigorous of the methods used. For this purpose, the
   methods were ranked from most to least rigorous as follows: measured, calculated, estimated,
   other. There were no data in NCAR that were used in the Status file. The form number plus the
   EPA ID plus the line number from the NCAR file were used as the source ID. Table 2-12
   summarizes the fields used from NCAR and the corresponding W R M S fields.


   2.3.2.5 Problems Encountered

      The only problems encountered with the NCAR data was the use of flee-form text
   descriptions and a single waste code to characterize the wastes in 1988. This made matching
   equivalent wastes impossible. However, this problem was resolved in 1989 by the use of the
   physical form and source codes and up to 4 RCRA waste codes.


   2.3.3 NPDES Permit Monitoring Data Base

   2.3.3.1 Getting the Data

       "DES    data are maintained by the State on a mainframe computer. These data consist of
   monthly surface water discharge data for a variety of STORET parameters from NPDES-
   permitted facilities. The STORET parameters include physical parameters, such as flow and
   temperature; conventional pollutants, such as BOD and Total Suspended Solids; and many toxics,
   including (but not limited to) a variety of metals. Discharges may be reported either as a
   concentration (e.g., mg/l) or an emission (e.g., lbs/day). Flow is usually reported in millions of


Page 2-22
Table 2-12. Fields U s e d i W R M S from NCAR
                           n

 Data Year   NCAR Data Element                   WRMS File                                 WRMS Field
 1988        Form Number                         EMISSION                                  SOURCE-ID
             EPA ID                              EMISSION                                  SOURCE-ID
             Line Number                         EMISSION                                  SOURCE-ID
             Waste code                          CHEMICAL                                  WASTE-CODE
             Waste descriition                   CHEMICAL                                  USE-NAME
             Total quanti generated              EMISSION                                  CURR-AMT
             Treatment code                      used to establish treatment vs. storage
             Total quantity treated on-site      EMISSION                                  ON-AMT
             Total quantity shipped offsite      EMISSION                                  OFF-AMT
 1989/1990   F o n Number                        EMISSION                                  SOURCE-ID
             EPA ID                              EMISSION                                  SOURCE-ID
             Line Number                         EMISSION                                  SOURCE-ID
             Waste codes (4)                     CHEMICAL                                  WASTE-CODE
             Waste form code                     CHEMICAL                                  FORM-CODE
             Waste source code                   CHEMICAL                                  SRCE-CODE
             Total quantity generated            EMISSION                                  CURR-AMT
             Treatment code                      used to estabiish treatment vs. storage
             Total quantity treated on-site      EMISSION                                  ON-AMT
             Total quanlity shipped off-site     EMISSION                                  OFF-AMT
             Production index                    EMISSION                                  PROD-NDX
             Waste minimization activities (4)   EMISSION                                  WASTE-MIN
             Basis of quantity estimate          EMISSION                                  OFF-BAS, ON-BAS




                                                                                                             Page 2-23
   gallons per day (MGD). These values are reported separately for each pipe at a facility. Facility
   identification data are also included.

        A download from the NPDES data system was requested for conventional pollutants and flow
   for all major and minor industrial dischargers for 1987 through 1990. Since NPDES contains
   monthly average emissions and concentrations, while WRMS contains annual emissions, annual
   averages for each facility, pipe, and parameter were requested, which were aggregated to the
   facility level during conversion. Facilities may report the same parameter in different units from
   month to month (e.g., as a concentration in mg/l one month and an emission in Ibs/day another
   month). This resulted in multiple annual averages for some facility, pipe, and parameter
   combinations: one corresponding to each different unit reported. Therefore, the number of
   reporting months associated with each average was also requested, so that multiple averages
   could be weighted appropriately to get an overall annual average (once units had been converted).
   This information was received, but only for the two most common units reported, mg/l and
   lbs/day. Records with other units (which represented only a small fraction of all the records)
   were not used in W S , since they could not be accurately weighted. The downloaded data
   were provided in an ASCII file with fields delimited by the @ symbol. The structure of the data
   file is shown in Appendix B, Table B-6. The delimiter could be omitted in future downloads as
   long as the fields in the ASCII f i e are f i e d length (i.e., the field is always the same length,
   regardless of the length of the actual piece of data) and a record structure (such as that shown in
   Table B-6) is provided.


   2.3.3.2 Facility Matching

       Before matching facilities, if any of the "DES permit numbers contained the capital letter 0
   instead of zero, they were edited to correct that problem. Similarly, NPDES permit numbers not
   beginning with NC (as would be expected for facilities in Noah Carolina) were inspected and
   edited if there appeared to be an obvious typographical error (e.g., an NPDES permit number
   starting with MC).

        The fust step in the facility matching process was to compare the facility information from
   the NPDES data file to the W S Facility file, in order to add and correct as many NPDES
   permit numbers in the WRMS Facility f i e as possible. This was done manually. All facilities
   were examined for the first data year; thereafter, only new TRI facilities added from TRIS for the
   data year being converted were compared. Additional facilities were not added to the Facility
   f i e from NPDES, as WRMS covers only facilities reporting to TFU. The TRIS data for each
   reporting year were always converted before the NPDES data so that the appropriate facilities for
   that year were already included in the WRMS Facilily file.

      After NPDES permit numbers were verified and corrected, facilities were then matched by
   computer using the NPDES permit number. Unmatched facilities remaining after this was
   complete were deleted.




Page 2-24
2.3.3.3 Chemical Matching

    Pollutants are identified in NPDES by a STORET parameter number. This number was used
to match pollutants in the Chemical file. Since a parameter can sometimes have multiple
parameter numbers (depending on units reported), any unmatched parameters were checked
                                                                                                  -
manually before adding them to the Chemical file. The parameter name was used for the             ~




chemical name in the Chemical fiie.


2.3.3.4 Emissions Conversion

    Any records with units other than MGD for flow and mg/J or Ib/day for
concentration/emissions were moved to a holding fie, as no weighting factors were available for
them. These were saved in case they are needed in the future. The NPDES data therefore
contained one annual average flow value and either one or two annual average
concentration/emission values for each parameter and pipe. Annual emissions in Ibs/yr were
calculated for each facility and parameter from these values by the following equation:


               AE,,   =   D
                                                        + Wemissv*Emiss,,
                              *EWconc,,*Concv*FZow,*CFWemissv
                               ti

                              i-1           Wconcu +

where:

   i        = index on pipe
   j        = index on parameter
   n        = total number of pipes at facility
   AEj      = annual emissions of pollutant j in lbs/yr
   D        = days of discharge per year, assumed to be 365
   Wconcij = number of months reported as a concentration in mg/l
   Wemissij = number of months reported as an emission in lbs/day
   Concij   = Average concentration of parameter j from pipe i in mg/l
   Flowi    = Average flow from pipe i in MGD
   Emissij = Average emission of parameter j from pipe i in lbs/day
   CF       = units conversion factor = 8.3 lb-l/mg-MG

   Finally, annual emissions for each pipe and parameter were aggregated to the facility level
and the result placed in the WATER-AMT field of the W R M S Emission file. The NPDES
permit number plus the parameter code was used as the source ID. No data were included in the
NPDES data that would belong in the Sratus file. Table 2-13 summarizes the fields used from
NPDES and the corresponding W R M S fields.


2.3.3.5 Problems Encountered

    Several problems were encountered using the NPDES data; most of these stemmed from the
data being reported in various units of measure.


                                                                                     Page 2-25
  Table 2-13. Fields Used i W R M S from "DES
                          n

    NPDES Data Element                     WRMS File
    NPDES Permit Number                    EMiSSiON
    Facility name                          used in facility matching
    Street                                 used in facility matching
    city                                   used in facility matching
    State                                  used In facility matching
    ZIP Code                               used in laciltty matching
    County                                 used in facility matching
    SIC code                               used m facility matching
    Lattude                                used in facility matching
    Longitude                              used h laciilty matching
    Parameter code (flow or pollutant)     CHEMICAL, EMISSION                     STORET-NUM, SOURCE-ID
    Parameter name (flow or pollutant)     CHEMICAL                               USE-NAME
    Reportlng units                        used to detemlne correct calculation
    Average flow or concentration          EMISSION                               Used In calculatbn of WATER-AMT
    Number of months reported in mgll      EMiSSlON                               Used In calculation of WATER-AMT
    Number of months reported in lbslday   EMISSION                               Used in calculatin of WATER-AMT




Page 2-26
    Some data were reported as lbs/day. These had to be inflated to lbs/yr, but no data were
available on the number of days per year a facility discharged. Therefore, this value was
assumed to be 365 for al facilities. This assumption could result in overestimating annual
                       l
emissions. Some data were reported as a flow in MGD and a concentration, typically in mg/l.
                                                                                                     -
These had to be converted to lbs/day. Again, the number of days of discharge per year had to be      ~




assumed.

    In addition to having to convert data from concentrations to emissions, use of the NPDES             ~




data was further complicated by the fact that data for the same pipe and parameter were often
reported in different units from month to month. Therefore, there were often two or more
“annual‘’ averages for a pipe and parameter, one for each unit reported. To calculate an overall
annual average, weights were needed reflecting the number of months each average represented.
However, the fdes downloaded contained a separate field for the weight for each of the two most
common units. Therefore, weights were not available for other less common units and those data
could not be used. Since each record contains data for only one set of units, and therefore only
one weight, the weight could be reported in a single field, which would make it easier to include
these data for all units encountered without knowing what they are in advance.

   One additional problem was the omission of data on receiving water for the discharges.
These data would be useful if they are available.


2.3.4 MuniciDal/hdustrial Pretreatment Monitoring Data Base

2.3.4.1 Getting the Data

   The Pretreatment data are maintained by the State on a mainframe computer. These data
consist of annual average concentration and flow for discharges of a variety of conventional
water pollutants and toxic chemicals to POTWs from municipalities and industrial users.

    A download from the Pretreatment data system was requested for industrial users only and for
a list of 14 conventional water pollutants and inorganics not included in TRIS. Table B-7 in
Appendix B shows the structure of the Pretreatment data file; the pollutants requested are also
shown, each in a separate field. A file containing identifying information for the POTWs was
also provided with the downloaded data; its structure is shown in Appendix B, Table B-8.


2.3.4.2Facility Matching

    Facilities are identified in the Pretreatment data base by the NPDES permit number of the
POTW and an industrial user (IU) number. These identifiers are not reported in TRIS.
Therefore, the first step in the facility matching process was to compare the facility information
from the Pretreatment data file to the WRMS Facility file, in order to add as many Pretreatment
IDS (consisting of the P O W NPDES permit number plus the IU number) to the WRMS Facility
file as possible. This was done manually. All facilities were examined for the fist data year;
thereafter, only new TRI facilities added from TRIS for the data year being converted were


                                                                                         Page 2-27
   compared. Additional facilities were not added to the Facility fiie from the Pretreatment data
   base, as WRMS covers only facilities reporting to TRI. The TRIS data for each reporting year
   were always converted before the Pretreatment data so that the appropriate facilities for that year
   were already included in the W R M S Facility file.

      After Pretreatment IDS were entered to the Facility file, facilities were then matching by
   computer using the POTW NPDES permit number plus the IU number. Unmatched facilities
   remaining after this was complete were deleted.


   2.3.4.3 Chemical Matching

       Chemical matching was not necessary with the Pretreatment data, because each of the 14
   pollutants covered was reported in a separate field. Chemical IDS were assigned directly as
   emissions were converted.


   2.3.4.4 Emissions Conversion

       Conversion of emissions required separation of pollutants into individual records. For each
   Pretreatment record, up to 14 Emission records were created, one for each pollutant with nonzero
   emissions. Releases were converted from concentration and flow to emissions in lbs/year by the
   following equation:2

                                        AE   =   D   *   Conc   * Flow *   CF

   where:

       AE       = annual emissions in lbs/yr
       D        = days of discharge per year, assumed to be 365
       Conc     = Average concentration of parameter j from pipe i in mg/l
       Flow     = Average flow in thousand gaUons per day
       CF       = units conversion factor = 0.0083 lb-l/mg-103 gal

   The result was entered in the PO'ITV-AMT field. The Pretreatment data contained no data that
   were used in the Status fiie. The year plus the P O W NPDES permit number plus the IU
   number was used as the source ID. Table 2-14 summarizes the fields used from the Pretreatment
   data and the corresponding WRMS fields.


   2.3.4.5 Problems Encountered

      The major difficulty encountered in using the Pretreatment data was the need to use the IU
   numbers to identlfy facilities and to enter these into WRMS manually. The IU numbers are


   This equation was not used for color, which was reported i color units and could uot be converted to Ibsh. Coior data
                                                             n
   were entezed into the Emission file as i , without conversion.
                                           s

Page 2-28
Table 2-14. F i e l d s U s e d i W R M S from Pretreatment
                                n

 Pretreatment Data Element         WRMS File                   WRMS Field
 Reporting year                    EMISSION. STATUS            SOURCE-ID, YEAR
 Industrial User (U) name          used in facility matching
 POTW Name                         STATUS                      POTW
 POTW NPDES Perm) No.                                          SOURCE-ID
  U
 I Number                          EMISSION                    SOURCE-ID
 Flow                              EMISSION                    used in calculation of POW-AMT
 Concentration of:
  BOD                              EMISSION                    used in calculation of POW-AMT
  COD                              EMISSION                    used in calculation of POW-AMT
  Total Suspended Solids           EMISSION                    used in calculation of POW-AMT
   Oil
   . ~~                            EMISSION                    used in calculation of POW-AMT
    Total Kjeldahl Nitrogen        EMISSION                    used in calculatlon of POW-AMT
    NO"                            EMISSION                    used in calculation of POW-AMT
    TotiI Phosphorus               EMISSION                    used in calculation of POW-AMT
    Chloride                       EMISSION                    used in calculation of POW-AMT
    Tin                            EMISSION                    used In calculation of POW-AMT
    Ammonia                        EMISSION                    used in calculation of POW-AMT
    MBAS (surfactants)             EMISSION                    used in calculation of POW-AMT
    Color                          EMISSION                    used in calculation of POW-AMT
    Sulfide                        EMISSION                    used in calculation of POW-AMT
    Fluoride                       EMISSION                    used in calculation of POW-AMT
  4ddress                          used in facility matching
  Xy                               used in facility matching
  !IP Code                         used in facility matching
  31C Code                         used in facility matching




                                                                                                Page 2-29
   highly inconsistent from year to year, making facility matching difficult. Facilities with
   Pretreatment IDS already entered for one year had to be changed the next year. As a result, all
   facilities must be rematched manually each year.

       A minor problem was the need to convert emissions units. Data were reported as a flow in
   thousand gallons per day and a concentration in mg/l. These had to be converted to lbs/day, then
   inflated to lbs/yr. However, no data were available on the number of days per year a facility
   discharged. Therefore, this value was assumed to be 365 for a l facilities. This assumption could
                                                                l
   result in overestimating annual emissions.


   2.3.5 Air Quality National Emissions Data System (NEDS)

   2.3.5.1 Getting the Data

       The Air Quality National Emissions Data System (NEDS) is maintained by the State.
   Eventually, these data will be included in the newer Aerometric Information Retrieval System
   (AIRS),maintained by EPA. NEDS contains data on stack emissions of five criteria air
   pollutants. Data for Mecklenburg County (including the Charlotte area) were available only in
   hard copy, and were not used.

       A standard report from NEDS contained the data needed for WRMS; this report was
   requested on disk in ASCII format for 1987 through 1990. Each line corresponds to one plant
   and includes data on annual emissions of each of the five criteria air pollutants covered:
   particulates, SO,, NO,, VOC, and CO. Because the report is intended for printing, the fies
   contained headers with the field names about every 50 records (so that if it were printed, the
   headers would appear at the top of each page). These header lines were deleted. The structure
   of the NEDS data file is shown in Appendix B, Table B-9.


   2.3.5.2Facility Matching

        Facilities are identified in NEDS by a county code and a plant ID; the plant ID is unique
   within each county. These county codes and plant IDSare not reported in TRIS. Therefore, the
   first step in the facility matching process was to compare the facility information from the NEDS
   fie to the WRMS Facility file, in order to add as many Air IDS (consisting of the county code
   plus the plant ID) to the WRMS Facility file as possible. This was done manually. All facilities
   were examined for the first data year; thereafter, only new TRI facilities added from TRIS for the
   data year being converted were compared. Additional facilities were not added to the Facility
   file from NEDS, as WRMS covers only facilities reporting to TRI. The TRIS data for each
   reporting year were always converted before the NEDS data so that the appropriate facilities for
   that year were already included in the WRMS Facility file.

       After Air IDS were entered to the Facility file, facilities were then matching by computer
   using the county code plus the plant ID. Unmatched facilities remaining after this was complete
   were deleted.



Page 2-30
   2.3.5.3 Chemical Matching

      Chemical matching was not necessary with the NEDS data, because only five pollutants were
   reported and each was reported in a separate field. Chemical IDSwere assigned directly as
   emissions were converted.

   2.3.5.4 Emissions Conversion

       Conversion of emissions required separation of pollutants into individual records. For each
   NEDS record, up to five Emission records were created, one for each pollutant with nonzero
   emissions. Emissions were converted from tons/year to lbs/year and entered in the
   STACK-AMT field. NEDS contained no data that would go in the Sratus file. The year plus
   the county code plus the plant ID was used as the source ID. Table 2-15 summarizes the fields
   used from NEDS and the corresponding WRMS fields.


   2.3.5.5 Problems Encountered

       The major difficulty encountered in using the NEDS data was the need to enter plant IDS to
   WRMS manually. This process was hampered by the fact that a l l facility information other than
   the county code and plant I3 (i.e., plant name, address, and city) were contained in a single field.
                                J
   This prevented sorting on any of these data except the facility name. It would simplify the
                       i
   process of adding Ar IDS in the future if these were separated into three fields. The NEDS plant
   IDS are fairly consistent from year to year, so additional plants IDSshould only need to be
   entered for new TRIS facilities in the future.


2.4 RELATIVE INDEXING SCHEME FOR TOXICITY AND                    HAZARD
    WRMS characterizes chemical releases by the quantity released. However, to compare the risks
associated with chemical releases, the toxicity and environmental fate of the chemical must also be
considered. Consequently, RTI developed a relative indexing scheme for chemicals covered under
SARA Title III, Section 313 (TRI constituents) and incorporated a relative toxicity component and an
environmental fate component into the WRMS data base. Thus, the relative indexing scheme
consists of two distinct parts: (1) a'relative toxicity index that provides a quantitative scale to
evaluate the relative acute, chronic, and ecological toxicity of constituents via air,soil, and water,
and (2) an environmental mobility and persistence scoring system that provides environmental fate
modifiers to evaluate the relative hazard associated with air, soil, and water releases. The relative
indexing scheme was designed to allow the user to evaluate emissions exclusively on relative
toxicity, or, by incorporating the mobility and persistence component, according to the relative
hazard through specific media, as a function of relative chronic toxicity and environmental fate.
Depending on the needs of the user, emissions can be normalized by relative toxicity or relative
hazard and compared at the facility, industry, or state level.

   The relative indexing scheme was designed to assist the North Carolina Pollution Prevention
Program (NCPPP) in evaluating the relative risk posed by hazardous emissions to air, water, and soil.
Whether adjusted by mobility and persistence or used independently, the relative toxicity indices


                                                                                             Page 2-31
  Table 2-15. Fields Used i WRMS from NEDS
                           n

    NEDS Data Element           1 WRMS File                  1 WRMS Field   I
    Plant I D                    EMISSION                     SOURCE-ID
    Facility name                used in facility matching
    Facility address             used h facility matching                   I
    County                       EMISSION                     SOURCE-ID
    Particulate emissions        EMISSION                     STACK-AMT
    SO2 emissions                EMISSION                     STACK-AMT
    NO2 emissions                EMISSION                     STACK-AMT
    VOC emissions                EMISSION                     STACK-AMT
    Carbon monoxide emissions    EMISSION                     STACK-AMT




Page 2-32
provide a risk-based tool to:

       prioritize waste streams, facilities, regions, and industries based on emission levels and the
       toxicity of the release constituents;

       identify emission trends by facility, region, state, industry, etc;
       compare year to year emission trends by waste stream, facility, region, state, industry, etc;

       analyze emission trends for acute and chronic health effects and ecological effects; and

       identify emission trends by environmental media (e.g. air, soil, and water).


    The following sections describe the methodology used to develop the relative toxicity indices and
the environmental mobility and persistence scores. It should be emphasized that the relative toxicity
indices and the mobility and persistence scoring system were designed to afford the user with the
flexibility to evaluate emissions from the standpoint of toxicity alone or to evaluate the hazards in
individual media in the context of environmental fate and transport of a constituent as well as
toxicity.


   2.4.1 Relative Toxicity Indices

       The relative toxicity indices were developed for TRI constituents contained in the WRMS
                                                                                                              .
                                                                                                              ~




   data base. Seven relative toxicity indices were developed, as follows: acute air, chronic air, acute
                                                                                                              ~




                                                                                                              a
   soil, chronic soil, acute water, chronic water, and ecological water. Ecological indices were
   developed only for water because all available ecological effect data were for aquatic species.
   The development of these indices consisted of three phases: (1) data collection, (2) calculation of
   the toxicity ratios reflecting the individual constituent’s toxicity relative to the range of values for
   all TIU constituents, and (3) selection of toxicity indices. These steps are described in detail in
   the following sections.


   2.4.1.1 Toxicity Benchmark Data Collection

       Ten categories of toxicity data were collected for the TFU constituents: seven human toxicity
   benchmarks and three ecological toxicity benchmarks. Human health effects were evaluated
   according to acute and chronic toxicity for both the oral and inhalation pathways. Chronic
   toxicity was evaluated for both the noncarcinogenic, or systemic, and carcinogenic effects of
   constituents. Ecological toxicity was evaluated according to acute toxicity to vertebrate and
   invertebrate species of aquatic organisms and the potential of the constituents to bioconcentrate in
   fish tissue.

       The acute toxicity measures for human health were based on data from rat studies and
   included median lethal doses (LDSO’s) for ingestion and median lethal concentrations (LC5O’s)
   for inhalation. These measures indicate the dose or concentration, respectively, required to cause
   death in 50% of the exposed population. These measures of lethality are widely considered to be


                                                                                                Page 2-33
   an appropriate relative measure of acute toxicity in humans.

       For chronic systemic effects, the health benchmarks included inhalation reference
   concentrations (RfCs), oral reference doses (RfDs), and, if an RfD could not be identified for a
   noncarcinogen, oral No Observed Adverse Effect Levels (NOAELs). The RfDs and RfCs
   estimate the daily exposure to the human population that is likely to be without deleterious
   effects during a lifetime. NOAELs indicate the highest experimental dose at which there is no
   statistically or biologically significant increase in the frequency or severity of adverse health
   effects in the exposed population. It should be noted that ratios calculated from NOAELs should
   be interpreted with great caution since these values have not been adjusted for confidence in the
   study and have not been reviewed by the EPA. This subset of chronic systemic ratios was
   limited to the 31 constituents; these are shaded in Tables D-1 through D-3 in Appendix D.

       For chronic carcinogenic effects, the health benchmarks included the inhalation and oral
   carcinogenic slope factors (CSFs). The CSF reflects the carcinogenic potency of a chemical and
   is derived by extrapolating from high to low doses to form a carcinogenic dose-response curve.
   The CSF is derived mathematically as the 95% upper confidence limit of the slope. of the linear
   portion of this dose-response curve and may be used to defiie the potential risk of cancer to an
   exposed population. Unlike the RfD or RfC, the CSF is not given in terms of dose. Whereas the
   RfD or RfC is defined by an acceptable dose in mg of constituent per kg of body weight per day,
   the CSF is a measure of the probability of risk and is the inverse of mg of constituent per kg of
   body weight per day. From a quantitative standpoint, this means that a lower RfD is associated
   with higher chronic toxicity but a lower CSF is associated with lower chronic toxicity. The
   importance of this distinction will become clear in the following section on calculation of toxicity
   ratios.

       For ecological effects, the toxicity benchmarks included the aquatic median lethal
   concentration (aq LC50) to water fleas (invertebrates) and fish (vertebrates) and the
   bioconcentration factor (BCF) in bony fish. The aquatic LC50 is analogous to the acute health
   effects LD50, except the exposed population is an aquatic species. The BCF estimates the
   potential for constituents to become concentrated in the tissues of bony fish. The BCF provides a
   rough estimate to the long term ecological effects via food chain bioconcentration and
   bioaccumulation of constituents.

      The toxicity data were collected from the following sources:

      Intenrated Risk Information Svstem (IRIS) - Environmental Protection Agency (EPA) data
          base that provides verified risk assessment information, including Inhalation Reference
          Concentrations (RfC),  Oral Reference Doses (RfD), and Carcinogenic Slope Factors
          (CSF).

      Health EffectsAssessment Summary Tables (HEAST) - EPA source providing unverified risk
         assessment information for oral and inhalation exposure routes, including RfDs, RfCs, and
         CSFs. HEAST was used to supplement IRIS.

      Hazardous Substances Data Bank (HSDB) - Online factual data bank operated by the National
         Library of Medicine that contains scientifically reviewed and edited data on various


Page 2-34
       subjects, including Toxicity/Biomedical Effects. Specifically, HSDB was researched for
       acute health effects values (LCSO’s and LDSO’s) and NOAELs.

   Reniswy of Toxic Effectsof Chemical Substances (RTECSI - Online f i e maintained by the
                                                                                                      -
      National Institute for Occupational Safety and Health (NOSH) which contains chemical
      toxic effects data, including both acute and chronic effects. Specifically, RTECS was           ~




      searched for acute health effects values (i.e. LDSO’s and LCSO’s) to supplement HSDB.

   AOUatic Information REtrieval system (AOUIRE) - EPA data base of aquatic toxicity                      _
     information, including acute and chronic toxicity and bioconcentration measures.
     AQUIRE was searched primarily for aquatic LCSO’s.

   Assessment Tool for Environmental Risk (ASTER1 - EPA data base containing measured
      values for physical and chemical properties and aquatic toxicity as well as estimates based
      on state-of-the-art Quantitative Structure-Activity Relationship (QSAR) calculations.
      Specifically, ASTER was searched for QSAR aquatic LCSO values to supplement
      AQUIRE.

    The above sources contain toxicity data that have undergone varying levels of review by
EPA. For instance, the RfDs and CSFs found in IRIS have been reviewed extensively by EPA,
but the NOAELS and LDSOs identified in HSDB have not been reviewed by EPA (although they
are generally peer-reviewed). In addition, data gleaned from these sources are often generated by
studies using different exposure characteristics and assumptions such as test species and exposure
duration. Therefore, variations in study parameters (e.g., exposure duration, frequency, etc.) must
be accounted for to ensure consistent and comparable toxicity data for chemical constituents.
Table 2-16 summarizes the data collection guidelines used in identifying appropriate data for the
relative toxicity index. The benchmark data collected are shown in Table D-1, Appendix D.


2.4.1.2 Calculation of Toxicity Ratios

    The health and ecological effects data collected reflect an absolute level of toxicity. To
calculate ratios converting these to a relative measure of toxicity, a fiied standard of comparison
was needed. Several criteria for the resulting toxicity ratios were established:

   1. the toxicity ratios should be comparable over time, even as benchmark values change.
   2. a toxicity ratio of 1 should have some intuitive meaning, and
   3. the toxicity ratio should increase with increasing toxicity,

A number of possibilities were considered for use as a standard of comparison in calculating the
toxicity ratios. The method selected was to create a hypothetical “average” TRI constituent based
on the entire range of toxicity values available for the TRI constituents by calculating the
geomemc mean for each of the 10 toxicity benchmarks. The geometric mean was used instead
of the arithmetic mean because the geometric mean is a better representative of central tendency
in data sets that encompass several orders of magnitude, as in the case of toxicity data. These
geometric means will not be changed in the future, even if some of the individual benchmarks
that went into computing them change, so that the geometric means will provide a consistent


                                                                                          Page 2-35
Table 2-16. Data Collection Guidelines for the Toxicity Benchmarks




   Page 2-36
basis for comparison from year to year and the ratios will be comparable over time. It should be
noted that constituents are typically placed on the TRI list by virtue of high toxicity; therefore,
the hypothetical "average" TRI constituent is more toxic than an average constituent from the
whole universe of chemicals would be. By using the hypothetical "average" TRI constituent as            -
the basis for comparison, a toxicity ratio equal to 1 would suggest that the constituent was of
average toxicity relative to the list of TRI constituents. A value greater than 1 would suggest         ~




that the constituent was of greater than average toxicity relative to the list of TRI constituents,
and a value less than 1 would suggest that the constituent was of less than average toxicity
relative to the list of TRI constituents.                                                               _

    To ensure that the toxicity ratios for each benchmark always increase with increasing toxicity,
two different equations were needed to account for the two possible relationships between the
value of the benchmark and the toxicity of the constituent. For some benchmarks, a smaller
value reflects greater toxicity; for others, a larger value reflects greater toxicity.

    For all dose-based benchmarks (Le., RfDs, RfCs, LDSOs, LCSOs, and NOAELs), toxicity
increases as the benchmark value decreases: a chemical that elicits an adverse effect at a lower
dose is more toxic than a chemical that elicits an equally adverse effect at a higher dose. For
these benchmarks, the toxicity ratio was calculated by dividing the constituent-specific benchmark
into the geometric mean for the same benchmark. By placing the benchmark in the denominator,
a lower benchmark value (reflecting a more toxic constituent) would result in a higher toxicity
ratio, as desired. Mathematically, this relationship is illustrated in the following example for
formaldehyde. The oral RfD for formaldehyde is 2.00x10-' mgAg/day @US, 1992) and the
geometric mean of the RfD values for TRI constituents is 1 . 7 2 ~ 1 0mg/kg/day. Therefore, the
                                                                         -~
toxicity ratio for chronic systemic effects by the oral ingestion pathway is given by the ratio of
the RfD-geometric mean to the RfD for formaldehyde as shown below.

                 &D-geometric mean      -
                                        -   1.72 x lod2mg/kg/day = 8.6
                     oral IgD               2.00 x 1 " mg/kg/day
                                                    0


   This toxicity ratio suggests that the chronic systemic toxicity of formaldehyde is less than the
"average" TRI constituent by over an order of magnitude.

    For non-dose-based benchmarks, (i.e, CSF and BCF), toxicity increases as the benchmark
value increases: a CSF measures not dose but potency, and a BCF measures the potential to
bioaccumulate, which is associated with increased aquatic toxicity. For these benchmarks, the
toxicity ratio was calculated by dividing the geometric mean for each benchmark into the
constituent-specific benchmark. By inverting the equation and placing the benchmark in the
numerator, the appropriate relationship between toxicity ratio and the toxicity of the constituent is
maintained: a higher benchmark value (reflecting a more toxic constituent) would result in a
higher toxicity ratio, as desired. Mathematically, this relationship is illustrated in the following
example for benzidine. The oral CSF for benzidine is 2 x 10' (mg/kg/day)-' and the geometric
mean of the oral CSF values for TRI constituents is 4.24 x lo-' kg-day/mg. Therefore, the
toxicity ratio for chronic carcinogenic effects by the oral pathway is given by the ratio of the
constituent-specific CSF to the CSF-geometric mean as presented below.



                                                                                           Page 2-37
                         oral CSF      - 2.00 x     @-daYhg             E   4.7   102
                    CSF-geometric mean   4.24 x 10-1 Isg-&y/mg

       In this example, the toxicity ratio suggests that the carcinogenic potency for benzidine is
   greater than the "average" TRI constituent by over two orders of magnitude.

       Toxicity ratios were calculated by the appropriate equation above for each TRI constituent for
   all of the available health and ecological benchmarks. The resulting toxicity ratios are compiled
   in Appendix D, Table D-2.


   2.4.1.3 Selection of Relative Toxicity Indices

       The fmal step in generating toxicity indices was to combine the toxicity ratios for the 10
   health and ecological effects benchmarks into a useful and meaningful representation of toxicity.
   While generating a single toxicity index for each constituent had a certain appeal, combining
   measures of human health effects with measures of ecological effects, or measures of acute
   toxicity with measures of chronic toxicity raised a number of issues conceming the appropriate
   use of the data. RTI and NCPPP determined that such combinations of human and ecological or
   acute and chronic data were inappropriate and that separate toxicity indices would be needed for
   acute effects, chronic effects, and ecological effects. In addition, differences in toxicity of many
   constituents by the oral route versus the inhalation route and differences in expected exposure
   routes for each environmental media led to the additional division of the toxicity indices by
   environmental media (air, soil, or water). This resulted in seven toxicity indices: acute air,
   chronic air, acute s i ,chronic soil, acute water, chronic water, and ecological water. Because
                       ol
   ecological toxicity data were available only for aquatic species, ecological toxicity was only
   considered for water.

       To generate the toxicity indices listed above, the applicable health benchmarks were identified
   for each toxicity index. For air, only inhalation benchmarks were used. For water, only oral
   benchmarks were used. For soil, both oral and inhalation benchmarks were used, reflecting the
   potential for both ingesting soil and inhaling airbome soil particles. Table 2-17 identifies the
   benchmarks applicable to each toxicity index. In most cases, more than one benchmark applies,
   raising the question of how to combine ratios for multiple benchmarks to obtain a single index.
   In most cases, summing the ratios across applicable benchmarks was considered inappropriate for
   two reasons. First, the different benchmarks represent different toxicological effects. Second,
   due to variable amounts of constituent-specific data, summing applicable ratios could result in a
   higher toxicity index for a well-characterized constituent compared to a poorly-characterized
   constituent of similar toxicity. Therefore, in most cases, when multiple ratios were available, the
   highest one was selected as the toxicity index.

       One exception was made to the decision not to s u m ratios. Measures of lethality for aquatic
   systems (Le., LCSOs for water fleas and bony fish) were summed on the basis of similar
   toxicological effects. The water ecological index was then based on the higher toxicity ratio
   between the combined acute lethality and the bioconcenuation factor.



Page 2-38
Table 2-17. Toxicity Benchmarks Used for each Toxicity Index




                                                               Page 2-39
       The resulting toxicity indices are shown in Appendix D, Table D-3.


   2.4.1.4 Using the Relative Toxicity Indices

       The acute health, chronic health, and ecological toxicity indices were incorporated into the
   WRMS data base. The indices can be paired with annual release data to evaluate emission
   sources on the basis of toxicity through a specific exposure route; for example, air emissions
   would be paired with chronic or acute air toxicity indices. Relative toxicity scores are calculated
   by multiplying the quantity released by one of the relative toxicity indices. These calculations
   are performed in a B a s e report format; Table F-8 shows a sample of a report containing a
   toxicity score calculation. In this example, the quantity released to water is multiplied by the
   relative chronic toxicity index to calculate the relative chronic toxicity score.

       This combination of the acute, chronic, and ecological toxicity ratios and the annual emissions
   data normalizes emissions for toxicity, enabling the comparison of different emission sources on
   a chemical by chemical or facility by facility basis by comparing toxicity scores. The annual
   release data are both pollutant- and facility-specific, allowing the relative toxicity scores to be
   grouped and aggregated by environmental media, acute and chronic health effects and ecological
   effects, w m e stream, facility, region, state, and industry. These toxicity assessments will provide
   a very different view of pollution prevention progress and allow the prioritization of industries,
   facilities, and waste streams based on the potential for toxicity reduction.


   2.4.2 Environmental Mobilitv and Persistence Scoring System

       The environmental mobility and persistence scores were developed for use with the relative
   chronic toxicity index for TRI constituents contained in the WRMS data base. The development
   of Constituent-specific environmental mobility and persistence modifiers for air, water, and soil
   consisted of three phases: (1) data collection, (2) interpretation of numerical values, and (3)
   media scoring for mobility and persistence. These steps are described in detail in the following
   sections.


   2.4.2.1 Environmental Fate Data Collection

       Data were collected on eight physicochemical parameters as surrogate measures for mobility
   and persistence in the environment for all TRI Constituents. These parameters represent the best
   available measures of environmental fate and transport in the absence of measured values. The
   surrogate parameters for environmental fate and transport (e.g., solubility, log P, vapor pressure,
   etc.) represent well-accepted physicochemical characteristics for estimating mobility and
   persistence.

      Mobility scores were based on vapor pressure, solubility in water, and soil adsorption
   coefficient (log Koc). Constituents exhibiting a high vapor pressure would tend to be highly
   mobile in air. Similarly, constituents that are highly soluble in water would tend to be highly
   mobile in water. The soil adsorption coefficient (log Koc) is a measure of mobility in soil;


Page 2-40
constituents that have a low log Koc would tend to be mobile in soil.

    Persistence scores were based on biodegradation category, BOD half-life, or the log of the
octanoVwater partition coefficient for water and soil, and on residence times or air half-times for
                                                                                                       -
air. The biodegradation category was specifically taken from the EPA Hazardous Waste TSDF
Background Document cited below and represents a synthesis of data on environmental
persistence of selected organic compounds. A "high biodegradation value corresponds to low
persistence, since a constituent that is highly biodegradable would not be persistence in the
environment. Persistence is sometimes measured experimentally and reported as a function of the
half-life for biological oxygen demand (BOD 1/2-life). The BOD 1/2-life refers to the amount of
time required by microorganisms to break down one-half of the mass of a constituent; a shorter
BOD l/2-life means that a constituent is more easily degraded in the environment. Absorption
coefficients are derived from laboratory experiments and approximate the tendency for chemical
constituents to sorb to organic matter. The most common absorption coefficient, the log of the
octanoUwater partition coefficient (log P), is frequently used to estimate the persistence of a
constituent in an aqueous media. The higher the log P, the less water soluble the constituent, and
the more likely that the constituent will resist dissociation and/or degradation in water.
Persistence is sometimes measured in terms of residence times, particularly for air. Residence
times (and air half-times) include other methods of decay besides biological (e.g., photolytic) and,
as with BOD 1/2-life, a shorter residence time denotes a less persistent constituent.

    In addition to standard engineering and chemical handbooks, the primary sources of data
included the following:

   Assessment Tool for Environmental Risk (ASTER1 - EPA data base containing measured and
      calculated values for physical and chemical properties. Specifically, ASTER was searched
                                                                                          )
      for vapor pressures, water solubilities, octanol-water partition coefficients (log P ,
      adsorption coefficients (log Koc), and biological oxygen demand (BOD) half 1'  -  ives.

                                               -
   Hazardous Substances Data Bank (HSDB) Online factual data bank operated by the National
      Library of Medicine that contains scientifically reviewed and edited data on various
      subjects, including chemical and physical propeaies and environmental fate/exposure
      potential. HSDB was used to supplement ASTER.

   US EPA Hazardous Waste TSDF Backnround Document - EPA document containing
      background information on proposed air emission standards under the Resource
      Conservation and Recovery Act. This information included tables of chemical properties
      for selected constituents. Specifically, the TSDF document provided biodegradability
      values for a select group of constituents, and value ranges to categorize vapor pressure,
      water solubility, and log P.

   L.T. Cuuitt. Fate of Toxic and Hazardous Materials in the Air Environment. - EPA document
      containing various air fate and transport parameters, including air residence times for a
      select number of constituents.

   US EPA Suuerfund Public Health Evaluation Manual - EF'A document containing public
       health assessment information for Superfund sites, including data for key physical,

                                                                                             ~~




                                                                                         Page 2-41
            chemical and fate parameters. Specifically, this document was used as a secondary source
            for air half-times, and to fill-in missing vapor pressures, water solubilities, adsorption
            coefficients, and octanol-water partition coefficients.

       US DOE Chemical Data Bases for the Multimedia Environmental Pollutant Assessment
          System (MEPAS) - DOE model documentation containing toxicological and fate and
          transport data. Specifically, this document provided air half-times for most constituents,
          and was used to f i i data gaps left by the other primary and secondary sources.


       Table 2-18 provides a convenient summary of the eight environmental fate and transport
   surrogate parameters, primary and secondary sources of data, numeric ranges and categories (Le.,
   high, moderate, low) for data, and the source for category delimiters. The values for the fate and
   transport parameters for a l TRI constituents are shown in Appendix D, Table D-4.
                             l


   2.4.2.2 Interpretation of Numerical Values

       W e numerical values for the surrogates for environmental fate and transport are useful tools
   for estimating mobility and persistence, using the values on a relative scale similar to the relative
   toxicity index does not address the enormous variability inherent in the behavior of constituents
   in the environment. For example, pH can profoundly influence soil mobility of certain organic
   chemical species such as constituents with functional acid, alcohol, or amine groups (e.g.,
   pentachlorophenol). These organic constituents can exist mainly as charged species (e.g., anions)
   in the soil environment, which greatly increases solubility and mobility in the subsurface. If
   charged species are present, mobility in the subsurface can be significantly higher than expected.
   Therefore, to reflect the lack of precision in estimates of mobility and persistence based on the
   surrogate parameters, the parameters were scored as high, moderate, or low based on numerical
   ranges accepted by EPA. If numerical ranges were unavailable, the parameters were scored as
   high, moderate, or low based on a statistical analysis of the data. Four parameters (log Koc,
                                            i
   BOD ln-life, air residence time, and a r half-time) required statistical analysis of the data in
   order to assign categories for high, moderate and low. Since the distribution of values resembled
   a normal distribution in each case, the data were simply divided into three approximately equal
   ranges and assigned to the appropriate categoly. The distributions are shown in Figures D-1
   through D-4 in Appendix D.

       Table 2-19 summarizes the surrogate parameter ranges used to assign each constituent a high,
   moderate, or low score for mobility and persistence in air, water, or soil. In the case of mobility,
   there was only one surrogate for each medium, so the category for that surrogate was used. For
   persistence, several parameters were applicable to each medium. The order of the parameters as
   shown in Table 2-19 reflects the hierarchy used to assign a category. For water and soil, the
   biodegradation category was used if available. These categories were considered the best
   surrogate for persistence because they represent a synthesis of persistence data by EPA. If
   biodegradation category was not available, then BOD half-time was used; if that was not
   available, then log P was used. BOD half-time was considered a better surrogate for persistence
   than log P because it is a time-based parameter, which is expected to correlate more closely with
   persistence than log P. For air, if data on both residence time and air half-time were available,


Page 2-42
Table 2-18. Data Collection Guidelines for Fate and Transport Parameters




                                                                                                  Cupiff


                                                                                                                 Superfund

1)   Surrogate Mobility and Persistence Categories
                                                                                                                             I1

I    Source of
     Categories

     Notes
                  I ;-- 1
                     1 ;1
                   TSDF          TSDF
                                              Stat.
                                              Analysis
                                                            EPA-
                                                            TSDF

                                                            B
                                                                        Typical
                                                                        Ranges
                                                                                       EPA-
                                                                                       TSDF
                                                                                                  Typical
                                                                                                  Ranges
                                                                                                                 stat.
                                                                                                                 Analysis

                                                                                                                 C




     C: When Air Half-timu were net available. the default value o 6.9~10'days Oligh Air Persistence) pmvided by the
                                                                 f
     Multimedia Environmental Pollutant Asscssmcnt System (MEPAS) documentation w s used.
                                                                                    a
                                                                                                                             I
                                                                                                                             J




                                                                                                                             Page 2-43
   Table 2-19. Matrix for Evaluating Mobility and Persistence of TFtI Constituents

                                    Mobilitv                             Persistence
                                solubility (mgIL)                      Biodegradation
                        high = > 4000                        high = EPA Biodeg. category Low
                                         -
                        moderate = 4000 100                  moderate = EPA Biodeg. cat. Medium
                        low = < 100                          low = EPA Biodeg. category High

                                                                        BOD 112 life
                                                             high = > 1 year
                                                                                -
                                                             moderate = 1 yr. 1 mo.
                                                             low = c 1 mo.

                                                                              108 P
                                                             high=>5
                                                                          -
                                                             moderate = 5 3
                                                             lOw=c3
                                    log Koc                          Biodegradation
                       high = c 1.9                         high = EPA Biodeg. category Low
                       moderate = 1.9 - 2.8                 moderate = EPA Biodeg. cat. Medium
                       low = > 2.8                          low = EPA Biodeg. category High

                                                                       BOD 1/2 life
                                                            high = > 1 year
                                                            moderate = 1 yr. - 1 mo.
                                                            low = < 1 mo.

                                                                              108 P
                                                            high=>5
                                                            moderate = 5 - 3
                                                            lOw=<3
                           vapor pressure (mm Hg)                 residence times (ahys)
                       high = > 9.98                        high = > 1 year
                       moderate = 9.98 - 9.98 x 10"         moderate = 1 yr. - 1 day
                       low = < 9.98 x 10"                   low = < 1 day

                                                                   air ha[f-times (days)
                                                            high=>40
                                                                          -
                                                            moderate = 40 3.7
                                                            low = < 3.7




Page 2-44
whichever gave the higher category was used. These two time-based parameters were considered
to be equally good surrogates for persistence in air.


2.4.2.3 Media Scoring for Mobility and Persistence

    The final step in the mobility and persistence analysis was to generate a modifier or modifiers
that could be used with the relative toxicity indices to evaluate relative hazard. Several criteria
were established for these modifiers to ensure that they would provide a usable tool for
prioritizing waste streams/facilities/industries on the basis of risk:

    1. the modifiers should allow comparison of all constituents, and
    2. the modifiers should allow the user substantial flexibility to assess hazard in a way that
       meets their individual needs.

To meet these criteria, six quantitative environmental fate modifiers were developed for mobility
in air, mobility in water, mobility in soil, persistence in air,persistence in water, and persistence
in soil. The altemative selected for the mobility and persistence scoring system was, in part, a
policy decision and was based on discussions with NCPPP, scientific judgement, and the need to
integrate mobility and persistence descriptors with the chronic, relative toxicity index so that
emissions data could be normalized across facilities and industries for each media.

    A simple numerical scheme was designed to score each medium for mobility and persistence.
Mobility and persistence were each assigned a numerical value of 0.75 for high, 0.50 for
moderate, and 0.25 for low. In absolute terms, the numerical values do not have any physical
meaning. The values were selected to reflect the relative order of the environmental mobility and
persistence descriptors and to provide a simple scale amenable to conversion to fractions. A
narrow scaling range was chosen so that fate and transport considerations would not overwhelm
the relative toxicity index when combined, and the numerical values were chosen to be consistent
with the range of relative chronic toxicity values, roughly between IO-* to Id. An altemative,
qualitative approach was considered that would simply relate the relative chronic toxicity with the
mobility and persistence descriptors. For example, the relative chronic toxicity of benzidine
would be 4.7 x         via ingestion of soil with mobility and persistence modifiers of moderate.
While the qualitative approach obviates the need for numerical interpretation of the fate and
transport descriptors, such an approach would only allow the comparison of emissions for
constituent sets with identical descriptors for mobility and persistence. The quantitative approach,
on the other hand, does allow comparison among all constituents.

    Another altemative considered was the combination of mobility and persistence modifiers into
a single modifier for each media. However, this raised the question of how heavily each should
be weighted in the combined modifier. In particular, should persistence be weighted more
heavily than mobility? Depending upon the exposure pathway, endpoint, and receptor, mobility
may or may not increase the degree of hazard, but persistence always increases the degree of
hazard. EPA has traditionally viewed high mobility as contributor to the overall risk since more
humans and wildlife could be exposed. However, low mobility might also increase local risks to
humans and the food chain if constituents are introduced into the food chain and bioaccumulated
up the trophic levels. PCBs are classic examples of this phenomena as they frequently sorb to


                                                                                           Page 2-45
   the high carbon content in aquatic sediments and are accumulated and bioconcentrated in each,
   successive level of aquatic life. In fact, any weighting used would not reflect the needs of all
   users; such a weighting is a policy decision and is more appropriately addressed at the program
   level. Separate modifiers for mobility and persistence provide the user with the flexibility to do
   this.

       Again, one of the most important considerations in designing the mobility and persistence
   scoring scheme was to develop a tool to adjust relative toxicity based on persistence and mobility
   into a useful representation of hazard. The resulting mobility and persistence modifiers are
   shown in Appendix D, Table D-5.


   2.4.2.4 Using the Environmental Fate Modifiers

       The mobility and persistence modifiers for air, water, and soil were incorporated into WRMS.
   The user can combine the relative chronic toxicity values with the media-specific environmental
   fate modifiers according to their needs. It is not recommended that environmental fate modifiers
   be combined with acute or ecological toxicity indices, since persistence and mobility are not
   likely to affect acute health r s significantly, and their effect on ecological risk is not clear.
                                  ik

       To create a relative hazard index, the user must first calculate an environmental fate modifier
   for each media which is simply a weighted sum of the mobility modifier and the persistence
   modifier. Users may weight mobility and persistence in accordance with their needs. For
   example, benzidine received a "moderate" score (0.5) for mobility and a "low" score (0.25) for
   persistence in water; if the user weights mobility and persistence equally, the environmental fate
   modifier for benzidine in water would be 0.50 + 0.25 = 0.75. The relative hazard index may
   then be calculated by multiplying the environmental fate modifier by the appropriate chronic
   relative toxicity index. Continuing with the example for benzidine, the relative hazard index
   would be derived for water by multiplying the environmental fate modifier of 0.75 b the chronic
   relative toxicity index of 4.7 x                                                     zy
                                        to produce a relative hazard index of 3.53 x 10- for
   benzidine in water. This relative hazard index may then be used to normalize emissions in the
   same way an unmodified relative toxicity index is used (see Section 2.4.1.4).

       All of these calculations are done in dBase report formats; Table F-8 shows a sample of a
   report that contains relative hazard score calculations. Since a relative hazard score is not
   calculated by WRMS, the user is left with substantial flexibility in how mobility and persistence
   should be integrated with the relative toxicity index. As discussed earlier, the use of mobility
   and persistence values for describing the degree of hazard is partly a policy decision which is
   more appropriately addressed through individual program needs and goals.




Page 2-46
                            3.0 WRMS DATA BASE MANAGEMENT


    WRMS was designed to be updated annually with new release data. The relative toxicity                ~




indexing scheme may also need to be updated periodically as health benchmarks change or new toxic
chemicals are added to the coverage of WRMS. This section describes these update processes;              ~




Section 3.1 covers release data updates and Section 3.2 covers relative toxicity index updates. These
sections focus on the concrete aspects of performing these updates; for a more conceptual discussion
of how release data are converted and relative toxicity indices are calculated, see Sections 2.3 and     ~




2.4, respectively.

   Throughout this section, the following typographical conventions are used

       Commands to be typed are shown in Courier. Special keys to be pressed are shown in
       Courier in angle brackets, as <Enter>,meaning to press the Enter key.

       File names are shown in italics.

       Field names are shown in UPPERCASE.

    The term "reporting year" is used throughout this section to mean the calendar year for which
data are reported. The "current reporting year" is the reporting year for which data are currently
                                                                              uig
being converted. For example, 1991 data will likely be converted in 1993. D r n that conversion,
the current reporting year will be 1991, not 1993.


3.1 RELEASE DATA UPDATES

    Updating WRMS each year involves obtaining the data needed from each data source and
converting the data to the WRMS format. All of the data sources incorporated in WRMS are
available electronically as dBase or ASCII text files, so no data entry is required. The conversion
process has been largely automated in a utility program called Convertprg. This is a menu-driven
program that allows the user to choose a data source and then converts the data to WRMS format
with some interaction from the user. Any activity referred to as automated is performed by the
conversion program, and any activity referred to as manual is performed by the user (but possibly
within the conversion program). The conversion program displays a status screen during each
automated segment showing the progress of the conversion activity being performed.

     The remainder of Section 3.1 is organized as follows: Section 3.1.1 describes the conversion
utility and its use on a general level; Sections 3.1.2 through 3.1.6 describe how to perform an update
for each data source, from requesting and obtaining the pertinent data to using the conversion
program for that data source. The purpose of Section 3.1 is to guide the reader through updating the
WRMS release data. To that end, the workings of the conversion program are discussed only to the
extent that they affect the user's ability to use the program; completely automated segments are
generally not discussed. For a more detailed discussion of the actual data manipulations performed
in release data conversion, see Section 2.3. The code of the conversion program is listed in
Appendix C.


                                                                                              Page 3-1
   3.1.1 Using the Conversion Program

       The user starts the conversion program by selecting Convert.prg from the B a s e Control
   Center. The first menu in the conversion program is the Data Source Selection Menu, which lets
   the user choose one of the five data sources to convert: TRIS,Annual Report (NCAR), NPDES,
   Pretreatment, or AIRS (NEDS). The user may also exit to B a s e from this menu. Menu choices
   may be highlighted using the up and down arrow keys; once the desired choice is highlighted, the
   user selects it by pressing <Enter>.

       Following the selection of a data source, the conversion program creates working fides
   automatically if they do not already exist. Working files would already exist if the user had
   started a conversion and not yet completed it. The user may have several conversions from
   different data sources in progress at once, but only one for each data source, since there can only
   be one set of working fides at a time for each data source.

       After the conversion program has created or located the working fides, a second menu, the
   Conversion Activities Menu, lets the user choose one of the three conversion activities: facility
   matching, chemical matching, or emissions conversion. These steps must be performed in the
   order listed; the conversion program will not allow them to be performed out of order. Since
   TRIS is the primary data source for WRMS, facilities are added to WRMS from TRIS, but not
   from the secondary data sources. Therefore, the facility matching for TRIS for a particular
   reporting year should always be completed before facility matching for any other source for the
   same reporting year so that the appropriate facilities are included in the F c l t fide. The
                                                                               aiiy
   conversion program cannot detect whether this has occurred, and so cannot enforce it, but the
   user should ensure that TRIS facility matching is done before facility matching for,other data
   sources.

       The conversion activities are provided in menu format to facilitate suspension of a partially
   completed conversion for resumption at a later time. The user may suspend a conversion by
   retuming from the Conversion Activities Menu to the Data Source Selection Menu and then
   exiting to B a s e . The user is always returned to the Conversion Activity Menu between each
   conversion activity (e.g., after facility matching or chemical matching). In addition, the user may
   elect to suspend conversion in the middle of certain conversion activities; the specific times when
   this is possible vary by data source and will be described in Sections 3.1.2 through 3.1.6.

       Each step of the conversion process (creating working fides, facility matching, chemical
   matching, and emissions conversion) is discussed in general in the remainder of this section.
   Each of these steps is somewhat different for each of the various data sources; Sections 3.1.2
   through 3.1.6 provide more specific information on the conversion process for each data source.


   3.1.1.1 Creation of Working Files

       When a new conversion is started, the conversion program takes the original data fides and
   creates one or more working fiiles in the format required by the rest of the conversion program.
   The working files contain a l the fields from the original data fdes plus some additional fields
                              l
   used in the conversion process (e.g., fields for WRMS Facility or Chemical IDS). For most data


Page 3-2
sources, all of the records in the original data file are included in one of the working files
(although records may be divided into two or more different working files based on certain
attributes). Exceptions to this will be discussed as necessary in Sections 3.1.2 through 3.1.6.
The working files should not be deleted by the user; the conversion program will delete them
when conversion is complete.

    The conversion program requires the original data fiies to contain data for only one reporting
year and to be in a specific format, which differs for the different data sources. The required
formats of the original data files and the formats of the working fides created by the conversion
program are detailed in Appendix B. If the format of any of the source data files changes in the
future, both the working file format and the conversion program may need to be modified to
reflect the change. The structures for the working files are stored in dBase files, which can be
edited to reflect changes in the structure of the source data. Any program references to new,
modified, or deleted fields in the working files will need to be added, modified, or deleted
accordingly.

    This section of the conversion program is mostly automated, but may require interaction or
input f o the user. For example, the user may be asked to enter the reporting year of the data
       rm
being converted. Also, any EPA IDS or NPDES Permit Numbers not starting with NC are shown
to the user for manual correction of typographical errors.


3.1.1.2 Facility Matching

    WRMS covers all facilities that report under TRI, and only those facilities. Therefore, data
from TRIS are included for all facilities reporting, while data from other data sources are
included only for facilities in TRIS. As a result, facilities may be added to WRMS from TRIS,
but facilities are never added from other data sources. Since the WRMS Facility file is altered
by the facility matching process for TRIS, it is much more rigorous than the facility matching
process for other data sources for which the Facility file is merely searched.

    For TRIS data, facility matching consists of a combination of automated matching (based on
EPA ID, NPDES Permit Number, and TRI Facility ID) and manual checking to determine
whether each facility in the TRIS data file matches one of the facilities already in the WRMS
Facility file. If a match is found, the W R M S Facility ID is copied to the TRIS working file. If
no match is found, a new record is created for the WRMS Facility file. The detailed steps used
in matching and checking matched facilities for TRIS data are discussed in more detail in Section
3.1.2.2.

    For all other data sources, facrity matching within the conversion program is completely
automated; the working file and the W R M S Facility fiile are linked on the facility identifier (e.g.,
EPA ID for NCAR, NPDES Permit Number for NPDES) used in the particular data source and
the WRMS Facility ID copied to the working file for all matched facilities. Any unmatched
facilities and their associated data are deleted from the working file. Every attempt has been
made to verify the facility identifiers in the WRMS Facility file to ensure accurate facility
matching. To minimize the number of missed or incorrect matches, the facility data for each
source were used manually to check the accuracy of the identifier information in the WRMS


                                                                                              Page 3-3
   Facility file. This was done outside the conversion program, and should be repeated each year to
   check the accuracy of identifiers for new facilities added to WRMS from TRIS before automated
   facility matching is done.


   3.1.1.3 Chemical Matching

       This part of the conversion program automatically matches chemicals and other pollutants
                                                                                        l
   found in the original data sources with the pollutants in the WRMS Chemical fie. A l of the
   data sources except NCAR report pollutants from clearly defined lists, which are included in the
   Chemical f i e to ease chemical matching and limit the need for the addition of new Chemical
   records. Those lists are the SARA Title III List of Lists for TRIS,' all STORET parameters
   requested for the NPDES and Pretreatment data, and all criteria pollutants reported to NEDS.
   Hazardous wastes reported to NCAR, on the other hand, are identified by up to six codes (four
   hazardous waste codes, a physical form code, and a source code). Since there are a huge number
   of possible combinations of these codes, no attempt was made to enter all of the possible
   combinations in the Chemical file.

       Pollutants from all data sources except NCAR are matched using a variety of identifiers, such .
   as CAS number or STORET parameter code. Because the lists these pollutants are drawn from
   are already entered in the Chemical file, the addition of new chemicals or pollutants to the
   WRMS Chemical file should be an uncommon occurrence for these data sources. Therefore, the
   user is allowed to check unmatched pollutants manually before new Chemical records are created
   and either assign a Chemical I or flag the pollutant explicitly for addition to the WRMS
                                  D
   Chemicaf file. Any flagged pollutants are then added to the WRMS Chemical f i e by the
   conversion program. Hazardous wastes from NCAR are matched using the four hazardous waste
   codes, the physical form code, and the source code. Because no list of hazardous wastes was
   entered into the Chemical file, the addition of new Chemical records should be quite common for
   NCAR data. Therefore, if no match is found, a new record is added to the Chemical file
   automatically, without intervention by the user.


   3.1.1.4 Emissions Conversion

        This part of the conversion program creates new records for the WRMS Emission and Status
   files using the data in the working files. Depending on the format of the source data, this may
   involve calculations to convert units to lbs/year and aggregation of emissions to the facility level.
   It is completely automated for all data sources; therefore, it will not be discussed further in this
   section. Sections 2.3.1 through 2.3.5 provide a description of how emissions are converted for
   each data source.



           The Title IIl List of Lists includes chemicalsreferencedunder four federal statuatoy provisions, as follows:
           SARA Section 302 Extremely Hazardous Substances, CERCLA Hazardous Substances (RQ chemicals),
           SARA Section 313 Toxic Chemicals, and RCRA Hazardous Wastes from the P and U Lists only (which
           consist of specific chemicals). Only the Section 313 chemicals are actually covered by TRI; the others were
           included for completeness and to minimize the need to add chemicals i the future.
                                                                                    n


Page 3-4
3.1.2 Toxic Release Inventon, System (TRIS)

3.1.2.1 Getting and Preparing the Data

    TRIS is maintained on the EPA’s NCC IBM computer in Research Triangle Park. Its
structure changes somewhat from year to year. It consists of several files; data for WRMS were
drawn from three of these: the Submission file, the Name-Address file, and the Release-Transfer
file. The Submission file contains facility and chemical information specific to each TRI
Reporting Form R submission, which provides information on one facility and one chemical.
This file also contains information on waste minimization for each facility and chemical. Each
Form R submission is identified in TRIS by a document control number; this number is found in
the Submission and Release-Transfer fies and may be used to link them. The Name-Address file
contains information of facility names and addresses. Each facility is identified by a TRI Facility
ID,which is found in both the Name-Address file and the Submission fie, and may be used to
link them. The Release-Transfer file contains information on releases to different media (fugitive
a r stack air,water, underground injection, and land) and transfers off-site (to POTW or TSDF).
 i,
This fie typically contains multiple records for each Form R submission. Each record represents
a release to one media or a transfer to one type of facility. There may also be multiple records
for one type of release or transfer when the releases are to different waterbodies or reflect a
different type of release to land (e.g., landfii vs. surface impoundment) or when transfers are to
two or more different facilities.

     The user should extract the TRIS data needed for WRMS from TFUS using a combination of
NATURAL and SAS programming. The NATURAL portion of the program extracts the desired
data set, consisting of Submission and Name-Address records for all facilities in North Carolina
for the desired reporting year and a l Release-Transfer records corresponding to those Submission
                                    l
records. The resulting data set is in ADABASE format; the SAS poltion of the program converts
it to ASCII format for downloading. A sample of part of the combined NATURAL/SAS
program used in previous updates is shown in Appendix C. The program for extracting TRIS
data will probably have to be modified from year to year as the structure of TRIS changes. Once
the data have been successfully extracted and converted to ASCII format, the user should
download the ASCII files and reconstruct them as B a s e Ties with the structures shown in
Appendix B, Tables B-1 and B-2, one containing Submission and Name-Address data and the
other containing Release-Transfer data. The user should name these files Submissndbf and
Releuse.dbf, respectively, and copy them to the subdirectory \WRMSll2IS.

     The conversion program creates two working files called Submextdbf and Relexr.dbf (for
submission extended and release extended) from the downloaded data files. The structures for
these files are shown in Appendix B, Tables B-10 and B-11. The conversion program appends
all records from the TRIS data fies to the working files, with the exception of Submission
records missing both the chemical name and CAS number. The Release-Transfer records
associated with the omitted Submission records are appended to the working f i e Relext.dbf, but
are ignored by the conversion program when converting emissions. Release-Transfer records
reflecting releases to underground injection are also ignored.

    The conversion program checks all EPA IDSand NPDES Permit Numbers in the Submextdbf
file for entries that do not start with NC, as would be expected for facilities in North Carolina.


                                                                                          Page 3-5
   Entries such as NA (for not available) are erased and capital Os replaced with zeros automatically
   before this step.2 The user is then shown any nonstandard EPA IDS or NPDES Permit Numbers
   for possible correction. If the identifier is indecipherable, the user should delete it. Examples of
   indecipherable identifiers include very short NPDES Permit Numbers, especially those ending
   with R and a number. If the problem is a typographical error (e.g., MC instead of NC) the user
   should correct it. However, facilities located in North Carolina may occasionally have an EPA
   ID coded for another state; if the letters are an accurate abbreviation for another state, even if
   they look like they might be a typographical error (e.g., NY), ID should probably be left as
                                                                     the
   is. Once all nonstandard IDShave been corrected, the interactive mode will terminate
   automatically. If one or more nonstandard IDS are to be left as is, the interactive mode must be
   terminated by the user by pressing <Ctrl-End>.


   3.1.2.2 Facility Matching

      Because facilities may be added to the W R M S Facility file from TRIS,the facility matching
   process for the TRIS data is fairly rigorous. The following steps are performed for each facility:

       1. Automated facility matching using EPA ID, NPDES Permit Number, and TRI Facility ID
       2. Manual check of facilities unmatched after step 1.
       3. Automated assignment of W R M S Facility IDS to facilities still unmatched after step 2.
       4. Manual check of matched facilities from step 1 for which discrepancies exist between
          other identifiers or the facility name or address.
       5. Automated update of selected facility data in WRMS using TRIS data.

   This process was designed to automate the facility matching as much as possible while still
   providing a manual check for both missed matches and incorrect matches to ensure the accuracy
   of the facility data. ALI of these steps are performed within the conversion program. The steps
   are described in more detail in the following paragraphs. The automated steps are described as
   well as the manual steps, because it is helpful to understand the automated steps to properly
   perfom the manual ones. AU of these steps operate on the TRIS Submextdbf working file
   and/or the W R M S Facility fide. The user is given the option to quit and resume later after each
   of the five steps. The user may also quit during either of the manual steps and resume later at
   the same point.

      Note that because TRIS is the primary data source for W R M S , the facility matching for TRIS
   must be completed before the facility matching for any other data source for the same reporting
   year, so that the appropriate facilities are included in the Facility fie.

       In the first step, the conversion program compares the following fields (or parts of fields) for
   the facilities reported in TRIS to the same fields for facilities already included in WRh4S: EPA




           Note that it would not be desirable to do an automatic replacement of capital Os for data from a state with
           0 in its abbreviation, like OH or MO.


Page 3-6
ID, NPDES Permit Number, TRI Facility ID? city, facility name (fist 5 characters), and street
address (fist 10 characters). Each facility falls into one of the following categories:

       Solid match found: the conversion program found a WRMS facility for which a least one
                                                                                      t                                   -
       of the 3 identifiers (EPA ID, NPDES Permit Number, TRI Facility ID) matches, and for
       which all other fields listed above that are not blank match. The conversion program                               ~




       assigns solidly matched facilities a permanent WRMS Facility ID and enters it in the
       TRIS working f i e (Submext.dbf). Solid matches are not reviewed manually for accuracy.

       Tentative match found: the conversion program found a WRMS facility is found for
       which at least one of the 3 identifiers (EPA ID, NPDES Permit Number, TRI Facility ID)
       matches, but one or more of the other fields listed above that are not blank do not match.
       The conversion program assigns tentatively matched facilities a permanent W R M S Facility
       ID, enters it in the TRIS working file (Submextdbj), and flags the facility as a possible
       mismatch. Tentative matches are reviewed manually for accuracy in step 4.

       No match found: the conversion program found no WRMS facility is found for which any
       of the 3 identifiers (EPA ID, NPDES Permit Number, TRI Facility ID) match. The
       conversion program creates a new W R M S Facility record for unmatched facilities and
       assigns a temporary W R M S Facility ID. This is entered both in the new Facility record
       and the TRIS records, and provides a link between the Facility fie and the TRIS data.
       This temporary Facility ID differs from the permanent WRMS Facility ID in that it
       always begins with a T and is followed by five-digit serial number; the permanent WRMS
       Facility IDS begin with the first four characters of the facility name and is followed by a
       unique six-digit serial number. Temporary and permanent Facility IDSare entered in
       separate fields. If a correct match exists but was missed by the automated matching
       routine, the new Facility record duplicates an existing Facility record. The automated
       matching routine typically misses a match because the facility did not report an EPA ID
       or NPDES Permit Number and the TRI Facility ID is not usable or has changed since the
       previous reporting year. Unmatched facilities are reviewed manually for duplicates
       (missed matches) in step 2.

    In the second step, the user checks the new WRMS Facility records manually for matches
(duplicates) among the existing W R M S Facility records. The conversion program displays the
Facility fie in order by city and facility name to facilitate the identification of duplicated Facility
records; in this order, most duplicated Facility records are adjacent to each other or only a few
records apart. The user can scan down the fiie, looking for new Facility records (records with a
temporary WRMS Facility ID) and compare them with the other records nearby.

   Three outcomes are possible for each new Facility record:

    1. The new Facility record matches no other Facility record, and is therefore genuinely a
       new facility. In this case, the user need do nothing. Records that are not duplicates do


       The TRI Facility ID consists of the 5-digit zip code, the 6rst 5 consonants of the facility name, and tbe first
       5 nonblank characters of the facility address. If it ends in POBOX (indicating a mailing address rather than
       a location), the TRI Facility ID i not used for facility matching.
                                         s


                                                                                                               Page 3-7
           not need a permanent W R M S Facility ID entered; the conversion program will assign one.

       2. The new Facility record matches another Facility record with a permanent WRMS Facility
          ID, and is therefore not a new facility. In this case, the user should enter the W R M S
           Facility ID from the existing record in the new record, and mark the new record for
           deletion using < C t r l - U > .

       3. The new Facility record matches another new Facility record, and is therefore a new
          facility for which two new Facility records were created instead of one (probably as a
          result of a typographical error in one of the identifiers). In this case, the user should
          assign a new permanent W R M S Facility ID and enter it in the FAC-ID field of both
          records, and mark one record for deletion using < C t r l - U > . The permanent WRMS
          Facility ID consists of the fust 4 characters of the facility name (using underscore in place
          of spaces) plus a unique six-digit serial number. In the instruction screen provided before
          duplicate checking, the next available serial number is displayed. The user should start
          from this number and assign numbers sequentially to each new facility. Leading zeros in
          the number should be included in the permanent WRMS Facility ID. In summary, the
          user should leave one complete record for each facility, and mark any duplicates for
          deletion. However, a permanent W R M S Facility ID must be entered for every duplicate
          record, whether marked for deletion or not. The temporary W R M S Facility ID should not
          be deleted, as it provides the l n to the TRIS data.
                                          ik

       In determining whether two records represent the same facility, the user should compare all
   the data for the two facilities. No single piece of data is likely to provide conclusive evidence
                                                                 l
   that two records represent the same or different facilities. Al of the information should be
   weighed in deciding. The following observations may be useful:

           Identifiers such as EPA ID or NPDES Permit Number should be checked for
           typographical errors that could have caused the conversion program to miss a match.
           When such errors are found, the existing WRMS Facility record should be assumed to be
           correct, and the user need do nothing, unless the Facility record contains an obviously
           invalid identifier (e.g., one that is too short), in which case the user should replace the
           invalid identifier with the one from the TRIS data.

           Identifiers such as the EPA ID and NPDES Permit Number can change over time, and a
           single facility may have more than one EPA ID or NPDES Permit Number. However,
           unless all other information indicates that two records represent the same facility, different
           identifiers should be considered strong evidence that the two records represent different
           facilities.

           Facility names can change over time. One good indicator that this has happened is a TRI
           Facility ID that does not correspond to the current facility name (the 6th through the 10th
           characters of the TRI Facility ID should be the first 5 consonants of the facility name).

           Some companies have multiple facilities clustered together in the same city, and the
           names of these facilities may be quite similar. This is particularly common with fumiture
           plants and knitting or hosiery mills. Such clusters may even share an EPA ID or NPDES


Page 3-8
        Permit Number. Typically, the facility name and address will be most useful in
        distinguishing these facilities. If a group shares an EPA ID or NPDES Permit Number,
        these identifiers should be deleted from all but one of the facilities, so that NCAR and
        NPDES data are assigned consistently from year to year to the same facility in the group.

       Consider the specificity of the street address. For several types of nonspecific addresses,
                                                                                                          ~




       matching addresses should not be given much weight. Examples include Post Office Box
       addresses (several facilities owned by the same company may use the same PO Box
       address), highway or route numbers (many facilities may be located on the same                     c




       highway), and industrial parks (multiple facilities may be located in an industrial park).

        Contacts often change from year to year, so a different contact name is not a reliable
        indication that two facility records represent different facilities. Also, some companies
        with multiple facilities in an area list the same contact person for several different
        facilities, so the same contact person is not conclusive evidence that two facility records
        represent the same facility.

       SIC codes can be helpful, but the same facility may report different SIC codes a different
                                                                                         t
       times. It is helpful to have a list of SIC codes available to see if two codes are closely
       related, or if one is invalid (and therefore incorrect). SIC codes outside the 20-39 range
       covered by TRIS should be given little weight.

    During the duplicate checking process, the TRIS data are linked to the WRMS Facility f i e
(using the Facility ID) and the user can switch between the two files by using <Esc> or
< C t r l - E n d > . < E s c > will not save any changes to the current record before the switch;
< C t r l - E n d > will. Most of the time, the TRIS information will not be needed, but it may
occasionally be useful. The user may quit duplicate checking by pressing <F10> then <Esc> or
< C t r l - E n d > . The user will be asked if marking duplicate facilities is complete, and should
press Y if it is and N if it is not. The user may quit the duplicate checking process in this way at
any time and resume again later. The process will resume at the top of the Facility fide, so the
user should make a note of where they left off.

   Once all unmatched facilities are checked and either matched or verified as unmatched, the
thud step of the facility matching process is to assign a permanent WRMS Facility ID to the
unmatched facilities. This step is automated. The W R M S Facility ID consists of the f i s t four
characters of the facility name and a unique, six-digit serial number. The conversion program                 -
copies the new WRMS Facility IDSto the TRIS working fide (Submexr.dbfi using the temporary
WRMS Facility ID as a link, and then deletes the temporary WRMS Facility IDS from the
FuciliQ fie. Any duplicate Facilily records are then deleted by the conversion program.

    In the fourth step of facility matching, the user manually checks tentative matches and either
verifies or rejects them. The conversion program displays the TRIS working file (Submextdbf) in
natural order. In this order, all the records for a facility are typically together, but the facilities
are in no particular order. The Facility f i e is l i e d to the TRIS working file using the WRMS
Facility ID; the user can switch between the two as necessary using <Esc> or < C t r l - E n d > .
<Est> will not save any changes to the current record before the switch; <CtrL-End> will.




                                                                                              Page 3-9
       In verifying tentative matches, the user should scan down the TRIS f i e looking for records
   with a True flag (T) in the FAC-ERROR field (indicating a possible mismatch). The fields that
   do not match are flagged in the ERR-FIELD field with one or more letter codes, as follows:

       E = EPA ID
       N = NPDES Permit Number
       T = TRI Facility ID
       A = address (fist 10 characters)
       C = city
       F = facility name (fist 5 characters)

       The user should compare the data in the TRIS file with the data in the WRMS Facility f i e to
   determine whether the match is correct or not. Again, the user should consider and weigh all
   data for a facility in making this decision. The user should consider the following:

            Identifiers should be checked for typographical errors. These are paaicularly obvious
            when only one record in a group of records in the TFUS file shows an error. However,
            typographical errors may affect all the records for a facility.

            Contacts and phone numbers frequently change from year to year. Likewise, facility
            names and even EPA IDS and NPDES Permit Numbers can change. Location
            information, however, should remain the same over time.

       If a match is correct, the user should assume the information in the WRMS Facility file is
   correct, unless it is invalid (e.g., an identifier that is too short). The user may add clarifying
   information to the facility name if it seems appropriate. There is no need to make changes in the
   TRIS working file, as long as the Facility ID is correct. In any case, the user should change the
   FAC-ERROR flag to False (F) for all records determined to be correctly matched.

       If a match is incorrect, the user should look for a correct match in the WRMS Facility file
   If one is found, the user should enter the correct W R M S Facility ID should be entered in all
   affected TRIS working file records and change the FAC-ERROR flag to False (F).

        If a match is incorrect and no correct one is found, the user should change the FAC-ERROR
   field to False for all but one of the records in the TRIS working file. It does not matter which
   one. The conversion program will use this one record to create a new Facility record at the end
   of the mismatch checking process.

       The user can press <F10> then <Esc> or <Ctrl-End> to quit. <Esc> quits without
   saving changes to the current record; <Ctrl-End> quits and saves changes to the current
   record.

       The fifth and final step of facility matching for TRIS is to fill in missing data in the Facility
   file with any available data from TRIS. This step is automated. For example, if county has not
   been reported for a facility in previous reporting years (and is therefore missing from WRMS),
   but is available in the current TRIS data, the conversion program fills in the county field in the
   Facility file with the county reported in the current TRIS data. The conversion program also


Page 3-10
updates contacts and phone numbers, even if the Facility file contains data on contact and phone
number, to ensure that the most recent contact information is available.


3.1.2.3 Chemical Matching

    The chemical matching process for TRIS is divided into two segments: automated chemical
matching and manual matching of unmatched chemicals. Chemicals are matched automatically
based on CAS number or chemical name. If necessary, the user is shown any unmatched                    ~




                                l
chemicals for manual matching. Al chemical matching operates on the Submext.dbf file and the
WRMS Chemical file. The user can quit and resume later after either of these sections or during
the manual matching.

    Because the SARA List of Lists is included in the W R M S Chemical fie, manual matching of
chemicals should rarely be necessary. If it is, the conversion program will display unmatched
TRIS records in order by chemical name. Only the CHEM-ID and CHEM-MIS fields can be
edited. The user should look up the correct CHEM-ID in the alphabetical listing of the WRMS
Chemical fie, enter it in the CHEM-ID field, and change the CHEM-MIS field to F (False).
Note that synonyms are not included on the list or in WRMS. If the chemical is not found on
the W R M S chemical list and is not a synonym for a chemical on the list, and therefore needs to
be added to the W R M S chemical file, the user should change CHEM-MIS to F for         records
containing that chemical, and mark one record containing the chemical using <Ctrl-U>. The
conversion program will create the appropriate W R M S Chemical record automatically. The user
should press < C t r l - E n d > when they are finished checking unmatched chemicals.


3.1.2.4 Emissions Conversion

   Once facility and chemical matching have been completed, the user should select "Convert
Emissions" from the Conversion Activities Menu. This step is completely automated. See
Section 2.3.1.4 for a discussion of how TRIS emissions data are converted by the conversion
program.


3,1.3 North Carolina Annual Report (NCAR)
                                                                                                           -
3.1.3.1 Getting and Preparing the Data

    The North Carolina Annual Report (NCAR) hazardous waste data base is maintained by the
State in &ase format. These data include a data fie for each reporting year containing one
record for one waste at one facility and a facility file containing infomation about the facilities.
In addition to waste descriptions, the data files contain data on total quantity generated, quantity
treated or stored on-site, and quantity shipped off-site, waste minimization practices and methods
used for verlfying the quantity estimates. Data are reported on two different forms: one for
generators and one for off-site commercial TSDFs.

   The user should request a copy of the data file and the facility file from the Hazardous Waste


                                                                                          Page 3-1 1
   Section for Form 36 (generators only) for the desired reporting year. The structure of this file for
   1990 is shown in Appendix B, Table B-5. The user should rename the data file Annrep.dbf. The
   facility file is not used by the conversion program; it is typically called Facfikdbf and the user
   need not rename it. The user should copy both these files to the subdirectory \WRMNTATE.

       The conversion program creates a working file called Anrepextdbf (for annual report
   extended) from the original data file. The structure of this file is shown in Appendix B, Table B-
   12. The user will be asked to enter the reporting year of the data being converted.

       The conversion program checks all EPA IDS in Anrepexr.dbf for entries that do not stan with
   NC, as would be expected for facilities in North Carolina. Entries such as NA (for not available)
   are erased and capital Os replaced with zeros automatically before this step4 The user is then
                                   D for
   shown any nonstandard EPA I S possible correction. If the identifier is indecipherable, the
   user should delete it. Examples of indecipherable identifiers include very short numbers. If the
   problem is a typographical error (e.g., MC instead of NC) the user should correct it. However,
   facilities located in North Carolina may occasionally have an EPA ID coded for another state; if
   the letters are an accurate abbreviation for another state, even if they look l i e they might be a
   typographical error (e.g., NY),the ID should probably be left as is. Once all nonstandard IDS
   have been corrected, the interactive mode will terminate automatically. If one or more
   nonstandard IDS are to be left as is, the interactive mode must be terminated by the user by
   pressing <Ctrl-End>.


   3.1.3.2 Facility Matching

      Note that because TRIS is the primiuy data source for WRMS, the facility matching for TRIS
   must be completed before the facility matching for NCAR for the same reporting year, so that the
   appropriate facilities are included in the Facility file. Additional facilities are not added to the
   Facility file from NCAR, as WRMS covers only facilities reporting to TRI.

       The fust step in facility matching is for the user to compare the NCAR facility file and the
   WRMS Facility file closely to add and correct as many EPA IDS in the WRMS Facility file as
   possible. This is done manually, outside the conversion program. Only new TFU facilities added
   from TRIS for the reporting year being converted need to be compared, since previously added
   facilities have already been checked. New facilities can be identified by the YEAR-ADDED
   field, which contains the reporting year for which the facility was first added. New facilities will
   have the current reporting year in this field. There is no single way to verify EPA IDS for new
   facilities. Probably the easiest approach is to print the facility data for new facilities in WRMS
   in order by city and facility name, and view the NCAR facility data in the same order (this may
   require the creation of a new index order for the NCAR facility file). Working down the WRMS
   new facility list, the user should look for each new WRMS facility in the NCAR facility fie,
   comparing all information and noting new EPA IDS or corrections to existing EPA IDS in the
   WRMS Facility file. Once all facilities have been reviewed, these corrections and additions
   should be made in the W R M S Facility fie. Altematively, the NCAR facility file could be


            Note that it would not be desirable to do an automatic replacement of capital Os for data !iom a state with
            0 in its abbreviation,like OH or MO.


Page 3-12
printed out and the W R M S Facility file viewed, and additions and corrections made directly
instead, but the NCAR facility file is likely to be much larger (and less practical to print) than
the WRMS Facility file because NCAR covers many more facilities than TRI (and therefore
WRMS).

   After the user has verified and corrected EPA IDS for new facilities, they should start the         -
conversion program and select "Facility Matching" from the Conversion Activities Menu.
Facilities are matched by the conversion program using the EPA ID, and any unmatched facilities
remaining in Anrepext after this process is complete are deleted.                                      -

3.1.3.3 Chemical Matching

    Chemical matching is completely automated for NCAR. The user should select "Chemical
Matching" from the Conversion Activities Menu. Hazardous wastes from NCAR are matched
using the four hazardous waste codes, the physical form code, and the source code. Since there
are a huge number of possible combinations of these codes, no attempt was made to enter all of
the possible combinations in the Chemical fie, and the addition of new Chemical records should
be quite common for NCAR data. Therefore, if no match is found, a new record is added to the
Chemical f i e automatically, without intervention by the user.


3.1.3.4 Emissions Conversion

    Once facility and chemical matching have been completed, the user should select "Convert
Emissions" from the conversion activities menu. This step is completely automated. See Section
2.3.2.4 for a discussion of how NCAR emissions data are converted by the conversion program.


3.1.4 NPDES Permit Monitoring Data Base

3.1.4.1 Getting and Preparing the Data

    NPDES data are maintained by the State on a mainframe computer. These data consist of
monthly surface water discharge data for a variety of STORET parameters from NPDES-
permitted facilities. The STORET parameters include physical parameters, such as flow and
temperature; conventional pollutants, such as BOD and Total Suspended Solids; and many toxics,
including (but not limited to) a variety of metals. Discharges may be reported either as a
concentration (e.g., m d ) or an emission (e.g., Ibs/day). Flow is usually reported in millions of
gallons per day (MGD). These values are reported separately for each pipe at a facility. Facility
identification data are also included.

    The user should request a download from the NPDES data system for flow and the
conventional pollutants listed in Table 3-1 for all major and minor industrial dischargers for the
desired reporting year. Since NPDES contains monthly average emissions and concentrations,
while WRMS contains annual emissions, the user should also request annual averages for each
facility, pipe, and parameter. The conversion program wl aggregate these data to the facility
                                                          il


                                                                                           Page 3-13
  Table 3-1. NPDES Chemical Parameters Requested


    STORET Code    Parameter Name
    006 10         Ammonia nitrogen
    00310          BOD
    00940          Chloride
    00340          COD
    0095 1         Fluoride
    00630          Nitrate, Nitrite (NO2 + NO,)
    00556          Oil and grease
    00625          Total Kjeldahl nitrogen
    00665          Total phosphorus
    00530          Total Suspended Solids




Page 3-14
level. Facilities may report the same parameter in different units from month to month (e.g., as a
concentration in mgfl one month and an emission in lbs/day another month). This results in
multiple annual averages for some facility, pipe, and parameter combinations: one corresponding
to each different unit reported. Therefore, the number of reporting months associated with each
                                                                                                                      -
average should also be requested, so that multiple averages can be weighted appropriately to get
                                                                                                                      -
an overall annual average (once units have been converted). The downloaded data are provided
in an ASCII file with fields delimited by the @ symbol. The structure of the data fiie is shown
in Appendix B, Table B-6. The delimiter could be omitted in future downloads as long as the
fields in the ASCII fiie are fixed length (i.e., the field is always the same length, regardless of the               ~




length of the actual piece of data) and a record structure (such as that shown in Table B-6)is
provided.

    The user should rename the NPDES data file to Npdes.dut and copy it to the subdirectory
\WRMS\NPDES. The conversion program creates an intermediate working file (Npdesintdbf)
which imports the ASCII data f i e to B a s e . The @ delimiters are imported as individual fields.
If these delimiters are omitted in the future, the structure of Npdesint.dbf should be changed to
delete the delimiter fields. As these fields are not referenced elsewhere in the conversion
program, no changes would need to be made to the program code.

    The conversion program divides the data in the intermediate working file into two working
files: one containing flow values and one containing concentration and emission values. These
are named Nflowext.dbf and Nconcexr.dbf respectively (for "DES flow extended and NPDES
concentration extended) by the conversion program. The file structures for Nflowextdbf and
Nconcext.dbf are shown in Appendix B, Tables B-13 and B-14.

    The user will be asked to enter the reporting year of the data being converted. The
conversion program checks all NPDES Permit Numbers in Nconcexr for entries that do not start
with NC, as would be expected for facilities in North Carolina. Entries such as NA (for not
available) are erased and capital Os replaced with zeros automatically before this step.' The
user is then shown any nonstandard "DES Pennit Numbers for possible correction. If the
identifier is indecipherable, the user should delete it. Examples of indecipherable identifiers
include very short NPDES Permit Numbers, especially those ending with R and a number. If the
problem is a typographical error (e.g., MC instead of NC) the user should correct it. Once all
nonstandard IDS have been corrected, the interactive mode will terminate automatically. If one or
more nonstandard IDSare to be left as is, the interactive mode must be terminated by the user by
pressing <Ctrl-End>.


3.1.4.2 Facility Matching

    Note that because ' I R I S is the primary data source for WRMS, the facility matching for TRIS
must be completed before the facility matching for "DES for the same reporting year, so that
the appropriate facilities are included in the Facility file. Additional facilities are not added to
the Facility f i e from NPDES, as WRMS covers only facilities reporting to TRI.


       Note that it would not be desirable to do an automatic replacement of capital Os for data from a state with
       0 in its abbreviation, like OH or MO.


                                                                                                          Page 3-15
       The first step in facility matching is for the user to compare the NPDES facility data and the
   WRMS Facility file closely to add and correct as many NPDES Permit Numbers in the WRMS
   Facility file as possible. This is done manually, outside the conversion program. Only new TRI
   facilities added from TRIS for the reporting year being converted need to be compared, since
   previously added facilities have already been checked. New facilities can be identified by the
   YEAR-ADDED field, which contains the reporting year for which the facility was first added.
   New facilities will have the current reporting year in this field. There is no single way to verify
   NPDES Permit Numbers for new facilities. Probably the easiest approach is to print the facility
   data from NPDES in order by city and facility name, and view the WRMS Facility file in the
   same order (this may require the creation of a new index order for the NPDES data f i e before
   printing). Working down the list of new facilities in the WRMS Facility file, the user should
   look for each new WRMS facility in the NPDES printout, comparing all information and adding
   new NPDES Permit Numbers or corrections to existing NPDES Permit Numbers to the WRMS
   Facility fie.

       After the user has verified and corrected NPDES Pennit Numbers for new facilities, the user
   should start the conversion program and select "Facility Matching" from the conversion activities
   menu. Facilities are matched by the conversion program using the NPDES Permit Number, and
   any unmatched facilities remaining in the working file Nconcext.d&f after this process is complete
   are deleted.


   3.1.4.3 Chemical Matching

       The chemical matching process for NPDES is divided into two segments: automated
   parameter matching and manual matching of unmatched parameters. Chemical parameters are
   matched by the conversion program using the STORET parameter number. Since all "DES
   parameters requested should already be in the Chemical file, the conversion program allows the
   user to check any unmatched parameters manually before adding them to the Chemical file
   automatically. A parameter can sometimes have multiple parameter numbers (depending on units
   reported), which can result in unmatched parameters. The user can quit and resume later after
   either of these steps or during the manual matching.

       Because the list of parameters requested from NPDES is already included in the WRMS
   Chemical file, manual matching of chemical parameters should rarely be necessary. If it is, the
   conversion program will display unmatched NPDES records in order by parameter name. Only
   the CHEM-ID and CHEM-MIS fields can be edited. The user should look up the correct
   CHEM-ID in the alphabetical listing of the WRMS Chemical fie, enter it in the CHEM-ID field,
   and change the CHEM-MIS field to F (False). If the chemical parameter is not found on the
   WRMS chemical list, and therefore needs to be added to the WRMS Chemical file, the user
   should change CHEM-MIS to F for all records containing that parameter, and mark one record
   containing the parameter using <Ctrl-U>. The conversion program will create the appropriate
   WRMS Chemical record automatically. The user should press <Ctrl-End> when they are
   finished checking unmatched parameters.




Page 3-16
3.1.4.4 Emissions Conversion

   Once facility and chemical matching have been completed, the user should select "Convert
Emissions" from the Conversion Activities Menu. This step is completely automated. See
Section 2.3.3.4 for a discussion of how NPDES emissions data are converted by the conversion
program.


3.1.5 Municipflndustrial Pretreatment Monitoring Data Base

3.1.5.1 Getting and Preparing the Data

   The Pretreatment data are maintained by the State on a mainframe computer. These data
consist of annual average concentration and flow for discharges of a variety of conventional
water pollutants and toxic chemicals to P O W s from municipalities and industrial users.

     The user should request a download from the Pretreatment data system for industrial users
only and for the list of 14 conventional water pollutants and inorganics shown in Table 3-2.
Table B-7 in Appendix B shows the structure of the Pretreatment data fie. The user should also
request a file containing identifying information for the P O W s ; its structure is shown in
Appendix B, Table B-8. The user should rename the Pretreatment data file Preneat.dat and copy
it to the subdirectory \WRMS\PRETREAT. The user should import the P O W information file
to dBase manually, rename it Pomdbf, and copy it to the subdirectory \WRMS\PRETREAT.

   The conversion program creates a working fie called Preexr.dbf (for pretreatment extended).
The structure of this fde is shown in Appendix B, Table B-15. The user is asked to enter the
reporting year of the data being converted.


3.1.5.2 Facility Matching

    Note that because TRIS is the primary data source for WRMS, the facility matching for TFUS
must be completed before the facility matching for Pretreatment for the same reporting year, so
that the appropriate facilities are included in the Facility fie. Additional facilities are not added
to the Facility file from the Pretreatment data base, as W R M S covers only facilities reporting to
TRI.

    Facilities are identified in the Pretreatment data base by the NPDES permit number of the
P O W and an industrial user (IU) number. These identifiers are not reported in TRIS.
Therefore, the first step in the facility matching process is for the user to compare the facility
infomation from the Pretreatment data file to the WRMS Facility file, in order to add as many
Pretreatment IDS(consisting of the POTW NPDES permit number plus the IU number) to the
WRMS Facility file as possible. This is done manually, outside the conversion program.
Because pretreatment IDSoften change from year to year, they should be verified for all
facilities, not just new TRI facilities added from TRIS for the reporting year being converted.
Probably the easiest approach to adding Pretreatment IDS is to print the facility data for the
Pretreatment facilities in order by city and facility name and view the WRMS Facility fde in the


                                                                                           Page 3-17
  Table 3-2. Pretreatment Chemical Parameters Requested


    STORET Code      Parameter Name
                    Ammonia
    00310           BOD
    00940           Chloride
    00340           COD
    00082           Color
    0095 1          muoride
    38260           MBAS
                    Nitrite
    00556           Oil and grease
    00745           Sulfide
    01102           Tin
    00530           Total suspended solids
    00625           Total Kjeldahl nitrogen
    00665           Total phosphorus




Page 3-18
same order. Working down the Pretreatment facility list, the user should look for each
Pretreatment facility in the WRMS Facility file, comparing all information and entering new
Pretreatment IDS in the WRMS Facility file. The Pretreatment ID consists of the P O W NPDES
Permit Number plus the four-digit IU number.

   After the user has entered Pretreatment IDS to the Facility file, the user should start the
conversion program and select "Facility Matching" from the Conversion Activities Menu.
Facilities are then matching by the conversion program using the Pretreatment ID (the POTW
NPDES pennit number plus the IU number), and any unmatched facilities remaining in the
working file Preext.dbf after this process is complete are deleted.


3.1.5.3 Chemical Matching

   Chemical matching is not necessary as a separate step with the Pretreatment data, because
each of the pollutants is reported in a separate field. Chemical IDSare assigned directly as
emissions are converted. However, due to the way the conversion program keeps track of which
conversion activities have been performed, the user must select "Chemical Matching" from the
Conversion Activity Menu after facility matching is complete and before selecting "Convert
Emissions." A message saying that chemical matching is unnecessary will be displayed, and the
user may then proceed with emissions conversion.


3.1.5.4 Emissions Conversion

    Once facility matching has been completed, the user should select "Convert Emissions" from
the Conversion Activities Menu. This step is completely automated. See Section 2.3.4.4 for a
discussion of how Pretreatment emissions data are converted by the conversion program.


3.1.6 Air Ouality National Emissions Data System (NEDS)

3.1.6.1 Getting the Data

    The Air Quality National Emissions Data System (NEDS) is maintained by the State.
Eventually, these data will be included in the newer Aeromeaic Information Retrieval System
(AIRS)  maintained by EF'A. NEDS covers stack emissions of five criteria air pollutants:
particulates, SO,, NO,, VOC, and carbon monoxide. Data for Mecklinburg County (including
the Charlotte area) have not been computerized in the past and may therefore be available only in
hard copy. The NEDS system includes a standard report listing facility identifier, name, and
address, and emissions i tons/year for each pollutant. The user should request this report in
                        n
ASCII format on disk from the Air Section. Because the file is a report printed to disk, it
contains headers with the field names about every 50 records (so that if it were printed, the
headers would appear at the top of each page). The structure of this file is shown in Table B-9
of Appendix B. The user should rename this file Airs.dut and copy it to the subdirectory
\urRMSWR. From this file, the conversion program creates a working file called Airsext.dbf
(for AlRS extended); all records except the header lines are appended to the working file. The


                                                                                        Page 3-19
   structure for Airsextdbf is shown in Appendix B, Table B-16.


   3.1.6.2 Facility Matching

      Note that because TRIS is the primary data source for WRMS, the facility matching for TRIS
   must be completed before the facility matching for NEDS for the same reporting year, so that the
   appropriate facilities are included in the Facility file. Additional facilities are not added to the
   Facility f i e from NEDS, as WRMS covers only facilities reporting to TFU.

        Facilities are identified in NEDS by a county code and a plant ID; the plant ID is unique
   within each county. These county codes and plant IDS are not reported in TRIS. Therefore, the
   first step in the facility matching process is for the user to compare the facility information from
   the NEDS f i e to the W R M S Facility file, in order to add as many Air IDS (consisting of the
   county code plus the plant ID) to the W R M S Facility f i e as possible. This is done manually,
   outside the conversion program. Only new TRI facilities added from TFUS for the reporting year
   being converted need to be compared, since previously added facilities have already been
   checked. New facilities can be identified by the YEAR-ADDED field, which contains the
   reporting year for which the facility was fust added. New facilities will have the current
   reporting year in this field. The comparison process is hampered by the fact that all facility
   infomation other than the county code and plant ID (i.e., plant name, address, and city) is
   contained in a single field, so the data cannot be sorted by city. It would simplify the process of
   adding IDS if these were separated into three fields in the future. Probably the easiest approach
   to adding Air IDS is to print the facility data for the NEDS facilities and view the WRMS
   Facility fie. Different index orders may be useful for different facilities; the user should change
   index order as needed. Working down the NEDS facility list, the user should look for each
   NEDS facility in the WRMS Facility file, comparing all information and entering new Air IDS in
                                      i
   the WRMS Faciliry file. The A r ID consists of the four-digit county code plus the four-digit
   plant ID.

       After the user has entered Air IDS to the Facility fie, the user should start the conversion
   program and select "Facility Matching" from the Conversion Activities Menu. Facilities are then
   matched by the conversion program using the Air ID (the county code plus the NEDS plant ID),
   and any unmatched facilities remaining in working file Airsextdbf after this process is complete
   are deleted.


   3.1.6.3 Chemical Matching

       Chemical matching is not necessary as a separate step with the NEDS data, because only five
   pollutants are reported and each is reported in a separate field. Chemical IDS are assigned
   directly as emissions are converted. However, due to the way the conversion program keeps
   track of which conversion activities have been performed, the user must select "Chemical
   Matching" from the Conversion Activity Menu after facility matching is complete and before
   selecting "Convert Emissions." A message saying that chemical matching is unnecessary will be
   displayed, and the user may then proceed with emissions conversion.



Page 3-20
    3.16.4 Emissions Conversion

       Once facility matching has been completed, the user should select "Conven Emissions" from
   the Conversion Activities Menu. This step is completely automated. See Section 2.3.5.4 for a
   discussion of how NEDS emissions data are converted by the conversion program.


3.2 RELATIVE TOXICITY AND HAZARD LNDEXING SCHEME UPDATES

    Given the dynamic nature of toxicological data, the relative toxicity and hazard indexing scheme
must be updated periodically to include the most recent information. The indexing scheme was
developed in dBase format and supplied to NCPPP; new data inputs can simply be entered in the
appropriate data file. A program to recalculate the relative toxicity indices and the fate moMiers
and copy the recalculated indices to the WRMS Chemical file was also provided to NCPPP. This
section describes the data files used in the relative toxicity and hazard indexing scheme and
documents how to update the relative toxicity indices and fate modifiers. The user is assumed to
                                         l
have a working knowledge of dBase. A l data files, report formats, data entry forms, and programs
associated with the update of the toxicity indices and fate modifiers are in the dBase catalog called
Toxfiles.


   3.2.1 Relative Toxicity Index Updates

        Four data files contain the data related to the relative toxicity indexing scheme: Benchmar.dbf    _
   contains the toxicity benchmark data; Ratiosdbf contains the calculated intermediate toxicity
   ratios; Indices.dbf contains the calculated final relative toxicity indices; and Geomeans.dbf
   contains the geometric mean of each toxicity benchmark. In the Benchmar, Ratios, and Indices
   files, each record represents one chemical and each field represents a benchmark or index. Each
   file also contains fields for the chemical name and CAS number, and each has a data base index
   on CAS number. The Geomeans file has only one record, with fields corresponding to each
   benchmark containing the geometric means. The structures for these files are shown in Appendix
   E, Tables E-1 through E-4.

       Section 2.4.1.1 describes the toxicity benchmarks contained in the Benchmar file. Sections
   2.4.1.2 and 2.4.1.3 describe the calculation of toxicity ratios and toxicity indices contained in the
   Ratios and Indices file, respectively. Each of these three data files may be printed by selecting
   the report format of the same name. Printouts of the benchmarks, ratios, and indices are shown
   in Appendix D, Tables D-I, D-2, and D-3, respectively.

       The first step in updating the relative toxicity indices is to add any new TRI chemicals to the
   Benchmar, Ratios, and Indices files. Classes of chemicals without a CAS number (e.g., cadmium
   compounds) should not be added to the data files. New chemicals can be added by adding new
   records to the end of the files. CAS numbers should be entered in right-justified format with
   hyphens and no leading zeros (e.g. " 50-00-0, "50-00-0 " or "000050-00-0 or "50000");
                                                        nor
   otherwise, they wl not match their counterparts in the W R M S Chemical file.
                     il

       The second step is to look up new data. The user may want to print the Benchmar file and


                                                                                               Page 3-21
   mark changes and additions on that. Section 2.4.1.1 and Table 2-16 describe the data collection
   process and the data hierarchy for each benchmark. In addition to looking for new values to
   supplement the data set, the user should be aware that existing values are periodically reevaluated
   and updated. Consequently, constituents with existing values for CSFs, RfDs, etc., should be
   examined periodically for changes. In looking for changed values, the user should be aware that
   the units used in the data fies (shown in Table 2-16) may not always be the same as in the data
   source. Inhalation benchmarks in particular are frequently reported in two different units of
   measure. In any case, the user should be sure to convert data to the units shown in Table 2-16
   before entering the data.

      The third step is to enter new or changed benchmark data in the Benchmar fie, in the record
   corresponding to the specific constituent and the field corresponding to the specific health or
   environmental value (e.g., reference dose, inhalation carcinogenic slope factor, LD50, aquatic
   LC50 for fiih, etc.). A data entry form (Benchmur.fmt) has been provided to assist in data entry.
   The form is shown in Figure 3-1.

       Once all new benchmark values have been entered in the Benchmar fie, the final step is to
   run Tox-upd.prg. This program recalculates the ratios and indices and copies the new indices to
   the WRMS Chemical file. The program code for Tox-upd is listed in Appendix E.

       It should be emphasized that the geometric means in the Geomeuns file, which are based on
   the current toxicity benchmark values for TRI constituents, should not be changed, even when the
   bechmark values for individual constituents change, so that they will continue to provide a
   consistent basis for comparison.


   3.2.2 Environmental Mobilitv and Persistence Score Updates

       Two data fies contain the data related to the environmental fate modifiers: Fate.dbf contains
   the fate and transport parameters, and Mobger.dbf contains the calculated final relative
   environmental fate modifiers for mobility and persistence. In both of these files, each record
   represents one chemical and each field represents a fate and transport parameter or environmental
   fate modifier. Each f i e also contains fields for the chemical name and CAS number, and each
   has an index on CAS number. The structures for these files are shown in Appendix E, Tables E-
   5 and E-6.

       Section 2.4.2.1 describes the fate and transport parameters contained in the Fare file.
   Sections 2.4.2.2 and 2.4.2.3 describe the calculation of the mobility and persistence modifiers
   contained in the Mob Per fie. Each of these two data fies may be printed by selecting the
   report format of the same name. Printouts of the fate data and the fate modifiers are shown in
   Appendix D, Tables D-4, and D-5, respectively.

       The first step in updating the environmental fate modifiers is to add any new TRI chemicals
   to the Fate and M o b p e r files. Classes of chemicals without a CAS number (e.g., cadmium
   compounds) should not be added to the data files. New chemicals can be added by adding new
   records to the end of the files. CAS numbers should be entered in right-justified format with
   hyphens and no leading zeros (e.g. " 50-00-0, not "50-00-0 'I or "000050-00-0 "50000");
                                                                                         or


Page 3-22
Figure 3-1. Data Entry Screen for Toxicity Benchmark Data (Benchmarfir)


......................     Toxicity Benchmark Data Entry Form      ......................
CAS NO:                   Chem. name:

    Chronic Benchmarks:
     Oral RfD                     mg/kg/day         If no other chronic oral data:
     Oral CSF                      (mg/kg/day)-1     NOAEL                 mg/kg/day
     Inhal RfC                    mg/m3
     Inhal CSF                     (mg/kg/day)-1


    Acute Benchmarks:                     Ecological Benchmarks:
    Oral LD50                     mg/kg   Aq LC50-bony fish                     U9/L
    Inhal LCSO                    mg/m3   A q LC50-w. flea                      ug/L
                                          Bioconc. Factor                       unitless




Figure 3-2. Data Entry Screen for Fate and Transport Data (Fute.fmt)

......................     Fate and Transport Data Entry Form      ......................
CAS No:                   Chem. name:
Vapor Pressure                              “Hg at 25C
Solubility                                  mg/L at 25C
Log P                                       unit less
Log KOC                                     unitless
Biodeg. category                            High, Moderate, or Low
Residence time                              days
Air half-time                               days
BOD Half-life                                 days (enter range if necessary)
Adjusted BOD Half-life*                       unitless
*   Adjusted BOD Half-life = 3 if BOD Half-life > 365 days
    Adjusted BOD Half-life
    Adjusted BOD Half-life
                             --
                             2 if BOD Half-life = 30       -
                                                       365 days
                             1 if BOD Half-life < 30 days
See section 3.2 of the report for more info on assigning Adjusted BOD Half-life.




                                                                                     Page 3-23
   otherwise, they will not match their counterparts in the WRMS Chemical file.

       The second step is to look up new data. The user may want to print the Fate file and mark
   changes and additions on that. Section 2.4.2.1 and Table 2-18 describe the data collection
   process and the data hierarchy for each parameter. The user should be sure to convert data to the
   units shown in Table 2-18 if necessary.

       The third step is to enter new or changed fate and transport parameter data in the Fate file, in
   the record corresponding to the specific constituent and the field corresponding to the specific
   parameter (e.g., vapor pressure, log P, etc.). A data entry form (Fare.fmr)has been provided to
   assist in data entry. The form is shown in Figure 3-2.

       The user will need to assign an adjusted BOD half-life value based on the range of values
   entered for BOD half-life. Table 3-3 summarizes the correspondence between BOD half-life
   values and adjusted BOD half-life values. However, BOD half-lives are usually presented as
   ranges such as "2-16 days," which may overlap more than one of the categories shown in Table
   3-3. The following guidelines should be used to assign appropriate values to the Adjusted BOD
   field (ADJBOD) for each constituent:

      1. The high-end of the BOD half-life range should be used to assign the appropriate
         Adjusted BOD value. For example, if the BOD half-life range is "2-16," then since 16 is
         less than 30 the Adjusted BOD is 1.

      2. If the BOD half-life range is indicated by a low-end value (e.g. ">15"), then this low-end
         value should be used to assign the appropriate Adjusted BOD value. For example, if the
         BOD half-life range is ">15", the Adjusted BOD value would be 1, because 15 is less
         than 30.

      3. If the BOD half-life range designates that "most" values fall in a specific range (e.g.,
         ">20most>lOO"), whatever Adjusted BOD value corresponds to the range indicated by
         "most" using guidelines 1 and 2 is the appropriate Adjusted BOD value. For example, if
         the BOD half-life is ">20mosu100," the Adjusted BOD would be 2 because 100 is less
         than 365 but greater than 30.

      4 If two BOD half-life ranges are indicated (e.g. ">20,20-loo"), the range that corresponds
       .
            to the higher Adjusted BOD value using guidelines 1 and 2 should be used. For example,
            if the BOD half-life range is ">20,20-loo", the Adjusted BOD value would be 2 because
            100 is less than 365 but greater than 30.

      Once all new values have been entered in the Fare file, the final step is to run Fate ugd.prg.
   This program recalculates the mobility and persistence scores and copies the new valuer to the
   WRMS Chemical file. The program code for Fate-upd is listed in Appendix E.




Page 3-24
Table 3-3. Ranges for Assigning Adjusted BOD Half-life Values


1   BOD Half-life (BOD)      1    Adjusted BOD Value      )I
         > 365 days                        3
        365 - 30 days                      2
          c 30 days                         1




                                                                Page 3-25
                           4.0 USES AND LIMITATIONS OF WRMS


    WRMS can be used by NCPPP to answer many different types of questions relating to pollution             ~




prevention; however, it has some limitations. This section describes typical uses of WRMS and the
limitations of WRMS, and suggests ways to work around the limitations. Much more detailed
                                                                                                            ~




information on how to use WRMS can be found in a companion document, the WRMS User’s Guide.
Also, Section 5 discusses the utility of WRMS to other state and federal agencies.
                                                                                                                _
    WRMS was implemented in B a s e IV. It can be accessed through the dBase IV menu system
interface. The user should be able to use the Menu System interface to design and modify queries
and reports; however, no knowledge of programming in dBase is necessary. WRMS will run on any
PC that will run dBase N. All estimated processing times cited in this section are for a 386-class
PC.

    Several problems were encountered in using B a s e to implement WRMS; these stem from
Base’s inefficiency in processing queries on large data base files. The relational structure of
WRMS is not particularly complex, but the files are very large: the main f i e of emissions data
contains over 24,000 records and over 30 fields. The limitations in query efficiency limit the
flexibility that is theoretically possible with dBase, and detract from the usability of WRMS. It
should be noted that at the time WRMS was first being implemented, dBase was virtually the only
choice for a PC-based relational data base with a widely compatible fie format and a user interface
that allowed users who were not data base professionals to use it.


4.1 USES OF WRMS

    Some sample queries and reports were developed and included with WRMS to illustrate some
typical uses of WRMS. These queries and reports can be used as provided or modified to suit the
user’s specific needs. The user may also create new queries and reports if none of the provided ones
can be easily modified to meet the user’s needs. The sample reports are shown in Appendix F.
These reports include data on facilities, chemicals, quantity of emissions, and toxicity of emissions,
at various levels of aggregation across media, facilities, geographic areas, industries, etc.

    The sample reports were generated using the developed B a s e queries and report formats. Due to
the large number of records in WRMS, the user will typically need to reduce the amount of output
and organize it to generate meaningful reports, either using one of the developed queries or reports,
or by developing their own queries and reports. Several techniques using features of B a s e queries
                                        hs
and reports are particularly useful in t i regar& these have been used in the queries and reports
provided with WFWS, and can be used in new queries and reports developed by the user. These
techniques are described below.

   1. Restriction: a feature of queries allows the data to be restricted to a subset of all records; for
      example, to data for one facility or one chemical, or data for one county or SIC code, or data
      for one year or from one data source.

   2. Orderindgrouping: another feature of queries allows the data to be ordered so that records


                                                                                                Page 4- 1
       are in alphabetical or numerical order by a specific data element or combination of data
       elements, such as facility name or chemical name, or city plus facility name. Data ordered by
       a query can then be grouped using a feature of reports so that records with the same value for
       the data element they are ordered on are grouped together in the report. For example, if the
       data were ordered and grouped on facility name, all records for a particular facility would be
       grouped together in the report. Data must be ordered before it can be grouped, but ordered
       data need not be grouped.

    3. Summarizing: another feature of reports allows data to be summarized or aggregated; for
       example, total emissions by county or industry. Data to be summarized must also be ordered
       and grouped by the same data element that the user wants to summarize on; for example, to
       summarize the data by county, the data must be ordered and grouped by county. When data
       are summarized, the user can choose whether the individual records being summarized are
       shown in the report, or only the summary data.

The sample reports in Appendix F illustrate these concepts. Each sample report is described briefly
below; more detailed descriptions can be found in the WRMS User's Guide.

    Table F-1 shows a sample report of a list of all the facilities in WRMS. This sample is ordered
by facility name; many other orders could be used, such as by city and facility name, by SIC code,
or by EPA ID number. Table F-2 shows a sample report of a similar list of all the pollutants
included in WRMS. This sample report orders the pollutants by chemical ID; many other orders are
possible, such as by CAS number, by chemical name, or by waste code.

     Table F-3 shows a report that prints out all available information for a facility. Emissions data
 are grouped and summarized by facility and year, and ordered by chemical name within each facility
 and year group. Individual emission records are shown. This report may be restricted to a single
'facility or group of facilities, such as all facilities in a particular SIC or a particular county.

    Table F-4 shows a report comparing emissions and transfers by category over time for each
facility and chemical. The categories (fugitive air, stack air, water, P O W , etc.) are shown across
the top of the printout, and the records are grouped by facility and chemical, and ordered by year
within each chemical group.

   Tables F-5 and F-6 show samples of reports showing emissions to different media by year and
chemical for a single county or SIC code, respectively. In both reports, the data are grouped and
summarized by year and chemical. Individual facilities are not shown in this summary report.

   Table F-7 shows a report that summarizes trends in total emissions to all media for each facility
and chemical. Each column represents a different year, so that trends in total emissions of a
chemical can be examined by looking across a row. The data are grouped by facility and chemical.

   Table F-8 shows a report summarizing relative toxicity scores for a facility over multiple years.
The relative toxicity scores shown in this report are described in Section 2.4. The report is grouped
by facility and year, and ordered by chemical name within each facility and year group. Emissions
and scores are summarized by facility and year, but individual emission records are also shown.



Page 4-2
    Table F-9 shows a report summarizing changes in waste quantity generated, ordered by waste
minimization activity and chemical. Each year, facilities report the waste quantity generated for the
current reporting year and for the previous reporting year; the report uses these data and is restricted
to a single year, which reflects the current year in the report. The data for the previous year shown
in the report are for the year before the year restricted to, as reported in the current reporting year.
The report is grouped by waste minimization practice, and summarized by chemical within waste
minimization practice. Individual facilities are not shown in this summary report.


4.2 LIMITATIONS OF WRMS

   WRMS is affected by two significant limitations, both related to the inefficiency of certain dBase
query operations on large files. The f i s t affects restriction of the data, and the second affects
ordering the data. See Section 4.1 for definitions of restriction and ordering. The following sections
describe each of these limitations in more detail and suggest ways to work around them when using
WRMS.


   4.2.1 Limitations Affecting Restriction

       dBase is inefficient in restricting the data from a large file to a small percentage of the
   records if the records are ordered. The narrower the restriction, the longer the processing time: a
   relatively simple query involving several of the WRMS data fies and a restriction to all facilities
   in a particular county might take only five minutes to process, but the same query restricted to
   one facility might take an hour. Once the query has been processed, viewing the data or report
   generation based on the resulting restricted view can take even longer than processing the query.

       NCPPP has alleviated this problem for several frequently used reports by writing an extemal
   (non-dBase) program to access the dBase data files directly and generate the desired reports,
   bypassing the use of a query. While this has proven to be much faster than using a query (taking
   a few minutes to process and print), the time and expertise needed to write the programs prevents
   this solution from being used for any but the most commonly used reports.


   4.2.2 Limitations Affecting Ordering

       To describe clearly the l i t a t i o n s of WFWS with respect to ordering, some background on
   how dBase orders data is necessary. dBase uses two methods to order data: indexing, which is
   fairly efficient, but cannot be used in all situations, and sorting, which is inefficient, but can
   virtually always be used.

       In indexing, B a s e creates an index (in another file) that specifies the order in which records
   should be displayed so that they appear in the desired order. For example, for the three-record
   data file shown in Table 4-1, an index on facility name would indicate that record 3 should be
   displayed fist, followed by record 1, followed by record 2, and the data file would be displayed
   as shown in Table 4-2. Note that the record numbers remain unchanged. Indexes are associated
   with a single data base file, but each data base file may have many indexes. For example, the


                                                                                                Page 4-3
       Rec.
       No.     Facility Name            City

         1     Chemicals Unlimited      Raleigh
                                       1 Wilson
         3     Alphabet Textile Co.     Raleigh




       Rec.
       No.     Facility Name            City

  (1     3    I Alphabet Textile Co.   [ Raleigh   I1
         1     Chemicals Unlimited      Raleigh
         2     Wilson Fumiture          Wilson




       Rec.
       No.     Facility Name            City
         1     Alphabet Textile Co.     Raleigh
        2      Chemicals Unlimited      Raleigh
        3      Wilson Fumiture          Wilson




Page 4-4
sample file might have one index to show records by facility name and another to show records
by city. An index may use more than one field as the key to determining order; for example, an
index might order the sample records by city and then by facility name within each city. An
index using more than one field as the key is called a complex index. The user must tell dBase
to create an index, and speclfy a name for the index and the fields to use to determine the order.

    In sorting, dBase physically sorts the records of a data file into the desired order and
renumbers them. Sorting the three-record example shown in Table 4-1 on facility name would
produce the data file shown in Table 4-3, in which the original record 3 has become record 1, the
original record 1 has become record 2, and the original record 2 has become record 3. A data
file can only be sorted one way at any time, and once it is sorted, any previous sort order is lost.

    To order the results of a query, the user enters one or more "sort operators" in the query f i e
skeletons. The name "sort operator" is misleading, because the sort operator merely indicates the
desired order, which dBase may implement by either indexing or sorting, depending on several
factors. If all of the following conditions are true, dBase will use an index to implement the sort
order:

1. Indexes Included: queries by default do not have access to the indexes associated with each
   data file in the query. To include indexes in the query (thereby giving the query access to
   them), the user must select FIELD, INCLUDE INDEXES from the Query Design Menu for each
   data fie. Indexes fields are then marked in the file skeleton, and "pseudofields" are added to
   the file skeleton representing each complex (multifield) index associated with a data file.

2. Only one sort operator: the user may enter multiple sort operators in a query, indicating the
   primary field to sort on, the secondary field to sort on if the f i s t field contains the same
   value, etc. However, an index can only be used if there i only one sort operator.
                                                                s

3. Sort operator is in an indexed field: the single sort operator must be in a field that is
   indexed or a pseudofield representing a complex index. The sort operator must also reflect
   the same ordering scheme (i.e., ascending or descending) as the index. An ascending index
   or sort order (the default) puts things in order from A to 2. A descending index or sort order
   puts things in order from 2 to A.

    If any of these conditions are not met, dBase will physically sort the results of the query.
Creating an index on a large data f i e may take several minutes, but once an index is created,
using it takes no additional time. Sorting a large data base file, on the other hand, may take
hours, and also requires several times as much free disk space as the combined size of the files
being linked and sorted, with WRMS, as much as 15 Mb of free disk space may be required.
Therefore, the user will typically want to avoid queries that sort the query results.

    The first and last of the conditions specified above can easily be met: indexes can always be
included in any query, and if the user wants to put a sort operator in an unindexed field, the user
can create an index on that field.

   The second restriction, requiring only one sort operator, cannot be met for all queries. As
long as all the fields making up the desired index key are in one data file, the user can create an


                                                                                           Page 4-5
   index and there is no limitation. But if the key fields are in more than one data fie, an index
   cannot be created on them, since an index must be associated with a single data fie and can only
   use fields from that one data fie. For example, if the user wanted to order the data by industly
   (using SIC code) then chemical name, they could not create an index because SIC code is in the
   Faciliry f i e and chemical name is in the Chemical file. Therefore, the data would have to be
   sorted to achieve this order. One way to work around this, especially if only one or a few values
   of the SIC code are of interest, is to restrict the data to a single SIC code and order it on
   chemical name; see for example Table F-6, which presents data for a single SIC code. However,
   if all or most of the SIC code values are of interest, it may be faster to sort than to restrict for
   every value separately.

       The WRMS data base has been designed to work around some of the most common sort
   orders involving fields from more than one data fie. Since the Emission f i e is likely to be the
   master file in many queries, and since the facility name and chemical name are two of the most
   useful fields for setting data order, the first few letters of the facility and chemical names have
   been included in the facility and chemical IDS. For example, the facility ID for Alphabet
   Chemical Co. would start with ALPH, and the chemical ID for l,l,l-Trichloroethane would start
   with TRIC. Since these IDSare in the Emission fie, they can be used in a complex (multifield)
   index to approximate the use of the actual facility or chemical name (which are only found in the
   Facility and Chemical Ties, respectively). For chemicals, use of the chemical ID has the added
   benefit of omitting numbers and other nonsorting prefies that should not affect the sort order. A
   variety of complex indexes have been included with the Emission fie; for example, one index
   orders the data by Facility ID plus Chemical ID plus year, another by Facility ID plus year plus
   Chemical ID. If the user wishes to sort on several fields in one file for which no complex index
   is included with W S , the user should create such an index. This index can then be included
   in the query and dBase will use it instead of sorting. Complex indexes are created using the
   ORGANIZE, CREATE NEW INDEX option of either the Browse Menu or the Modify Structure/Order
   Menu. The index expression for a complex index is any valid dBase expression consisting of
   two or more fields. For example, the index expression for the index on Facility ID plus
   Chemical ID plus year is FAC-ID + CHEM-ID + STR(YEAR,4). Note that the numeric year
   field must be converted to a string to create a valid dBase expression.




Page 4-6
           5.0 POTENTIAL APPLICATION BY STATE AND FEDERAL AGENCIES


    Under this pollution prevention demonstration project, a waste reduction management system
(WRMS) was developed to assist North Carolina Pollution Prevention Program (NCPPP) in their
source reduction efforts. By linking existing multimedia environmental data, W S provides
NCPPP with complete environmental release characterizations for identifying waste and risk
reduction opportunities and tracking pollution prevention activities. The WRMS demonstration
                        hs
project documented in ti report can be used by other states and federal agencies to design and
develop their own data bases. This section discusses how such data bases can be used to support
state and federal agencies’ pollution prevention policies.


5.1       STATE AGENCIES

    In recent years, over half of the states have passed pollution prevention laws. To facilitate and
encourage pollution prevention efforts, some of these laws charge state agencies with providing
technical assistance and developing research and development programs. A multimedia
environmental data base, like WRMS, will serve as a useful tool for targeting technical assistance
efforts and prioritizing research and development projects, thus maximizing environmental protection
benefits obtained from state funding. For example, WRMS maintains constituent-specific data that
quantify the volume and the relative toxicity of environmental releases. The WRMS user can
aggregate these constituent-specific data to identify those facilities, industries, geographical regions,
or other areas of concem that emit releases of large volume and/or relatively high toxicity. State
agencies can work in conjunction with these emitters to develop and refine technical assistance
programs to target releases with the greatest potential to reduce risk to human health and the
environment. Furthermore, state agencies will be able to conduct projects to assist these emitters to
develop a comprehensive set of pollution prevention options and determine the economic and
technical feasibility of applying these options. The agencies will also be able to prioritize these
projects based on their potential to reduce risk, and thereby maximizing the environmental protection
benefits from the agency’s efforts.

    As discussed below, multimedia environmental data bases, like WRMS, can serve as useful tools
for tracking pollution prevention progress and improving technical assistance in each state. Since
WRMS maintains several years of pollutant-specific release and generation data, NCPPP will be able
to conduct trend analyses to quantify pollutant loading volume changes over time at various levels of
concem (e.g., state, industry, or facility levels). In addition, the WRMS relative toxicity indexing
scheme can be used to identrfy changes in the relative toxicity of releases over time. Based on the
results from these trend analyses and source reduction information maintained in WRMS, NCPPP
will be able to conduct screening analyses to identify pollutant emitters or generators that may have
successfully reduced waste through pollution prevention activities. NCPPP will be able to contact
these emitters/generators to c o n f i that their reductions are a direct result of pollution prevention
efforts. Reductions directly resulting from pollution prevention activities can be documented as
successful case studies and used by the State’s technical assistance programs to demonstrate benefits
from pollution prevention.




                                                                                                Page 5-1
5.2        FEDERAL AGENCIES

    In the past, some federal environmental protection efforts were modeled after activities conducted
in the states. For example, TRI reporting requirements were designed based on the New Jersey
Industrial Survey of 1979 and similar environmental reporting in Maryland. The following discusses
how WRMS can serve as a prototype data base to support EPA in their pollution prevention efforts.

    In 1989, EPA published a proposed policy statement specifying that pollution prevention was the
preferred approach for protecting human health and the environment. As part of EPA's initiative to
establish a new framework, EPA requested the Science Advisory Board (SAB) to provide general
guidance on reducing environmental risk. In response, the SAB prepared the report "Reducing Risk:
Setting Priorities and Strategies for Environmental Protection" which recommends focusing strategic
planning on targeting those problems with the greatest potential to reduce risk.

    A multimedia environmental data base, similar to WRMS, with an integrated relative toxicity
indexing scheme will be useful in targeting environmental problems with the greatest potential to
reduce risk to human health and the environment. As discussed in Section 2.5, the relative toxicity
indexing scheme included in WRMS provides relative risk scores for each environmental release
based on the following factors: 1) a constituent's relative acute health effects, chronic health effects,
and ecological toxicity and 2) the quantity of constituent released. This scheme can be utilized to
assign a relative toxicity score to all multimedia releases in the nation. These toxicity scores, in
conjunction with release volume and facility-specific information, can be used to identify facilities,
industries, geographical areas, or other areas of concem that emit releases of relatively high toxicity
and/or large volume. Once identified, the Agency will be able to concentrate their efforts on
working with these emitters to determine which releases have feasible reduction potential and
develop methodologies to reduce those releases.

    In October 1990, Congress passed the Pollution Prevention Act, which states "source reduction is
fundamentally different and more desirable than waste management and pollution control." To
promote source reduction, the Agency is responsible for developing and implementing a strategic
plan. Under this plan, the Agency is to "establish standard methods of measurement of source
reduction." An integrated multimedia data base, like WRMS, that maintains several years of
environmental data will serve as a useful tool in measuring source reduction. Specifically, this data
base can be used to conduct trend analyses that will provide an indirect measurement of source
reduction. These trend analyses can be conducted at various levels of concem (e.g., facility- or
industrial- specific) and on various types of pollutants (e.g., SARA 313 toxic chemicals, RCRA
hazardous wastes, etc.). After determining the level and pollutant of concem and establishing a
baseline, the user can track pollutant release or generation trends over time. Other data, such as the
TRI production ratio or activity index, maintained in the data bases may be helpful in evaluating
trends. Results from these trend analyses will provide the Agency with an indirect measurement of
source reduction.

    In summary, WRMS provides a basic structure for a multimedia environmental release data base
that draws on readily available information from existing state and federal environmental reporting
requirements. WRMS provides the following utility to state and federal users:

       -   Serve as a prototype data base;


Page 5-2
-   Identify pollution prevention opportunities at various levels of concem (e.g., state, facility,
    industry, etc.);

-   Target technical assistance efforts;

-   Prioritize research and development projects; and

-   Tracking pollution prevention progress at various levels of concem (e.g., state, facility,
    industry, etc.).




                                                                                          Page 5-3
                                        REFERENCES


Documents

US.EPA. 1991. Pollution Prevention 1991. EPA 21P-3003. Office of Pollution Prevention,
   Washington DC.

U.S. EPA. 1991. Pollution Prevention Research Strategic Plan: Draft Report. Office of Research
    and Development, Washington DC.

US.EPA. 1991. Ofice of Environmental Engineering and Technology Demonstration Strategic
   Plan. Office of Environmental Engineering and Technology Demonstration.

US.EPA. 1988. Waste Minimization Opportunity Assessment Manual. EPAf625/1-88/003
   Hazardous Waste Engineering Research Laboratory, Cincinnati OH.


Data Base Systems

Air Quality National Emissions Data Systems (NEDS) Data Base. 1987-1990. Maintained by U.S.
    EPA.

AQUatic Information REtrieval system (AQUIRE). August 1992. Maintained by US.EPA.

Assessment Tool for Environmental Risk (ASTER). August 1992. Maintained by U.S.EPA.

Hazardous Substance Data Base (HSDB). August 1992. Maintained by National Library of
   Medicine.

Health Effects Assessment Summary Tables (HEAST). March 1992. Maintained by U.S. EPA.

Integrated Risk Information System (IRIS). August 1992. Maintained by U.S. EPA.

Municipalhdustrial Pretreatment Monitoring Data Base. 1987-1990. Maintained by N.C.
  Department of Environment, Health, and Natural Resources.

National Pollutant Discharge Elimination System (NPDES) Permit Monitoring Data Base. 1987-
    1990. Maintained by US.EPA.

North Carolina Annual Report Data Base. 1988-1990. Maintained by N.C. Department of
   Environment, Health, and Natural Resources.

Registry of Toxic Effects of Chemical Substances (RTECS). August 1992. Maintained by National
   Institute for Occupational Safety and Health.

Toxic Release Inventory System (TRIS). 1987-1990. Maintained by US. EPA.


                                                                                       Page R-1
Statutes, Regulations, and Reporting Forms

NC Rule 10 NCAC 10F. (Regulatory Authority for North Carolina Annual Report reporting)

NC Rule 15 NCAC 2B. (Regulatory Authority for NPDES and Pretreatment reporting)

NC Rule 15A NCAC 2H. (Regulatory Authority for NEDS reporting)

Superfund Amendments and Reauthorization Act of 1986. (Statutory Authority for TRI reporting)

Pollution Prevention Act of 1990.

North Carolina State Annual Report Forms. 1988-1990.

Toxic Release Reporting Form R. 1987-1990.




Page R-2
  APPENDIX A

DATA DICTIONARY
                                                 LIST OF TABLES


Table A-1. WRMS Data Base Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1

Table A-2. File Structure for Facility File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1   ~




                                        . . . . . . . . . . . . . . . . . . . ... . . . . . . . . . . . . . .
Table A-3. File Structure for Status File                                        I
                                                                                                                   A-2        .~



Table A-4. File Structure for Chemical File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    A-2

Table A-5. File Structure for Emission File          . . . .. . ... . .. .... . . ... ... .. ... . .... .          A-3

                                                       .
Table A-6. WRMS Data Base Index Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-4

Table A-7. Alphabetical Field Descriptions for WRMS Data Base                    . . . .. ... ... .. . . . . . .   A-5

Table A-8. Allowed Values for FORM-CODE Field . . . . . . . . . . . . . . . . . . . . . . . . . . . A-22

Table A-9. Allowed Values for SRCE-CODE Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-24

Table A-10. Allowed Values for WASTE-MIN Field from State Annual Report                           . ... . . ..     A-26
Table A-1. WRMS Data Base Files


File Name              Description

Facility               Identifying information on facilities emitting pollutants
Status                 Annual facility status information
Chemical               Information on chemicals and wastes emitted
Emission               Data on emissions to all media




Table A-2. File Structure for Facility File


                                 Data
Field name           Format      Sources       D t element
                                                aa

FAC-ID               c10*                      Facility ID
FAC-NAME             C40        T              Facility name
STREET-1             C30        T              Street address, Fist line
STREET-:!            C30        T              Street address, second line
CITY                 C15        T              Facility location city
COUNTY               c12        T              Facility location county
 I
ZP                   c5         T              Facility location zip code
CONTACT              C30        T              Public contact name
PHONE                c0
                      1         T              Phone number
SIC-1                c4         T              First SIC code
SIC-2                c4         T              Second SIC code
SIC-3                c4         T              Third SIC code
EPA-ID               c12        TS             EPA ID number
NPDES                c9         TN             NPDES permit number
PRE-ID               C13        P              Pretreatment source ID
AIR-ID               C8         A              Air quality ID number
TFU-ID               C15        T               F
                                               T U facility ID
LAT                  c7         T              Latitude coordinate
LONG                 C7         T              Longitude coordinate
YEAR-ADDED           N4                        Year facility added to WRMS
CREATED              D                         Date record created
UPDATED              D                         Date record last updated
TEMP-ID               1
                     c0                        Temporary facility ID


Format key:     C = Choracter (number indicates length). N = Numeric (numbers indicate total Iength and decimal
                places), D = Date, L = Logical (Yes/"); * indicates key field.

Data source key: T = TRIS, S = State Annual Report, N = NPDES. P = Pretreatment, A = AIRSINEDS

                                                                                                    Page A-1
Table A-3. File Structure for Status File


                                 Data
Field name           Format      Sources       Data element

FAC-ID               c10*                      Facility ID
YEAR                 N4*                       Reporting year
RECEIV-H20           C25        TN             Receiving waterbody name
POTW                 C30        TP             POTW name




Table A-4. File Structure for Chemical File


                                Data
Field name           Format     Sources        Data element

CHEM_ID              c10*                      Chemical ID
CAS-NUM               1
                     c1         TNPA           CAS number
WASTE-CODE           C16        S              RCRA waste code@)
FORM-CODE            c4         S              RCRA waste physical form code
SRCE-CODE            c3         S              RCRA waste source code
STORET-NUM           c5         N              STORET parameter code
USE-NAME             C60        TSNP           Common chemical name or waste description
CAS-NAME             C50        T              CAS Registry name
AIR-CHR              N12.5                     Relative chronic toxicity index for air
AIR-ACUTE            N12.5                     Relative acute toxicity index for air
SOIL-CHR             N12.5                     Relative chronic toxicity index for soil
SOIL-ACUTE           N12.5                     Relative acute toxicity index for soil
WAT-CHR              N12.5                     Relative chronic toxicity index for water
WAT-ACUTE            N12.5                     Relative acute toxicity index for water
WAT-ECO              N12.5                     Relative ecological toxicity index for water
AIR-MOB              N5.2                      Mobility index for air
AIRPER               N5.2                      Persistence index for air
SOIL-MOB             N5.2                      Mobility index for soil
SOIL-PER             N5.2                      Persistence index for soil
WAT-MOB              N5.2                      Mobility index for water
WAT-PER              N5.2                      Persistence index for water



Format key:     C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
                places), D = Date, L = Logical (YeslNo); * indicates keyfield.

Data Source key: T = TRIS, S = State Annual Report. N = NPDES, P = Pretreahent, A = AIRSINEDS
Page A-2
Table A-5. File Structure for Emission File
 ~~~          ~~         ~~




                                         Data
Field name                Format         Sources       Data element
                                                                                                                     -

FAC-ID                   c10*                          Facility ID                                                   ~




CHEM-ID                  c10*                          Chemical ID
YEAR                     N4*                           Reporting year
SOURCE                   c1*                           Data source                                                   _
SOURCE-ID                CIS             TSNPA         Data source record identifier
FUGIT-AMT                N7              T             Fugitive emissions
FUGIT-B AS               c1              T             Basis of fugitive emissions estimate
FUGIT-RNGE               L               T             Fugitive emissions range flag
STACK-AMI'               N7              TA            Stack emissions
STACKBAS                 c1              TA            Basis of stack emissions estimate
STACK-RNGE               L               T             Stack emissions range flag
WATER-AMT                N8              TN            Water emissions
WATER-BAS                C1              TN            Basis of water emissions estimate
WATER-RNGE               L               T             Water emissions range flag
LAND-AMT                 N7              T             Land emissions
LAND-BAS                 c1              T             Basis of land emissions estimate
LAND-RNGE                L               T             Land emissions range flag
POTW-AMT                 N10             TP            POTW emissions
POTW-BAS                 c1              TP            Basis of POTW emissions estimate
POW-RNGE                 L               T             POTW emissions range flag
OFF-Ah4T                 N10             TS            Amount sent off-site
OFF-B AS                 c1              TS            Basis of off-site estimate
OFF-RNGE                 L               T             Off site range flag
ON-Ah4T                  N10             S             Amount of waste treated or disposed on site
ON-BAS                   c1              S             Basis of on-site estimate
CURR-AMI'                N10             TS            Amount of waste generated in current year
PREV-AMT                 N10             T             Amount of waste generated in previous year
PCT-CHANGE               N4.2            T             Percent change in amount of waste generated
PROD-NDX                 N7.4            TS            Production index
WASTE-MIN                c12             T             Waste minimization activity
MIN-REASON               C2              T             Reason for waste minimization activity




Format key:        C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
                   places). D = Date, L = Logical (YeslNo); indicates key field.
                                                                f




Data source key: T   5   TRIS, S   E   State Annual R2por1, N = NPDES, P = Pretreatment, A = AIRSINERS
                                                                                                         Page A-3
Table A-6. WRMS Data Base Index Keys
                  ~        ~      ~~




File name       Tag                    Key Expression

Facility        FAC-NAME               fac-name
                FAC-ID                 fac-id
                CITY-NAME              city+fac-name
                EPA-ID                 epa-id
                "DES                   npdes
                TEMP-ID                temp-id
                TRI_ID                 tri-id
                ID-NUM                 right(fac_id,6)
                AIR-ID                 air-id
                PRE-ID                 pre-id

status          FACID-YR               fac-id   + str(year,4)
                FAC-ID                 fac-id

Chemical        CHEM-ID                chem-id
                USE-NAME               use-name
                CAS-NUM                cas-num
                STORET-NUM             storet-num
                WASTE-ID               waste-code+form-code+srce-code
                ID-NUM                 right(chem-id,S)

Emission        YR-CHEM                str(year,4)+chem_id
                FAC-ID                 fac-id
                SOURCE-YR              trim(source_id)+str(year,4)
                MlN-CHEM               waste-min+chem-id
                FAC-CHM-YR             fac_id+chem_id+str(year,4)
                CHEM-ID                chem-id
                FAC-YR-CHM             fac-id + str(year,4) + chem-id




Page A-4
Table A-7. Alphabetical Field Descriptions for W R M S Data Base


Field name: AIR-ACUTE                                       Format: N12.5
Files: Chemicai
Data sources: extemal                                                                                                   _
Data element: Relative acute toxicity index for air                                                                     ~




Description:
    This is an index indicating acute toxicity of a chemical in air relative to the "average" acute
    toxicity of all Sec. 313 TRI chemicals in air. A value of 1 indicates "average" acute toxicity in                   _
    air, a value greater than 1 indicates greater then "average" acute toxicity in air, a value less than
    1 indicates less than "average" acute toxicity in air. Acute toxicity in air is measured using the
    inhalation LC50. See A Waste Reduction Management System for the State of North Carolina for
    a more complete discussion of the development of the relative toxicity indexing scheme.

Field name: AIR-CHR                                         Format: N12.5
Files: Chemical
Data sources: extemal
Data element: Relative chronic toxicity index for air
Description:
    This is an index indicating chronic toxicity of a chemical in air relative to the "average" chronic
    toxicity of all Sec. 313 TRI chemicals in air. A value of 1 indicates "average" chronic toxicity in
    air; a value greater than 1 indicates greater then "average" chronic toxicity in air, a value less
    than 1 indicates less than "average" chronic toxicity in air. ChroNc toxicity in air is measured
    using the inhalation RfC and inhalation CSF. See A Waste Reduction Management System for
    the State of North Carolina for a more complete discussion of the development of the relative
    toxicity indexing scheme.

Field name: AIR-ID                                         Fonnat: C8
Files: Facility
Data sources: AIRS/NEDS
Data element: Air quality ID number
Description:
    This is the facility identifier from the NEDS air emission data base. The fist 4 digits are the
    NEDS county code for the facility; the second 4 digits are the source number for the facility.

Field name: AIR-MOB                                         Format: N5.2                                                     r


Files: Chemical                                                                                                              ,
                                                                                                                            -I


Data sources: extemal
Data element: Mobility index for air
Description:
    This is an index indicating the relative mobility of a chemical in air. A value of 0.25 indicates
    low mobility in air, a value of 0.5 indicates moderate mobility in air, a value of 0.75 indicates
    high mobility in air. Mobility in air is measured using vapor pressure. See A Waste Reduction
    Management System for the State of North Carolina for a more complete discussion of the

                                                                                                          (continues)

Fonnat key:   C = Character (number indicates length), N s Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (YeslNo); * indicates keyfield.

                                                                                                         Page A-5
Table A-7. Alphabetical Field Descriptions for WRMS Data Base (continued)


    development of the mobility indices.

Field name: AIR-PER                                          Format: N5.2
Files: Chemical
Data sources: external
Data element: Persistence index for air
Description:
    This is an index indicating the relative persistence of a chemical in air. A value of 0.25 indicates
    low persistence in air, a value of 0.5 indicates moderate persistence in a k a value of 0.75
    indicates high persistence in air. Persistence in air is measured using air residence times and air
    half-times. See A Waste Reduction Management System for the State of North Carolina for a
    more complete discussion of the development of the persistence indices.

Field name: CAS-NAME                                    Format: C50
Files: Chemical
Data sources: TRIS
Data element: CAS Registry name
Description:
    This is the CAS Registry name for chemicals in the data base; it is blank for hazardous wastes,
    STORET parameters, and criteria air pollutants. Format is all caps.

Field name: CAS-NUM                                        Format: C11
Files: Chemical
Data sources: TRIS, NPDES, Pretreatment, AIRSNEDS
Data element: CAS number
Description:
    This is the CAS number for a chemical; it is blank for hazardous wastes, STORET parameters,
    and criteria air pollutants. Format is 123456-78-9; if the CAS number is shorter than 11
    characters, it is right justified with leading spaces.

Field name: CHEM-ID                                        Format: C10*
Files: Chemical, Emission
Data sources: intemal
Data element: Chemical ID
Description:
    This is an intemally generated alphanumeric code that uniquely identifies each chemical,
    hazardous waste, STORET parameter, or criteria air pollutant. The first character is a letter
    identifying the type of pollutant; allowed values are A = criteria air pollutant, C = chemical, S =
    STORET parameter, and W = hazardous waste. The next 4 characters are the first 4 sorting
    characters of the common chemical name or waste description found in USE-NAME; nonsorting
    characters, such as numbers and prefmes, are omitted. If the common name contains fewer than
    4 sorting characters, underscore characters are used to bring the length of this part of the code up

                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (YeslNo); * indicates key field.

Page A-6
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)
                        -~~          ~    ~~




    to 4 characters: e.g., BOD- for BOD. The last 5 digits of the code are a serially assigned
    number that is unique for each pollutant. These 5 digits uniquely identify each pollutant; the first
    5 are included in the code to facilitate sorting of records by pollutant.

Field name: CITY                                            Format: C15
Files: Facility
Data sources: T R I S , State Annual Report
Data element: Facility location city
Description:
    This is the name of the city in which a facility is located. Format is aU caps

Field name: CONTACT                                        Format: C30
Files: Facility
Data sources: TFUS, State Annual Report
Data element: Public contact name
Description:
    This is the name of the current public contact for a facility. Format is all caps.

Field name: COUNTY                                         Format: C12
Files: Facility
Data sources: T R I S , State Annual Report
Data element: Facility location county
Description:
    This is the name of the county in which a facility is located. Format is all caps

Field name: CREATED                                        Format: D
Files: Facility
Data sources: intemal
Data element: Date record created
Description:
    This is the date a facility record was created by the CONVERT program. Format is
    MMIDDflY.

Field name: CURR-Ah4T                                    Format: N10
Files: Emission
Data sources: TRIS, State Annual Report
Data element: Amount of waste generated i current year
                                            n
Description:
    This is the total amount of a chemical generated as waste in the reporting year. Units are Ibs.




                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate tofal length and decimal
              duces), D = Date, L = Loaical (YesINo): * indicates kev field.
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)


Field name: EPA-ID                                                Format: C12
Files: Facility
Data sources: TRIS, State Annual Report
Data element: EPA ID number
Description:
    This is the EPA ID number for a facility.

Field name: FAC-ID                                             Format: C10*
Files: Facility, Status, Emission
Data sources: intemal
Data element: Facility ID
Description:
    This is an intemally generated alphanumeric code that uniquely identifies each facility. The first
    4 characters are the first 4 characters of the facility name found in FAC-NAME. If the facility
    name contains fewer than 4 characters, underscore characters are used to bring the length of this
    part of the code up to 4 characters: e.g., ABC- for ABC. The last 6 digits of the code are a
    serially assigned number that is unique for each facility. These 6 digits uniquely identify each
    facility; the first 5 are included in the code to facilitate sorting of records by facility.

Field name: FAC-NAhlE                                             Format: C40
Files: Facility
Data sources: TRIS,State Annual Report
Data element: Facility name
Description:
    This is the name of the facility. Format is all caps.

Field name: FORM-CODE                                      Format: C4
Files: Chemical
Data sources: State Annual Report
Data element: RCRA waste physical form code
Description:
    This is the RCRA physical form code reported in the State Annual Report from 1989 on. Table
    A-7 lists the allowed values. The descriptions listed in Table A-7 are incorporated into the waste
    description entered in USE-NAME.

Field name: FUGlT-Ah4T                                     Format: N7
Files: Emission
Data sources: TRIS,AIRS/NEDS
Data element: Fugitive emissions
Description:
    This is the quantity of fugitive emissions of a chemical to air from a facility for the reporting
    year. Units are pounds.

                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              olacesJ, D = Date, L = Loaical (YeslNo): * indicates key field.

Page A-8
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)


Field name: FUGIT-BAS                                     Format: C1
Files: Emission
                                                                                                                        -
Data sources: TRIS, AJRSWDS
Data element: Basis of fugitive emissions estimate                                                                      ~




Description:
    This is the basis for the emissions estimate in FUGlT-AMT. Allowed values are C = calculated,
    E = estimated, M = measured, and 0 = other.                                                                             _

Field name: FUGIT-FWGE                                     Format: L
Files: Emission
Data sources: TRIS
Data element: Fugitive emissions range flag
Description:
    This indicates whether or not the emissions estimate in FUGIT-AMT was estimated from a range.
    Allowed values are T = True and F or blank = False. If True, the value shown in FUGIT-AMT
    is the midpoint of the reported range: 250 for 1 - 499, and 750 for 500 - 999.

Field name: LAND-AMT                                       Format: N7
Files: Emission
Data sources: TRIS
Data element: Land emissions
Description:
    This is the quantity of emissions of a chemical to land from a facility for the reporting year.
    Units are pounds.

Field name: LANDBAS                                      Format: C1
Files: Emission
Data sources: TTUS
Data element: Basis of land emissions estimate
Description:
    This is the basis for the emissions estimate in LAND-AMT. Allowed values are C = calculated,
    E = estimated, M = measured, and 0 = other.

Field name: LAND-RNGE                                      Format: L
Files: Emission
Data sources: TRIS
Data element: Land emissions range flag
Description:
    This indicates whether or not the emissions estimate in LAND-AMT was estimated from a range.
    Allowed values are T = True and F or blank = False. If True, the value shown in LAND-AMT
    is the midpoint of the reported range: 250 for 1 - 499, and 750 for 500 - 999.


                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (Yes/NoJ;* indicates k q f i e l d .

                                                                                                         Page A-9
Table A-7. Alphabetical Field Descriptions for WRMS Data Base (continued)


Field name: LAT                                              Format: C7
Files: Facility
Data sources: TRIS,AIRS/NEDS
Data element: Latitude coordinate
Description:
    This is the latitude coordinate for a facility location.

Field name: LONG                                             Format: C7
Files: Facility
Data sources: T R I S , AIRSMDS
Data element: Longitude coordinate
Description:
    This is the longitude coordinate for a facility location.

Field name: MIN-REASON                                    Format: C2
Files: Emission
Data sources: TRIS
Data element: Reason for waste minimization activity
Description:
    This is a code for the reason waste minimization activities were undertaken for a chemic1 by a
    facility for the reporting year. Allowed values are R1 = Regulatory requirement for the waste,
    R2 = Reduction of treatment/disposal costs, R3 = Other process cost reduction, R4 = Self-
    initiated review, R5 = Other, and NA or blank = not available.

Field name: NPDES                                                 Format: C9
Files: Facility
Data sources: T R I S , NPDES
Data element: NPDES permit number
Description:
    This is the NPDES permit number for a facility.

Field name: OFF-AMT                                        Format: N10
Files: Emission
Data sources: TRIS, State Annual Report
Data element: Amount sent off-site
Description:
    This is the quantity of a chemical or waste sent off-site for treatment or disposal from a facility
    for the reporting year. Units are pounds




                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Lonical (YeslNo); * indicates key field.
Page A-10
Table A-7. Alphabetical Field Descriptions for WRMS Data Base (continued)


Field name: OFF-BAS                                      Format: C1
Files: Emission
Data sources: T R I S , State Annual Report
Data element: Basis of off-site estimate
Description:
    This is the basis for the emissions estimate in OFF-AMT. Allowed values are C = calculated, E
    = estimated, M = measured, and 0 = other.

Field name: OFF-RNGE                                      Format: L
Files: Emission
Data sources: TRIS
Data element: Off site range flag
Description:
    This indicates whether or not the emissions estimate in OFF-AMT was estimated from a range.
    Allowed values are T = True and F or blank = False. If True, the value shown in OFF-AMT is
    the midpoint of the reported range: 250 for 1 - 499, and 750 for 500 - 999.

Field name: ON-AMT                                         Fonnat: N10
Files: Emission
Data sources: State Annual Report
Data element: Amount of waste treated or disposed on site
Description:
    This is the quantity of a chemical or waste treated or disposed on-site at a facility for the
    reporting year. Units are pounds.

Field name: ON-BAS                                       Format: C1
Files: Emission
Data sources: State Annual Report
Data element: Basis of on-site estimate
Description:
    This is the basis for the emissions estimate in ON-AMT. Allowed values are C = calculated, E
    = estimated, M = measured, and 0 = other.

Field name: PCT-CHANGE                                   Format: N4.2
Fdes: Emission
Data sources: T R I S
Data element: Percent change in amount of waste generated
Description:
    This is the percent change in the amount of a chemical generated as waste between the reporting
    year and the previous year.




                                                                                                          (continues)

Formal key:
                                   -
              C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places). D = Date. L Logical (YeslNoJ;* indicates keyfield.

                                                                                                        Page A- 11
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)


Field name: PHONE                                        Format: C10
Files: Facility
Data sources: TRIS,State Annual Report
Data element: Phone number
Description:
    This is the phone number for the current public contact for a facility. Format is area code,
    prefix, and number, undelimited, as 9195551234

Field name: POTW                                         Format: C30
Files: Status
Data sources: TRIS, Pretreatment
Data element: POTW name
Description:
    This is the name of the P O W to which a facility discharges, or, if the name is not available, the
    name of the jurisdiction operating the POTW to which a facility discharges.

Field name: POW-AMT                                       Format: N10
Files: Emission
Data sources: T R I S , Pretreatment
Data element: POTW emissions
Description:
    This is the quantity of a chemical sent to a P O W from a facility for the reporting year. Units
    are pounds.

Field name: POW-BAS                                    Format: C1
Files: Emission
Data sources: TRIS, Pretreatment
Data element: Basis of POTW emissions estimate
Description:
    This i the basis for the emissions estimate in POW-AMT. Allowed values are C = calculated,
          s
    E = estimated, M = measured, and 0 = other.

Field name: POW-RNGE                                       Format: L
Files: Emission
Data sources: TRIS
Data element: P O W emissions range flag
Description:
    This indicates whether or not the emissions estimate in P 0 T W - M was estimated from a range.
    Allowed values are T = True and F or blank = False. If True, the value shown i POW-AMT
                                                                                   n
    is the midpoint of the reported range: 250 for 1 - 499, and 750 for 500 - 999.




                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (YeslNo); * indicates keyfield.

Page A-12
Table A-7. Alphabetical Field Descriptions for WRMS Data Base (continued)


Field name: PFU-ID                                  Format: C13
Files: Facility
Data sources: intemal
Data element: Pretreatment source ID
Description:
    This is the NPDES permit number of a POTW and the Industrial User number of a facility
    discharging to that P O W .

Field name: PREV-AMT                                         Format: N10
Files: Emission
Data sources: TIUS
Data element: Amount of waste generated in previous year
Description:
    This is the total amount of a chemical generated as waste in the year before the reporting year
    (e.g., if the reporting year is 1989, this is the amount generated in 1988).

Field name: PROD-NDX                                      Format: N7.4
Files: Emission
Data sources: TRIS, State Annual Report
Data element: Production index
Description:
    This is an index comparing the production level at a facility in the current reporting year to the
    production level the previous year. A value of one indicates no change in production level.
    Values greater than one indicate an increase in production; values less than one indicate a
    decrease in production.

Field name: RECEIV-H20                                    Format: C25
Files: Status
Data sources: T R I S , NPDES
Data element: Receiving waterbody name
Description:
    This is the name of the waterbody that receives a facility's water discharges during the reporting
    year.

Field name: SIC-1                                           Format: C4
Files: Facility
Data sources: T R I S
Data element: First SIC code
Description:
                              I
    This is the fist 4-digit S C code reported for a facility.




                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (YeslNo); * indicates key field.

                                                                                                        Page A-13
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)


Field name: SIC-2                                          Format: C4
Files: Facility
Data sources: TRIS
Data element: Second SIC code
Description:
    This is the second 4-digit SIC code reported for a facility.

Field name: S I C 3                                          Format: C4
Files: Facility
Data sources: TRIS
Data element: Third SIC code
Description:
    This is the third 4-digit SIC code repoxted for a facility.

Field name: SOIL-ACUTE                                      Format: N12.5
Files: Chemical
Data sources: extemal
Data element: Relative acute toxicity index for soil
Description:
    This is an index indicating acute toxicity of a chemical in soil relative to the "average" acute
    toxicity of all Sec. 313 TRI chemicals in soil. A value of 1 indicates "average" acute toxicity in
    soil; a value greater than 1 indicates greater then "average" acute toxicity in soil; a value less
    than 1 indicates less than "average" acute toxicity in soil. Acute toxicity in soil is measured
    using the LD50 and LC50. See A Waste Reduction Management System for the State ofNorth
    Carolina for a more complete discussion of the development of the relative toxicity indexing
    scheme.

Field name: SOIL-CHR                                         Format: N12.5
Files: Chemical
Data sources: extemal
Data element: Relative chronic toxicity index for soil
Description:
    This is an index indicating chronic toxicity of a chemical in soil relative to the "average" chronic
    toxicity of al Sec. 313 TRI chemicals in soil. A value of 1 indicates "average" chronic toxicity
                 l
    in soil; a value greater than 1 indicates greater then "average" chronic toxicity in soil; a value
    less than 1 indicates less than "average" chronic toxicity in soil. Chronic toxicity in soil is
    measured using the oral RfD, inhalation RfC, oral and inhalation CSF, and oral NOAEL. See A
    Waste Reduction Management System for the State of North Carolina for a more complete
    discussion of the development of the relative toxicity indexing scheme.




                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (YeslNo); * indicates key field.

Page A-14
Table A-7. Alphabetical Field Descriptions for WRMS Data Base (continued)


Field name: SOIL-MOB                                        Format: N5.2
Files: Chemical
Data sources: extemal
Data element: Mobility index for soil
Description:
    This is an index indicating the relative mobility of a chemical in soil. A value of 0.25 indicates
    low mobility in soil; a value of 0.5 indicates moderate mobility in soil; a value of 0.75 indicates
    high mobility in soil. Mobility in soil is measured using log Koc. See A Waste Reduction
    Management System for the State of North Carolina for a more complete discussion of the
    development of the mobility indices.

Field name: SOIL-PER                                        Format: N5.2
Files: Chemical
Data sources: extemal
Data element: Persistence index for soil
Description:
    This is an index indicating the relative persistence of a chemical in soil. A value of 0.25
    indicates low persistence in soil; a value of 0.5 indicates moderate persistence in soil; a value of
    0.75 indicates high persistence in soil. Persistence in soil is measured using EPA biodegradation
    category, BOD Half-life, and log P (log of the octanol-water partition coefficient). See A Waste
    Reduction Management System for the State of North Carolina for a more complete discussion of
    the development of the persistence indices.                                                                          -
                                                                                                                        =*
Field name: SOURCE                                         Format: C1*                                                   7

Files: Emission
Data sources: internal
Data element: Data source
Description:
    This is a code for the source of the data in a record. Allowed values are A = AJRSWDS, N =
    NPDES, P = Pretreatment, S = State Annual Report, and T = 'IRIS.

Field name: SOURCE-ID                                       Format: C18
Files: Emission
Data sources: TRIS, State Annual Report, NPDES, Pretreatment, AIRS/NE?DS
Data element: Data source record identifier
Description:
    This is the record identifier from the source data base. For TRIS, this is the submission
    document control number; for State Annual Report, the EPA ID plus the waste code plus the line
    number; for NPDES, the NPDES permit number plus the parameter code; for Pretreatment, the
    POTW NPDES number plus the plant number; and for AIRSWEDS, the county number plus the
    source number.


                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places). D = Date, L = Logical (YeslNo); * indicates key field.

                                                                                                        Page A-15
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)


Field name: SRCE-CODE                                      Format: C3
Files: Chemical
Data sources: State Annual Report
Data element: RCRA waste source code
Description:
    This is the RCRA waste source code reported in the State Annual Report from 1989 on. Table
    A-8 lists the allowed values. The descriptions listed in Table A-8 are incorporated into the waste
    description entered in USE-NAME.

Field name: STACK-AMT                                      Format: N7
Files: Emission
Data sources: TRIS, AIRWEDS
Data element: Stack emissions
Description:
    This is the quantity of stack emissions of a chemical to air from a facility for the reporting year.
    Units are pounds.

Field name: STACK-BAS                                    Format: C1
Files: Emission
Data sources: TRIS, AIRS/NEDS
Data element: Basis of stack emissions estimate
Description:
    This is the basis for the emissions estimate in STACK-AMT. Allowed values are C =
    calculated, E = estimated, M = measured, and 0 = other.

Field name: STACK-RNGE                                    Format: L
Files: Emission
Data sources: TRIS
Data element: Stack emissions range flag
Description:
    This indicates whether or not the emissions estimate in STACK-AMT w s estimated from a
                                                                         a
    range. Allowed values are T = True and F or blank = False. If True, the value shown in
    STACK-AMT is the midpoint of the reported range: 250 for 1 - 499, and 750 for 500 - 999.

Field name: STORET-NUM                                 Format: C5                                                       -;
Files: Chemical
Data sources: NPDES
Data element: STORET parameter code
Description:
    This is the STORET parameter code for a water pollutant. Format is 5 digits with leading zeros.



                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date. L = Logical (YeslNo); * indicates keyfield.

Page A-16
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)


Field name: STREET-1                                         Format: C30
Files: Facility
Data sources: TRIS
Data element: Street address, first line
Description:
    This is the first line of the street address where the facility is located. Format is all caps.

Field name: STREET-2                                       Format: C30
Files: Facility
Data sources: TRIS
Data element: Street address, second line
Description:
    This is the second line of the street address where the facility is located. Format is all caps.

Field name: TEMPID                                         Format: C10
Files: Facility
Data sources: intemal
Data element: Temporary facility ID
Description:
    This is a temporary facility ID created, used, and deleted by the CONVERT program during
    facility matching for TRIS data.

Field name: TR-ID                                             Format: C15
Files: Facility
Data sources: TFUS
Data element: TRI facility ID
Description:
    This is the TRI facility ID; it consists of the facility zip code, the first 5 consonents i the facility
                                                                                              n
    name, an the first 5 characters of the facility address. Blanks are allowed if either the facility
    name or addres contains fewer than 5 usable characters.

Field name: WDATED                                          Format: D
Files: Facility
Data sources: intemal
Data element: Date record last updated
Description:
    This is the date a facility record w s last updated by the CONVERT program.
                                        a




                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (Yes/"); indicates key field.

                                                                                                        Page A-17
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)


Field name: USE-NAME                                       Format: C60
Files: Chemical
Data sources: TRIS,State Annual Report, NPDES, Pretreatment
Data element: Common chemical name or waste description
Description:
    This is the pollutant name used in reports from the data base. For chemicals, it is the common
    name for the chemical; for hazardous wastes, it is a waste description, either as reported (for
    1988) or constructed from the physical form and source code descriptions (1989 and after); for
    STORET parameters and criteria air pollutants, it is the name of the pollutant.

Field name: WASTI-CODE                                      Format: C16
Files: Chemical
Data sources: State Annual Report
Data element: RCRA waste code@)
Description:
    This field may contain up to 4 RCRA waste codes for a hazardous waste. Waste codes are
    sorted alphabetically before entry; therefore, nothing should be contrued from the order of the
    codes.

Field name: WASTI-MIN                                     Format: C12
Files: Emission
Data sources: TRIS,State Annual Report
Data element: Waste minimization activity
Description:
    This is a code for waste minimization activity undertaken for a chemical by a facility in the
    reporting year. Each code is three characters; up to 4 may be shown in this field. TRIS and
    State Annual Report use different coding systems; these cannot be readily combined, so codes are
    entered as reported in the source data. For TRIS, the allowed values are M1 = Recycling/reuse
    on-site, M2 = Recycling/reuse off-site, M3 = Equipment/technology modifications, M4 = Process
    procedure modifications, M5 = Reformulationhedesign of product, M6 = Substitution of raw
    materials, M7 = Improved housekeeping, training, inventoly control, and M8 = Other waste
    minimization technique. Allowed values for State Annual Report are listed in Table A-9.

Field name: WAT-ACUTE                                       Format: N12.5
Files: Chemical
Data sources: extemal
Data element: Relative acute toxicity index for water
Description:
    This is an index indicating acute toxicity of a chemical in water relative to the "average" acute
    toxicity of all Sec. 313 TRI chemicals in water. A value of 1 indicates "average" acute toxicity
    in water; a value greater than 1 indicates greater then "average" acute toxicity in water; a value
    less than 1 indicates less than "average" acute toxicity in water. Acute toxicity in water is

                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (YeslNo); * indicates key jield.

Page A-18
Table A-7. Alphabetical Field Descriptions for WRMS Data Base (continued)


   measured using the oral LD50. See A Waste Reduction Management System for the State of
   North Carolina for a more complete discussion of the development of the relative toxicity
   indexing scheme.

Field name: WAT-CHR                                         Format: N12.5
Files: Chemical
Data sources: extemal                                                                                                   -
Data element: Relative chronic toxicity index for water
Description:
    This is an index indicating chronic toxicity of a chemical in water relative to the "average"
    chronic toxicity of all Sec. 313 TRI chemicals in water. A value of 1 indicates "average" chronic
    toxicity in water; a value greater than 1 indicates greater then "average" chronic toxicity in water;
    a value less than 1 indicates less than "average" chronic toxicity in water. Chronic toxicity in
    water is measured using the oral RfD, oral CSF, and oral NOAEL. See A Waste Reduction
    Management System for the State o North Carolina for a more complete discussion of the
                                         f
    development of the relative toxicity indexing scheme.

Field name: WAT-ECO                                          Format: N12.5
Files: Chemical
Data sources: extemal
Data element: Relative ecological toxicity index for water
Description:
    This is an index indicating ecological toxicity of a chemical in water relative to the "average"
    ecological toxicity of all Sec. 313 TRI chemicals in water. A value of 1 indicates "average"
    ecological toxicity in water; a value greater than 1 indicates greater then "average" ecological
    toxicity in water; a value less than 1 indicates less than "average" ecological toxicity in water.
    Ecological toxicity in water is measured using the aquatic LD50 for vertebrates and invertabrates
    and the BCF (bioconcentration factor). See A Waste Reduction Management System for the State
    o North Carolina for a more complete discussion of the development of the relative toxicity
     f
    indexing scheme.

Field name: WAT-MOB                                         Format: N5.2
Files: Chemical
Data sources: extemal
                                                                                                                        -i
Data element: Mobility index for water                                                                                  -t

Description:
    This is an index indicating the relative mobility of a chemical in water. A value of 0.25 indicates
    low mobility in water; a value of 0.5 indicates moderate mobility in water; a value of 0.75
    indicates high mobility in water. Mobility in water is measured using solubility in water. See A
    Waste Reduction Management System for the State o North Carolina for a more complete
                                                          f
    discussion of the development of the mobility indices.


                                                                                                          (continues)

Format key:   C = Character (number indicates length). N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (YeslNo); * indicares key field.
                                                                                                        Page A-19
Table A-7. Alphabetical Field Descriptions for W R M S Data Base (continued)


Field name: WAT-PER                                         Format: N5.2
Files: Chemical
Data sources: extemal
Data element: Persistence index for water
Description:
    This is an index indicating the relative persistence of a chemical in water. A value of 0.25
    indicates low persistence in water; a value of 0.5 indicates moderate persistence i water; a value
                                                                                       n
    of 0.75 indicates high persistence in water. Persistence in water is measured using EPA
    biodegradation category, BOD Half-life, and log P (log of the octanol-water partition coefficient).
                                                                 f
    See A Waste Reduction Management System for the State o North Carolina for a more complete
    discussion of the development of the persistence indices.

Field name: WATER-AMT                                     Format: N8
Files: Emission
Data sources: TRIS,NPDES
Data element: Water emissions
Description:
    This is the quantity of emissions of a chemical to water from a facility for the reporting year.
    Units are pounds.

Field name: WATER-BAS                                    Format: C1
Files: Emission
Data sources: TRIS, NPDES
Data element: Basis of water emissions estimate
Description:
    This is the basis for the emissions estimate in WATER-AMT. Allowed values are C =
    calculated, E = estimated, M = measured, and 0 = other.

Field name: WATER-RNGE                                    Format: L
Files: Emission
Data sources: TRIS
Data element: Water emissions range flag
Description:
    This indicates whether or not the emissions estimate in WATER-AMT was estimated from a
    range. Allowed values are T = True and F or blank = False. If True, the value shown in
    WATER-AMT is the midpoint of the reported range: 250 for 1 - 499, and 750 for 500 - 999.




                                                                                                          (continues)

Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places), D = Date, L = Logical (YeslNo); * indicates keyfield.

Page A-20
Table A-7. Alphabetical Field Descriptions for WRMS Data Base (continued)


Field name: YEAR                                          Format: N49
Files: Status, Emission
Data sources: intemal
Data element: Reporting year
Description:
    This is the calendar year for which emissions are reported.

Field name: YEAR-ADDED                                      Format: N4
Files: Facility
Data sources: intemal
Data element: Year facility added to WRMS
Description:
    This is the year a facility first appeared in TRIS and was added to WRMS.

Field name: ZP I                                                  Format: C5
Files: Facility
Data sources: TRIS, State Annual Report
Data element: Facility location zip code
Description:
    This is the 5-digit zip code for a facility location.




Format key:   C = Character (number indicates length), N = Numeric (numbers indicate total length and decimal
              places). D = Date. L = Lo~ical (YeslNo); * indicutes kev field.

                                                                                                        Page A-21
Table A-8. Allowed Values for FORM-CODE Field


BOO1    Lab packs, old chems only
BO02    Lab packs, debris only
BO03    Mixed lab packs
BO09    Other lab packs
BlOl    Aq. waste, low solvents
B 102   Aq. waste, low other toxic organics
B 103   Spent acid with metals
B 104   Spent acid without metals
B105    Acidic aqueous waste
B 106   Caustic sol. w/ metals, no cyanides
B 107   Caustic sol. w/ metals & cyanides
B108    Caustic sol. w/ cyanides, no metals
B109    Spent caustic
BllO    Caustic aqueous waste
Blll    Aq. waste w/ radioactive sulfides
B112    Aq. waste w/ other radioactives
B113    Other aq. waste w/ high diss. solid
B114    Other aq. waste w/ low diss. solids
B115    Scrubber water
B116    Leachate
B117    Waste liquid mercury
B119    Other inorganic liquids
B201    Conc. solvent-water solution
B202    Halogenated solvent
B203    Nonhalogenated solvent
B204    Halogen./nonhalogen. solvent miX
B205    Oil-water emulsion/mixture
B206    Waste oil
B207    Conc. aq. sol. of other organics
B208    Conc. phenolics
B209    Organic paint,ink,lacquer,vamish
B210    Adhesives or epoxies
B211    Paint thinner, petroleum distillate
B212    Reactive/polymerizable organic liq.
B219    Other organic liquids
B301    Soil contam. w/ organics
B302    Soil contam. w/ inorganics only
B303    Ash,slag,other incinerator residue
B304    Other dry ash,slag,themal residue
B305    Dry lime, metal oh solids, fixed
B306    Dry lime, metal oh solids,not fixed
B307    Metal scale, fiings, scrap
B308    Empty or crushed metal containers
B309    Batteries & parts, casings, cores
B310    Spent solid filters, absorbents

                                                (continues)

Page A-22
Table A-8. Allowed Values for FORM-CODE Field (continued)
-
B311   Asbestos solids & debris
B312   Metal-cyanide salts/chems.
B313   Reactive cyanide salts/chems.
B314   Reactive sulfide salts/chems.
B315   Other reactive salts/chems.
B316   Other metal salts/chems.
B319   Other waste inorganic solids
B401   Halogenated pesticide solid
B402   Nonhalogenated pesticide solid
B403   Solid resins, polymerized organics
B404   Spent carbon
B405   Reactive organic solid
B406   Empty fiber or plastic containers
B407   Other halogenated organic solids
B409   Other nonhalogenated organic solids
B501   Lime sludge w/o metals
B502   Lime sludge w/metals&metal oh sludg
B503   Wwt sludge w/ toxic organics
B504   Other wwt sludge
B505   Untrt’d plating sludge w/o cyanides
B506   Untrt’d plating sludge w/ cyanides
B507   Other sludge w/ cyanides
B508   Sludge w/ reactive sulfides
B509   Sludge w/ other reactives
B510   Degreassludge w/metal scale,filing
B511   Air poll. control device sludge
B512   Sediment contam. w/ organics
B513   Sediment contam. w/ inorganics only
B514   Drilling mud
B515   Asbestos slurry or sludge
B516   Chloride or other brine sludge
B519   Other inorganic sludges
B601   Still bottoms of hatog. solvents
B602   Still bottoms of nonhalog. solvents
B603   Oily sludge
B604                      n
       Organic paint or i k sludge
B605   Reactive or polymerizable organics
B606   Resins, tars, or tany sludge
B607   Biological treatment sludge
B608   Sewage, other untrt’d biol. sludge
B609   Other organic sludges
B701   Inorganic gases
B801   Organic gases




                                                            Page A-23
Table A-9. Allowed Values for SRCE-CODE Field


A0 1    Stripping
A02     Acid cleaning
A03     Caustic (alkali) cleaning
A04     Flush rinsing
A05     Dip rinsing
A06     Spray rinsing
A07     Vapor degreasing
A08     Phys. scraping & removal
A09     Clean out process equip.
A19     Other cleaning/degreasing
A2 1    Painting
A22     Electroplating
A23     Electroless plating
A24     Phosphating
A25     Heat treating        I
                             .

A26     Pickling
A21     Etching
A29     Other surf. coating/prep.
A3 1    Product rinsing
A32     Product filtering
A33     Product distillation
A34     Product solvent extract.
A35     By-product processing
A36     Spent catalyst removal
A37     Spent proc. liq. removal
A38       ak
        T n sludge removal
A39      Slag removal
A40      Metal forming
A4 1     Plastics forming
A49      Other non-surf.prep.procs
A5 1     Leak collection
 A52     Leachate collection
A53      Cleanup of spill residues
A54      Oil changes
A55      Filterbattery replacemnt
A56      Discontme of proc.equip
 A51     Discarding off-spec mat’l
 A58     Discard old prods./chems.
 A59     Laboratory wastes
 A60     Sludge removal
 A6 1    Closure,waste unitdequip
 A69     Other intermittent procs.
 All     Filteringhreening
 A12     Metals recovery
 A13     Solvents recovery
                                                (continues)

 Page A-24
Table A-9. Allowed Values for SRCE-CODE Field (continued)


A74    Incineratiodthermal trt.
A75    Wastewater treatment
A76    Sludge dewatering
A77    Stabilization
A78     i
       A r poll. control devices
A79    Other poll. controlhwt
A8 1   Clothing/personal equip.
A82    Routine cleanup wastes
A89    Other




                                                            Page A-25
Table A-10. Allowed Values for WASTE-MIN Field


M1          Recycling/reuse on-site
M2          Recycling/reuse off-site
M3          Equipment/technology modifications
M4          Process procedure modifications
M5          Refonnulation/redesign of product
M6          Substitution of raw materials
M7          Improved housekeeping, training, inventory control
M8          Other waste minimization technique
wo 1        On-site recycling began during reporting year
wo2         Off-site recycling began during reporting year
w11         Began to segregate types o haz waste to make them more amenable to recycling
                                         f
w12         Began to segregate (stopped combining) haz waste from nonhaz waste
W13         Improved maintenance scheduling, recordkeeping, or procedures
W14         Changed production schedule to minimize equipment and feedstock changeovers
W19         Other changes in operating practices
w21         Instituted procedures to emure that materials do not stay in invetory beyond shelf-life
w22         Began to test outdated material-continue to use if still effective
w23         Eliminated shelf-life requirements for stable materials
w24         Instituted better labelling procedures
W25         Instituted clearinghouse to exchange materials that would otherwise be discarded
w29         Other inventory control
W3 1        Improved storage or stacking procedures
W32         Improved procedures for loading, unloading, and transfer operations
w33         Installed overflow a l m s or automatic shut-off valves
w34         Installed secondary containment
w35         Installed vapor recovery systems
W36         Implemented inspection or monitoring program of potential spill or leak sources
w39         Other spill and leak prevention
W41         Increased purity of raw materials
W42         Substituted raw materials
w49         Other raw material modifications
W51         Instituted closed-loop recycling
W52         Modified equipment, layout, or piping
w53         Changed process catalyst
w54         Instituted better controls on operating conditions
w55         Changed from small volume containers to bulk containers to minimize discarding empty
            containers
W58         Other process modifications
w59         Modified stripping/cleaning equipment
W60         Changed to mechanical stripping/cleaning devices (from solvents or other materials)
W61         Changed to aqueous cleaners (from solvents or other materials)
W62         Reduced the number of solvents used, to make waste more amenable to recycling
W63         Modified containment procedures for cleaning units
W64         Improved draining procedures
W65         Redesigned parts racks to reduce dragout

                                                                                            (continues)

Page A-26
Table A-10. Allowed Values for WASTE-MIN Field (continued)


W66       Modified or installed rinse systems
W67       Improved rinse equipment design
W68       Improved rinse equipment operation
W71       Other cleaning and degreasing
W72       Modified spray systems or equipment
w73       Substituted coating materials used
w74       Improved application techniques
w75       Changed from spray to other system
W78       Other surface preparation and finishing
W8 I      Changed product specifications
W82       Modified design or composition
W83       Modified packaging
W89       Other product modifications
w99       Other source reduction activity




                                                             Page A-27
        APPENDIX B

SOURCE DATA FILE STRUCTURES
                                                   LIST OF TABLES

                                                                                                             m
Table B.1       .    File Structure for Submismdbf      ..................................                    B-1
                                                                                                                      -
Table B.2 . File Structure for Releuse.dbf             ...................................                    B-1     ~




Table B.3       .   File Structure for Annrepdbf for Reporting Year 1988    . . . . . . . . . . . . . . . . . . B-2
                                                                                                                      _
Table B.4       .   File Structure for Annrep.dbf for Reporting Year 1989   ..................                B-2

Table B.5 . File Structure for Annrep.dbf for Reporting Year 1990           ..................                B-3

Table B.6       .   File Structure for Npdes.dut      ....................................                    b-4

table B.7   .       File Structure for Prefreur.duf    ...................................                    B-4

Table B.8       .   File Structure for Potw.dbf    .....................................                      B-5

Table B.9 . File Structure for Airs.dut           ......................................                     B-5

Table B.10 . File Structure for Submext.dbf             ..................................                   B-6

Table B.11 . File Structure for Relextdbf             ....................................                    B-7

Table B.12 . File Structure for Anrepext.dbf            ..................................                   B-7

Table B.13 . File Structure for Nflowext.dbf            ..................................                   B-8

Table B.14 . File Structure for Nconcext.dbf            ..................................                    B-8

Table B.15 . File Structure for Preextdbf             ....................................                   B-9

Table B.16 . File Structure for Airsext.dbf            ...................................                   B-9
Table B-1. File Structure for Submismdbf
F i e l d F i e l d Name    Type              Width   Dec   Index
        1 DOC CNTL          Character            15             N
        2 RPT-YEAR          Character             4             N
        3 TRI-FAC     ID    Character            15             N
        4 FAC-NAME-     1   Character            30             N
        5 FAC-NAME-2        Character            30             N
        6 STRE-ET 1-        Character            30             N
        7 STREET-2  -       Character            30             N
        8 CITY              Character            25             N
        9 COUNTY            Character            25             N
      1 0 ZIPCODE           Character             9             N
     1  1 F A C I L LAT     Character             I             N
     1 2 FACIL-LONG         Character             7             N
     13 LAT CZNT            Character             7             N
     1 4 LONE CENT          C h a r a c ter       7             N
     1 5 CONTXCT            Character            20             N
     16 PHONE               Character            10             N
     1 7 ASS E P A I D      Character            12             N
     1 8 CAS-NUM-           Character            11             N
     1 9 CHEG NAME          Character            25             N
     2 0 MIN TNDEX          Character             4             N
     2 1 MIN-IDX      NA    Character             3             N
     22 MIN-ACT~ON          Character             4             N
     2 3 MIN-CODE           Character             2             N
     2 4 CUR-YR QTY         Character            14             N
     2 5 C U Z Yii NA       Character             3             N
     2 6 P R I YR BTY       Character            14             N
     2 7 PRI-YR-NA          Character             3             N
     28 PCT-CHENGE          Character             7             N
     2 9 PCT-CHG NA         Character             3             N
     30 I D RUM i           Character            12             N
     31 ID-NUM-2            Character            12             N
     32 N P ~ E Si          Character             9             N
     33 NPDES-2             Character             9             N
     3 4 S I C 1-           Character             5             N
     35 SIC-2               Character             5             N
     36 S I C - 3           Character             5             N
     37 SIC-4               Character             5             N
** T o t a l *F                                 439




Table B-2. File Structure for Release.dbf
Field     Field Name    T Y P                 Width   Dec   Index
      1   DOC CNTL      Character               15              N
      2   REL-MEDIUM    Character                2             N
      3     RELEASE     Character               12             N
      4 REL E S T NA C h a r a c t e r           2             N
      5 BASTSC ~~ C h a r a c t e r
               ~ .   DE .                        2             N
      6 RANGE-CODE      Character                5             N
      7 STREGNAM Character                      25             N
      8 STREAM-COD      Character                4             N
      9 LAND D T S P    Character                3             N
     10 TRANS S I T E C h a r a c t e r         30             N
     11 TRANS-CODE-     Character                3             N
**   T o t a l **                              104




                                                                    Page B-1
Table B-3. File Structure for Annrep.dbffor Reporting Year 1988
Field       F i e l d Name   Type        Width    Dec      Index
      1     ANRPTNO          Character       2                    N
      2     COUNTY           Character       3                    N
      3     FORMNO           Character       1                    N
      4     EPAID            Character      12                    N
      5     LINENO           Character       4                    N
      6     WASTENO          Character       4                    N
      7     WASTEDES         Character      14                    N
      8     TOTALGEN         Numeric        10                    N
      9     TRTCODE          Character       3                    N
     10     TOTALTRT         Numeric        10                    N
     11     SHIPCODE         Character       3                    N
     12     TOTALSHIP        Numeric        10                    N
**   Tot   a l **                           17




Table B-4.File Structure for Annrep.dbf for Reporting Year 1989
Field    Field Name          Type        Width    Dec      Index
      1  ANRPTNO             Character       2                    N
       2 COUNTY              Character       3                    N
       3 FORMNO              Character       1                    N
       4 EPAID               Character      12                    N
       5 LINENO              Character       4                    N
       6 WASTENO             Character      16                    N
       7 FORM                Character       4                    N
       8 SOURCE              Character       3                    N
       9 TOTALGEN            Numeric        10                    N
     10 TRTCODE              Character       3                    N
     1 1 TOTALTRT            Numeric        10                    N
     1 2 SHIPCODE            Character       3                    N
     13 TOTALSHIP            Numeric        10                    N
     1 4 FACID               Character      12                    N
     1 5 PERCENT             Character       5                    N
     16    WNOl              Character       3                    N
     11    wN02              Character       3                    N
     18    WN03              Character       3                    N
     19    wN04              Character       3                    N
     20    QTYA              Character       1                    N
     21    QTYB              Character       1                    N
     22    QTYC              Character       1                    N
     23    QTYD              Character      12                    N
     24    PERCENT2          Character       4                    N
     25    cnos              Character       1                    N
     26     CH06             Character       1                    N
     27     WASTIDA          Character       1                    N
     28     WASTIDB          Character      11                    N
     29     SHIPID           Character      12                    N
     30     TRANS1           Character      12                    N
     31     TRANS2           Character      12                    N
     32     TRANS3           Character      12                    N
     33     TRANS4           Character      12                    N
     34     ENTRYDTE         Character       6                    N
     35     FILLER           Character      10                    N
**   Tot   a l **                          220




Page B-2
Table B-5.File Structure for Annrep.dbf for Reporting Year 1990
Field       Field Name  Type             Width   Dec      Index
    1       ANRPTNO    Character             2                    N
    2        COUNTY    Character             3                    N
    3        FORMNO    Character             1                    N
    4        EPAID     Character            12                    N
    5        LINEN0    Character             4                    N
    6        WASTENO   Character             4                    N
    7        WASTEN02  Character             4                    N
    8        WASTEN03  Character             4                    N
    9        WASTEN04  Character             4                    N
   10        FORM      Character             4                    N
   11        SOURCE    Character            3                     N
   12        TOTALGEN  Numeric             10                     N
   13        TRTCODE   Character            3                     N
   14        TOTALTRT  Numeric             10                     N
   15        SHIPCODE  Character            3                     N
   16        TOTALSHIP Numeric             10                     N
   17        FACID     Character           12                     N
   18        PERCENT   Character            5                     N
   19       wN0l       Character            3                     N
   20       wN02       Character            3                     N
   21       wN03       Character            3                     N
   22       WN04       Character            3                     N
   23       QTYA       Character            1                     N
   24       QTYB       Character            1                     N
   25       QTYC       Character            1                     N
   26       QTYD       Character           12                     N
   27       PERCENT2   Character            4                     N
   28       cnos ~ ~ C . a r. c t e r
             ~           h     a            1                     N
   29       CH06       Character            1                     N
   30       WASTIDA    Character            1                     N
   31       WASTIDB    Character           11                     N
     32     SHIPID     Character           12                     N
     33     TRANS1     Character           12                     N
     34     TRANS2     Character           12                     N
     35     TRANS3     Character           12                     N
     36     TRANS4     Character           12                     N
     37     ENTRYDTE   Character            6                     N
     38     FILLER     Character           10                     N
     39     R          C h a r act e r      1                     N
     40     WATER      Character            1                     N
**   Tot   a l **                         222




                                                                      Page B-3
Table B-6. File Structure for Npdes.dut
Field Field Name          Type                Width      Dec
    1 PERMIT              Character               9
    2 FACILITY            Character              30
    3 STREET              Character              30
    4 CITY                Character              15
    5 STATE               Character               2
    6 ZIP                 Character               5
    7 COUNTY              Character              12
    8 S I C CODE          Character                  4
     9     LATTTUDE C h a r a c t e r                7
    10     LONGITUDE      Character                  8
    11     P I P E NUMBER C h a r a c t e r          3
    12     PA-TER         Character                  5
    13     SHORT NAME C h a r a c t e r              8
    14     REPORT U N I T C h a r a c t e r          2
    15     AVEFLD-        Character                  8
    16     CNTl9          Integer                    5
    17     CNT26          integer                    5

Delimiter: @
T o t a l R e c o r d Length:                   174



Table B-7. File Structure for Pretreut.dut
F i e l d F i e l d Name     Type             Width          Dec
        1 YEAR               Character            4      .
        2 IUNAME             Character           29
        3 POTW CONTA         Character           51
        4 POTW-NPDES         Character            9
        5 POTW-P IPE         Character            2
        6 IU NEM             Character            4
        7 MPEOD              Numeric             10            2
        8 MFLOW              Numeric             10            2
        9 MBOD               Numeric             10            2
      1 0 MCOD               Numeric             10            2
      1 1 MTSS               Numeric             10
                                                 ~             2
      1 2 MOIL               Numeric             10            2
      13 MTKN                Numeric             10            2
      14 M 0N3               Numeric             10            2
      1 5 MTP                Numeric             10            2
      1 6 MCHLOR             Numeric             10            2
      1 7 MSN                Numeric             10            2
      1 8 MNH3               Numeric             10            2
      19 W A S               Numeric             10            2
      2 0 MCOLOR             Numeric             10            2
      2 1 MSULF              Numeric             10            2
      2 2 MFL                Numeric             10            2
      2 3 ADDRESS            Character           30
      2 4 CITY               Character           20
    25     ZIP               Character               5
    26     SIC               Character               4

Not delimited
T o t a l R e c o r d Length:                   318




Page B-4
Table B-8. File Structure for Pofw.dbf
Field      F i e l d Name   Type         Width        Dec    Index
    1      NPDES            Character        9                   Y
    2      NAME             Character       30                   N
      3    CITY             Character       15                   N
      4    STATE            Character        2                   N
      5     ZIP             Character        5                   N
**   T o t a l **                           62




Table B-9. File Structure for Aimdut
Field     F i e l d Name     Type      Length          Dec
      1   BLANK1             Character      1
      2   PLANT              Character      4
      3   BLANK2             Character      3
      4   "&ADDRESS          Character     49
      5   COUNTY             Character      4
      6   PARTICULATES       Integer       12
      I   so2                Integer             12
      8   NO2                Integer             12
      9   voc                Integer             12
     10   co                 Integer             12

N o t delimited
T o t a l Record Length:      121




                                                                     Page B-5
Table B-10. File Structure for Submextdbf
Field       F i e l d Name  Type             Width   Dec   Index
      1     DOC CNTL       Character            15             N
      2     RPT-YEAR       Character             4             N
      3     TRI-FAC     ID Character            15             N
      4     FAC-NAME-     1Character            30             N
      5     FAC-NAME-2     Character            30             N
      6     STRE-ET 1-     Character            30             N
      7     STREET-2-      Character            30             N
      8     CITY           Character            25             N
      9     COUNTY         Character            25             N
     10     ZIPCODE        Character             9             N
     11     F A C I L LAT  Character             7             N
     12     FACIL-LONG     Character             I             N
     13      LAT CENT      Character             7             N
     14      LONE CENT     Character             7             N
     15      CONT~CT       Character            20             N
     16      PHONE         Character            10             N
     17      ASS EPA I D C h a r a c t e r      12             N
     18      CAS-NUM-      Character            11            N
     19      CHEG NAME     Character           25             N
     20     MIN INDEX      Character             4            N
     21     MIN-IDX     NA C h a r a c t e r     3            N
     22     MIN-ACTION     Character             4            N
     23     MIN-CODE       Character             2            N
     24     CUR-YR QTY C h a r a c t e r       14             N
     25               E
            C U G Y NA C h a r a c t e r         3            N
     26     P R I T R GTY C h a r a c t e r    14             N
     27     PRIYR-NA       Character             3            N
     28     PCT-CHZNGE     Character             I            N
     29     P C T C H G NA C h a r a c t e r     3            N
     30     ID EWM i       Character           12             N
     31     ID-NUM-2       Character           12             N
     32     N P ~ E Si     Character             9            N
     33     NPDES-2        Character             9            N
     34     S I C 1-       Character             5            N
     35     SIC-2          Character             5            N
     36     SIC-3          Character             5            N
     31     SIC-4          C h a r act e r       5            N
     38     FAC-ID         Character           40             Y
     39     FAC-ERROR      Logical               1            N
     40     ERR-FIELD      Character             5            N
     41     C H E ~ MIS    Logical               1            N
     42     CHEM-ID        Character           10             N
**   Tot   a l **-                            466




Page B-6
Table B-11. File Structure for Relextdbf
Field       Field Name        Type        Width     Dec   Index
    1       DOC CNTL          Character        15             Y
    2       REL-MEDIUM        Character         2             N
    3       RELEASE           Character        12             N
    4       REL EST NA        Character         2             N
    5       B A S T S CEDE    Character         2             N
    6       RANGE-CODE        Character         5             N
    7       S T R E Z NAM     Character        25             N
    8       STREAM-COD        Character         4             N
    9       LAND D i S P      Character         3            N
     10     T W S SITE        Character        30             N
     11     TRANS-CODE        Character         3            N
     12     RANGE-            Logical           1            N
**   Tot   a l **                             105


Table B-12. File Structure for Anrepexr.dbf
Field        F i e l d Name   Type        Width     Dec   Index
      1      ANRPTNO          ChHracter       2              N
      2      COUNTY           Character        3             N
      3      FORMNO           Character        1             N
      4      EPAID            Character       12             N
      5      LINEN0           Character        4             N
      6      WASTENO          Character     16               N
      7      WASTENO2         Character      4               N
      8      WASTEN03         Character      4               N
      9     WASTEN04          Character      4               N
     10      FORM             Character      4               N
     11      SOURCE           Character      3               N
     12      TOTALGEN         Numeric       10               N
     13      TRTCODE          Character      3               N
     14      TOTALTRT         Numeric       10               N
     15      SHIPCODE         Character      3               N
     16      TOTALSHIP        Numeric       10               N
     17     PERCENT           Character      5               N
     18     WNOl              Character      3               N
     19     WN02              Character      3               N
     20     W0 N3             Character      3               N
     21     WN04              Character      3               N
     22     WASTEDES          Character     14               N
     23     FAC I D           Character     10               Y
     24     CHEM ID           Character     10               Y
     25     YEAR-             Numeric        4               N
     26     QTYA              Character      1               N
     27     QTYB              Character      1               N
     28     QTYC              Character      1               N
     29     QTYD              Character     12               N
     30     BASIS             Character      1               N
**   Tot   a l **                          165




                                                                  Page B-I
Table B-13. File Structure for Nflowext.dbf
Field        F i e l d Name   Type        Width    Dec   Index
    1        NPDES            Character        9             N
    2        P I P E NUM      Character        3             N
  I 3        P A N - CODE     Character        5             N
    4                 -
             PARAM-UNIT       Character        2             N
       5 AVG                  Numeric         10     4       N
       6 YEAR                 Numeric          4             N
**    T o t a l **                            34




Table B-14. File Structure for Nconcextdbf
Field Field Name              Type        Width    Dec   Index
    1 NPDES                   Character        9             N
    2 P I P E NUM             Character        3             N
    3  PA^ CODE               Character        5             N
    4 PARAM-NAME              Character        8             N
              -
    5 PARAM-UNIT              Character        2             N
    6 AVG                     Numeric         10     4       N
    7 FAC I D                 Character       10             N
    8 CHEM I D                Character       10             N
    9 CHEMMIS                 Logical          1             N
      i o EMIS                Numeric         12     3       N
      11 YEAR                 Numeric          4             N
      1 2 WEIGHT              Numeric          5             N
**    T o t a l **                            80




Page B-8
Table B-15. File Structure for Preextdbf
Field Field Name           Type              Width   Dec   Index
    1 YEAR                 Numeric               4             N
    2 FAC NAME             Character            29             N
    3 P O T E CONTA        Character            51             N
    4 POTWNPDES            Character             9             N
    5 POTW-PIPE            Character             2             N
    6 IU N3M               Character             4             N
    7 MPXOD                Numeric              10     2       N
    8 MFLOW                Numeric              10     2       N
      9   MBOD             Numeric              10     2       N
     10     MCOD           Numeric              10     2       N
     11 MTSS               Numeric              10     2       N
     1 2 MOIL              Numeric              10     2       N
     13 MTKN               Numeric                             N
     14 M 0   N3           Numes i c                           N
     1 5 MTP               Numeric                             N
     1 6 MCHLOR            Numeric                             N
     1 7 MSN               Numeric              10     2       N
     18 MNH3               Numeric              10     2       N
     1 9 MMBAS             Numeric              10     2       N
     2 0 MCOLOR            Numeric              10     2       N
     2 1 MSULF             Numeric              10     2       N
     22 MFL                Numeric              10     2       N
     2 3 ADDRESS           Character            30             N
     24 CITY               Character            20             N
     25 Z I P              Character             5             N
     26 S I C              Character             4             N
     27 FAC I D            Character            10             N
**   T o t a l *z                              329




Table B-16. File Structure for Airsext.dbf
Field     F i e l d Name   Type              Width   Dec   Index
    1     D1               Character             1             N
      2   PLANT I D        Character             4             N
      3   D2     -         Character             3             N
      4   NAME ADDR        Character            49             N
      5   COUNTY           Character             4             N
      6   PART             Numeric              11             N
      I   so2              Numeric              12             N
      8   NO2              Numeric              12             N
       9 voc               Numeric             12              N
     1 0 co                Numeric             12             N
     1 1 YEAR              Numeric              4             N
     1 2 FAC I D           C h a r act e r     10             N
**   T o t a l *F                             135




                                                                   Page B-9
         APPENDIX C

DATA CONVERSION UTILlTY CODE
                                   LIST OF PROGRAM AND MESSAGE FILES


Main Conversion Program
                                                                                                                             *
   Convert.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    C-1

TRIS Modules
   Tworking.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     C-8
     Tworkl.msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        C-13
   Tfac.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    C-14
     Tfacl.msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       C-30
     Tfac2.msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       C-31
     Tfac3.msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       C-32
     Tfac4.msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       C-33
   Tchem.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     C-34
     Tcheml.mg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           (2-41
  Temiss.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       C-42

State Hazardous Waste Annual Report Modules
    Sworking.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     C-49
       Sworkl.msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    C-52
    Sfac.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   C-53
    Schem.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    C-55
    Semkprg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      (2-58

NPDES Modules
  Nworking.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         C-60
    Nworkl.msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           C-64
  Nfac.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     C-65
  Nchem.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        C-67
    Ncheml.msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           C-73
  Nemiss.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       C-74

Pretreatment Modules
   Pworking.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      C-78
   Pfac.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    C-79
   Pchem.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     C-81
   Pemiss.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    C-82

AIRS Modules
   Aworkingprg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         C-87
   Afac.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    C-88
   Achem.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       C-90
   Aemiss.prg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      C-91
................................................................................
*                                                                                                                                  *
*   F i l e n a m e : CONVERT .PRG                                                                                                 *
*   Author:           Anne E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                            *
*   Created:          8/7/90 Last updated: 1 / 2 4 / 9 2                                                                           *
*   Comments: Main WRMS Data B a s e Conversion U t i l i t y program f o r c o n v e r t i n g d a t a                            *
*                     from T R I S , S t a t e Annual R e p o r t , NPDES, P r e t r e a t m e n t , and A I R S                   *
*                    d a t a b a s e f o r m a t s t o WRMS f o r m a t .                                                          *
*                                                                                                                                  *
*                    T h i s program u s e s a t w o - l e v e l menu: t h e f i r s t (menu 1) l e t s t h e                      *
*                    u s e r choose a d a t a s o u r c e t o c o n v e r t from ( e . g . , TRYS); t h e second                   *
*                    l e t s t h e m select a conversion a c t i v i t y .                                                         *
*                                                                                                                                  *
*                    There are 3 c o n v e r s i o n a c t i v i t i e s : f a c i l i t y matching, c h e m i c a l               *
*                    matching, and e m i s s i o n s c o n v e r s i o n , which must b e done i n t h a t                         *
*                    order.          I n a d d i t i o n , t h e program c r e a t e s a working f i l e or f i l e s              *
*                    f o r u s e i n t h e c o n v e r s i o n program.       The main CONVERT program c a l l s                   *
*                    o t h e r programs t o p e r f o r m each of t h e s e a c t i v i t i e s ( c r e a t i n g                  *
*                    working f i l e s , f a c i l i t y matching, c h e m i c a l matching, and e m i s s i o n s                 *
*                    c o n v e r s i o n ) . Each data s o u r c e h a s i t s own program f o r each of                           *
*                    these a c t i v i t i e s , s i n c e each d a t a source i s d i f f e r e n t and r e q u i r e s           *
*                    d i f f e r e n t o p e r a t i o n s t o be converted.                                                       *
*                                                                                                                                  *
*                    T h e CONVERT program e x p e c t s t o f i n d t h e f o l l o w i n g s u b d i r e c t o r i e s           *
*                    on t h e d e f a u l t d r i v e :                                                                            *
*                        \wms                                                                                                      *
*                          \WRMS\TRIS                                                                                              *
*                          \WRMS\STATE                                                                                             *
*                          \WRMS\NPDES                                                                                             *
*                          \WRMS\PRETREAT                                                                                          *
*                          \WRMS\AIR                                                                                               *
*                    I t expects t h e main WRMS d a t a f i l e s and t h e CONVERT program i t s e l f                           *
*                    t o be i n \WP.MS, and t h e d a t a s o u r c e s p e c i f i c program f i l e s ,                          *
*                    o r i g i n a l data f i l e s , working f i l e ( s ) , and any a n c i l l a r y f i l e s                  *
*                                                                                *
                     needed by t h e c o n v e r s i o n program t o b e i n t h e a p p r o p r i a t e
*                    s u b d i r e c t o r y l i s t e d above.                  *
*                                                                                *
................................................................................
*   C a l l t h e p r o c e d u r e t h a t i n i t i a l i z e s environment w i t h SET commands, d e f i n e s
*   menus, and d e f i n e s memvars

DO i n i t i a l

*   Main program l o o p t o d i s p l a y menus; t h e l o o p r e d i s p l a y s t h e main menu a f t e r
*   lower l e v e l ones r e t u r n c o n t r o l , u n t i l t h e u s e r s e l e c t s q u i t a n d t h e l o o p i s
*   exited.

DO WHILE       .T.

    mexit-1 = . F .                                                   &&    s e t menu 1 e x i t f l a g t o f a l s e
    source = s p a c e ( l 0 )                                        &&    i n i t i a l i z e data s o u r c e v a r i a b l e
    DO show 1                                                         &&    d i s p l a y menu-1
           -
    DO eval-1                                                         &&    e v a l u a t e menu-1    choice

*   If u s e r selected E X I T , e x i t menu-1            loop, otherwise continue

    I F mexit -1
       EXIT
    ENDIF




CONVERT. PRG                                                                                                              Page C-1
*   Check f o r working d a t a f i l e , a n d c r e a t e i t from o r i g i n a l d a t a i f it does
*   not e x i s t .    I f o r i g i n a l d a t a f i l e n o t found, d i s p l a y e r r o r message and
*   r e t u r n t o menu 1. I f working d a t a e x i s t s , r e s t o r e s t a t u s i n f o r m a t i o n
*   t h a t t e l l s where u s e r l e f t o f f .
*   The working, o r i g i n a l , and s o u r c e v a r i a b l e s a r e s e t when t h e u s e r makes
*   a c h o i c e i n menu-1.

    I F .NOT.      f i l e (working)                                   &&     no working f i l e

       I F .NOT.        file (original)                                     &&    no o r i g i n a l d a t a f i l e e i t h e r

           @ 1,0 CLEAR                                                           &&     D i s p l a y e r r o r message
           @ 9.27 TO 13.52 DOUBLE
           @ l 1 , 2 9 SAY ;'Source f i l e n o t found."
           @ 22,50 SAY "Press any key t o c o n t i n u e                   ...   11


           WAIT " "
           LOOP                                                                  &&     go back t o menu-1.
       ELSE                                                                 &&    o r i g i n a l d a t a f i l e found

           DO & s o u r c e . w o r k i n g                              &&      c a l l p r o g t o create working f i l e
           SAVE TO & s o u r c e . s t a t u s ALL LIKE 1 *
                                                         -                       && create s t a t u s variable f i l e

       ENDIF                                                                     &&     so u s e r can resume l a t e r
    ELSE                                                               &&     working f i l e found

       RESTORE FROM & s o u r c e . s t a t u s ADDITIVE                    &&    r e s t o r e s t a t u s o f where u s e r

    ENDIF                                                                   &&    l e f t off

*   Loop t o d i s p l a y menu-2

    DO WHILE . T .
      mexit-2 = . F .                                                  &&     s e t menu-2 e x i t f l a g t o f a l s e
       DO show 2                                                       &&     d i s p l a y menu 2
       DO eval-2  -                                                    &&                      e ;2
                                                                              e v a l u a t e m n-       choice

*   If u s e r selected E X I T o r completed c o n v e r s i o n ,                    e x i t menu-2   loop; otherwise
*   continue

                    -
       I F mexit 2 .OR.           -
                                 1 emiss
          EXIT
       ENDIF

*   Save s t a t u s memory v a r i a b l e s f o r u s e n e x t t i m e t o d e t e r m i n e where t o p i c k up
*   conversion.

       SAVE TO & s o u r c e . s t a t u s ALL LIKE 1 *
                                                     -
    ENDDO                                                               &&       r e s t a r t menu-2    loop

*                                            -
    U s e r h a s e x i t e d f r o m menu 2 o r c o m p l e t e d c o n v e r s i o n f o r s e l e c t e d d a t a s o u r c e

ENDDO                                                                   &&       r e s t a r t menu-1    loop

*   U s e r h a s e x i t e d from menu 1 (main menu)
*   R e s e t e n v i r o n m e n t , c l o s e all f i l e s , q u i t t o dBase

DO reset
RETURN & & c o n v e r t . p r g



Page C-2                                                                                                               CONVERT. PRG
............................                 PROCEDURE D E F I N I T I O N S   *k*******X**X***X*****X*****


PROCEDURE i n i t i a l

*   I n i t i a l i z e p r o g r a m environment

    CLEAR ALL                               &&   closes a l l f i l e s , c l e a r s screen and m e m o r y
    SET BELL OFF                            &&   T u r n s off w a r n i n g bell
    S E T CLOCK OFF                         &&   T u r n s o f f clock d i s p l a y
    SET DEVICE TO SCREEN                    &&   Directs a l l o u t p u t t o t h e screen
    S E T EXACT OFF                         &&   Disables exact matching
    SET HELP OFF                            &&   Disables h e l p
    SET SAFETY OFF                          &&   Suppresses o v e r w r i t e w a r n i n g s
    SET SCOREBOARD OFF                      &&   T u r n s o f f delete, i n s e r t , caps, a n d numlock
                                            &&   indicators
    SET STATUS OFF                          &&   T u r n s off status l i n e
    S E T TALK O F F                        &&   Suppresses echo of command progress
*   I n i t i a l i z e v a r i a b l e s t o be s h a r e d b y a l l p r o g r a m s c a l l e d by CONVERT
*   T h e s e are s t a t u s v a r i a b l e s t h a t r e f l e c t h o w m u c h of t h e conversion
*   process h a s been c o m p l e t e d ( a n d t h e r e f o r e , w h e r e t h e u s e r l e f t o f f )
*   s o t h a t t h e u s e r can r e s u m e i n t h e s a m e place l a t e r . Working a n d o r i g i n a l
*   h o l d t h e names of t h e w o r k i n g and o r i g i n a l data f i l e s t h a t t h e programs
*   expect t o f i n d f o r each data s o u r c e .
                 -           -
    P U B L I C 1 fac-done, 1 chm-done,             1-emiss,      working,     original

*   C a l l t h e procedure t h a t d e f i n e s t h e m e n u s

    DO d e f m e n u s

RETURN & & i n i t i a l
...............................................................................
PROCEDURE defmenus

    T h e s e are popup menus d i s p l a y e d i n t h e middle of t h e screen
    T h e PROMPT t e x t appears on t h e m e n u i t s e l f ; t h e MESSAGE t e x t appears below
    t h e menu and c l a r i f i e s t h e m e n u prompt

    D e f i n e menu -1 t o choose d a t a s o u r c e

    SET BORDER TO DOUBLE
    D E F I N E POPUP menu 1 FROM 7 , 2 8 TO 1 5 , 5 0
    DEFINE BAR 1 OF mGnu 1 PROMPT i i ~ ~ ~ ~ " ;
       MESSAGE " C o n v e r t dzta f r o m T R I S format"
    D E F I N E BAR 2 OF menu-1 PROMPT " A n n u a l R e p o r t " ;
       MESSAGE " C o n v e r t data f r o m S t a t e A n n u a l R e p o r t format"
    D E F I N E BAR 3 O F m e n u 1 PROMPT "NPDES";
       MESSAGE " C o n v e r t dzta f r o m NPDES f o r m a t "
    DEFINE BAR 4 OF menu-1 PROMPT " P r e t r e a t m e n t " ;
       MESSAGE " C o n v e r t d a t a f r o m P r e t r e a t m e n t f o r m a t "
    D E F I N E BAR 5 OF menu-1 PROMPT "AIRS";
       MESSAGE " C o n v e r t d a t a f r o m A I R S f o r m a t "
    D E F I N E BAR 7 OF menu 1 PROMPT " E x i t t o dBase";
       MESSAGE " E x i t W R M S - C o n v e r s i o n U t i l i t y t o d B a s e "
    ON SELECTION POPUP m e n u -1 DEACTIVATE POPUP

    D e f i n e menu-2   t o choose c o n v e r s i o n a c t i v i t y
                             -
    DEFINE POPUP m e n u 2 FROM 7 , 2 8 TO 15,50


CONVERT. PRG                                                                                                  P a g e C-3
    DEFINE BAR 1 O menu 2 PROMPT "Match F a c i l i t i e s " ;
                      F
      MESSAGE "Match f a c z l i t i e s t o f a c i l i t i e s a l r e a d y i n FACILITY f i l e "
    DEFINE BAR 2 O menu 2 PROMPT "Match C h e m i c a l s " ;
                      F
      MESSAGE "Match c h e h c a l s t o c h e m i c a l s a l r e a d y i n CHEMICAL f i l e "
    DEFINE BAR 3 O menu 2 PROMPT "Convert Emissions";
                     F
      MESSAGE "Add e m i s s r o n s d a t a t o W M EMISSION f i l e "
                                                  R S
    DEFINE BAR 7 OF menu 2 PROMPT " E x i t t o Source Menu";
      MESSAGE " R e t u r n to-Data Source Menu"
    ON SELECTION POPUP menu-2 DEACTIVATE POPUP

RETURN & & defmenus
...............................................................................
PROCEDURE show-1

*   D i s p l a y menu-1 w i t h s c r e e n h e a d e r and i n s t r u c t i o n s

    CLEAR
    @0,6SAY"WRMS                D A T A          B A S E         C O N V E R S I O N       U T I L I T Y "
    @ 5 , 9 S Y "Choose a d a t a s o u r c e u s i n g t h e arrow k e y s and p r e s s < E n t e r > "
             A
    @ 17,lO TO 20,67
    @ 18,11 SAY " T h i s u t i l i t y c o n v e r t s d a t a from one o f t h e above f o r m a t s "
    @ 19,11 SAY " t o t h e WRMS f o r m a t and adds it t o t h e W M d a t a base."
                                                                             R S
    ACTIVATE POPUP menu-1

RETURN & & show-1
.................................................................................
PROCEDURE e v a l-1

*   E v a l u a t e menu 1 c h o i c e
*   Under e a c h daFa s o u r c e c h o i c e , t h e s o u r c e , working, and o r i g i n a l v a r i a b l e s
*   are s e t t o r e f l e c t t h e u s e r ' s d a t a s o u r c e c h o i c e . The s o u r c e v a r i a b l e w i l l
*   b e appended t o t h e b e g i n n i n g of s u b r o u t i n e c a l l s t o select t h e s u b d i r e c t o r y
*   and program s p e c i f i c t o t h e chosen d a t a s o u r c e .                 The working and o r i g i n a l
*   v a r i a b l e s t e l l CONVERT what t h e names o f t h e working and o r i g i n a l d a t a f i l e s
*   are f o r t h e c h o s e n d a t a s o u r c e , s o it can see i f t h e y e x i s t or ( i n t h e case
*   of t h e working f i l e ) need t o be c r e a t e d . Some d a t a s o u r c e c h o i c e s a l s o
*   i n i t i a l i z e some a d d i t i o n a l s t a t u s v a r i a b l e s f o r u s e by c a l l e d programs.
    DO CASE
      CASE b a r 0      = 7                                 &&  U s e r selected Exit
          mexit 1 = .T.                                         && Set e x i t f l a g t o t r u e
       CASE b a r ( ) = 1                                   & & User s e l e c t e d T R I S
         source = " t r i s \ T "
         working = " t r i s \ s u b m e x t . d b f "
         o r i g i n a l = " t r i s \ s u b m i s s n . dbf"
                                     -                 -
         PUBLIC 1 f a u t o , 1 fdup, 1 f a s s i g n , 1 fmanual, 1 c a u t o
       CASE b a r ( ) - = 2                                   & & User s e l e c t e d - S t a t e Annual Report
         source = "state\S"
         working = " s t a t e \ a n r e p e x t . d b f "
         o r i g i n a l = "state\annrep.dbf"
       CASE b a r ( ) = 3                                     & & U s e r s e l e c t e d NPDES
         s o u r c e = "npdes\N"
         working = " n p d e s \ n c o n c e x t . d b f "
         o r i g i n a l = "npdes\npdes . d a t "
         PUBLIC 1 c a u t o
       CASE b a r ()-= 4                                      & & User s e l e c t e d P r e t r e a t m e n t
         source = "pretreat\P"
         working = " p r e t r e a t \ p r e e x t . d b f "


Page C-4                                                                                                        CONVERT. PRG
      original = "pretreat\pretreat .dat"
    CASE b a r 0 = 5                    && U s e r s e l e c t e d AIRS
      source = " a i r \ A "
      w o r k i n g = "air\airsext .&f"
      o r i g i n a l = "air\airs .dat"
  ENDCASE
RETURN & & e v a l-1
...............................................................................
PROCEDURE show 2       -
*   D i s p l a y menu-2 w i t h i n s t r u c t i o n s .    Header s h o u l d s t i l l be d i s p l a y e d from
*         -
    menu 1.

    @ 1,0 CLEAR
    @ 5 , 7 SAY "Choose a c o n v e r s i o n a c t i v i t y u s i n g t h e arrow keys and press < E n t e r > "

   @ 17,s TO 19,75
   @ 18,6 SAY " F a c i l i t y and Chemical Matching MUST b e done b e f o r e Convert
E m i s s i o n s . ''
  ACTIVATE POPUP menu -2

RETURN & & show-2
...............................................................................
PROCEDURE e v a l-2

*   E v a l u a t e "-12        choice
*   Conversion m u s t be done i n t h e c o r r e c t o r d e r : F a c i l i t y matching f i r s t ,
*   Chemical m e a t c h i n g s e c o n d , and E m i s s i o n s c o n v e r s i o n l a s t . I f t h e u s e r
*   t r i e s t o s e l e c t a c h o i c e o u t of t h i s o r d e r , a message w i l l be d i s p l a y e d
*   t e l l i n g them what segments t h e y must do before t h e one t h e y c h o s e .
*   S i m i l a r l y , i f t h e u s e r s e l e c t s a segment t h a t h a s a l r e a d y been done, a
*   messgae w i l l be d i s p l a y e d i n d i c a t i n g t h a t . I n b o t h cases, t h e menu w i l l
*   b e r e d i s p l a y e d a f t e r t h e message i s d i s p l a y e d .

    DO CASE
      CASE b a r ( ) = 7                          &&   User s e l e c t e d R e t u r n t o main menu
        mexit-2 = . T .                                && Set e x i t f l a g t o True

       CASE b a r 0 = 1                           &&   User s e l e c t e d F a c i l i t y Matching
         I F 1 f a c done                              &&    F a c i l i t y matching a l r e a d y done
            DO-already                                       & & D i s p l a y message

          ELSE                                         &&    F a c i l i t y matching n o t a l r e a d y done
            DO & s o u r c e . f a c                         & & C a l l program t o do f a c i l i t y matching
          ENDIF

       CASE b a r ( ) = 2                         &&   U s e r s e l e c t e d Chemical Matching
         DO CASE

              CASE 1 chm done                          &&    Chemical matching a l r e a d y done
                 DO aTrea;ly                                 & & D i s p l a y message

              CASE 1 f a c done                        &&    F a c i l i t y matching h a s been done
                DO & s o u r c e . c h e m                   &&     C a l l program t o do C h e m i c a l matching

              OTHERWISE                                &&    F a c i l i t y matching n o t done y e t
                DO n o f a c                                 & & D i r e c t u s e r t o do F a c i l i t y matching
                                                             & & b e f o r e s e l e c t i n g Chemical matching



CONVERT.PRG                                                                                                        Page C-5
       ENDCASE
      CASE bar() = 3           &&   User selected Emission conversion
        DO CASE
           CASE 1 emiss        &&   Emission conversion already done
             DO aiready             & & Display message


                 -
           CASE 1 chm-done     &&   Chemical matching has been done (implies
                               &&   Facility matching done also)
            DO &source.emiss        & & Call program to do Emission conversion

           CASE 1 fac done
                 - -           &&   Facility matching done, but not Chemical
                               &&   matching (otherwise, previous CASE would
                               &&   have been true)
            DO no-chem              & & Direct user to do Chemical matching
                                    & & before selecting Emissions conversion

           OTHERWISE           &&   Neither Facility nor Chemical matching done
                               &&   (otherwise, a previous CASE would have been
                               &&   true)
            DO no-fac-chm           & & Direct user to do both Facility and
                                    & & Chemical matching before selecting
                                    & & Emissions conversion
      ENDCASE
  ENDCASE
RETURN & & eval-2
...............................................................................
PROCEDURE reset
* Reset default environment; this reverses the SET commands in INITIAL
  CLEAR ALL
  SET ESCAPE ON
  SET EXACT OFF
  SET HELP ON
  SET SAFETY ON
  SET SCOREBOARD ON
  SET STATUS ON
  SET TALK ON
RETURN & & reset
...............................................................................
PROCEDURE already
* Display message telling user they have already done the selected task
  @ 1,0 CLEAR
  @ 9,18 TO 13,58 DOUBLE
  @ 11,20 SAY "You have already completed this task."
  @ 22,50 SAY "Press any key to continue
  WAIT 'I"
                                            . . ."
RETURN & & already
...............................................................................
PROCEDURE no-fac
* Display message telling user to match facilities before chemicals

Page C-6                                                                  CONVERT.PRG
  @ 1,0 CLEAR
  @ 9,21 TO 14,56 DOUBLE
  @ 11,23 SAY "You m u s t Match F a c i l i t i e s b e f o r e "
  @ 12,23 SAY "you c a n Match C h e m i c a l s . "
  @ 22,50 SAY "Press any key t o c o n t i n u e         .'I       ..
  WAIT " I'
RETURN L L no f a c  -
...............................................................................
PROCEDURE no chem    -
*   D i s p l a y message t e l l i n g u s e r t o match c h e m i c a l s b e f o r e c o n v e r t i n g e m i s s i o n s
                                                                                                                                  -
    @   1'0 CLEAR
    @   9,21 TO 14,55 DOUBLE
    @   11,23 SAY "You must Match Chemicals b e f o r e "
    @   12,23 SAY "you can Convert E m i s s i o n s . "
    @
    WAIT
        22,50 SAY "Press any key t o c o n t i n u e
            'I   "
                                                                   ..."
RETURN L L no chem   -
...............................................................................
PROCEDURE no-f a c-chm

*   D i s p l a y message t e l l i n g user t o m a t c h f a c i l i t i e s and c h e m i c a l s b e f o r e
*   converting emissions

  @ 1,0 CLEAR
  @ 9,19 TO 14,61 DOUBLE
  @ 11,21 SAY "You must Match F a c i l i t i e s and Chemicals"
  @ 12,21 SAY " b e f o r e you c a n Convert E m i s s i o n s . "
  @ 22,50 SAY "Press any key t o c o n t i n u e                   . . ."
  WAIT ""
RETURN & & no-f a c-chm

*   EOF: c o n v e r t . p r g




CONVERT.PRG                                                                                                            Page C-I
................................................................................
*                                                                                                                             *
* F i l e n a m e : TWORKING.PRG                                                                                              *
* A u t h o r : Anne E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                             *
* C r e a t e d : 8/14/90 L a s t u p d a t e d : 7/30/92                                                                     *
* C a l l e d by:CONVERT                                                                                                      *
* Comments: C r e a t e s working T R I S f i l e s f o r c o n v e r s i o n program, w i t h s t r u c t u r e              *
*                   extended t o i n c l u d e f i e l d s used i n p r o c e s s i n g . A l s o c l e a n s up              *
*                   some f i e l d s .                                                                                        *
*                                                                                                                             *
................................................................................
*   I n i t i a l i z e s t a t u s v a r i a b l e s . These v a r i a b l e s i n d i c a t e which steps of t h e
*   c o n v e r s i o n process have been completed.

1 fac done = . F .               &&   F a c i l i t y matching done
lchm-done = . F .                &&   Chemical matching done
1-fauto = . F .                  &&   Auto f a c i l i t y match done
1-fdup = . F .                   &&   Checking f o r d u p l i c a t e f a c i l i t i e s done
l r f a s s i g n = .F.          &&   A s s i g n i n g f a c i l i t y I D S done
1-fmanual = . F .                &&   Checking f a c i l i t y d i s c r e p a n c i e s done
1 cauto = .F.                    &&   Auto c h e m i c a l match done
l -m i s s = . F .
  e                              &&   E m i s s i o n s c o n v e r s i o n done

*   Create d o r k i n g s u b m i s s i o n f i l e SUBMEXT.DBF from s a v e d s t r u c t u r e SUBMSTRU.DBF

@ 1,O CLEAR
I3 8,12     SAY " C r e a t i n g Submission f i l e       . . ."
                                R M tris\submstru
CREATE t r i s \ s u b m e x t F O

*   C r e a t e i n d e x e s on EPA I D and NPDES number, c o n d i t i o n a l on t h e s e b e i n g
*   n o n s t a n d a r d ( i . e . , nonblank and n o t m a t c h i n g t h e s t a n d a r d f o r m a t of
*   NC f o l l o w e d by n u m b e r s ) . T h e s e w i l l be u s e d l a t e r i n c l e a n i n g up
*   n o n s t a n d a r d IDS.

I N D E X ON ass e p a i d TAG e p a i d c F R ass-e p a-i d <> " '' .AND.;
                                                     O
         . N O T . l T k e ( ~ N C * "ass eca
                                      ,        zd)
I N D E X ON npdes 1 TAG n p d e s c FOR npdes -1 <> " " .AND.;
         .NOT. l i k ~ ( " N C * " , n p d e s _ l )

*   Create i n d e x on c h e m i c a l name c o n d i t i o n a l on t h e c h e m i c a l n o t h a v i n g been
*   matched; t h i s w i l l b e u s e d i n Chemical matching (TCHEM.PRG)

                     -
I N D E X ON c h e m name TAG chm-name-c FOR chem-mis

*   Add records t h a t have a v a l i d c h e m i c a l name or CAS number t o t h e working
*   Submission f i l e from o r i g i n a l d a t a s u b m i s s i o n f i l e .

*   SET EXACT ON e n s u r e s o n l y e x a c t matches t o t h e s p e c i f i e d c o n d i t i o n s ( e . g . ,
*   c h e m i c a l names s t a r t i n g w i t h NA w i l l n o t be e x c l u d e d ; o n l y t h o s e t h a t a r e
*   e x a c t l y NA.)

*   SET TALK ON e c h o s t h e number of r e c o r d s p r o c e s s e d t o t h e screen s o t h a t t h e
*   u s e r c a n see t h e progress o f t h e r e c o r d s b e i n g added.

SET EXACT ON
SET TALK ON
        R M t r i s \ s u b m i s s n FOR (chem name <> s p a c e ( 2 5 ) .AND. chem-name
APPEND F O                                                                                                   <> " N A " ) ;
             . O R . (cas-num <> s p a c e ( B ) . A N D . cas-num <> "NA")
SET TALK OFF
SET EXACT OFF


Page C-8                                                                                                     TWORKING.PRG
@ 9 , 0 CLEAR
CLOSE DATABASE

@ 8,41 SAY "Done"

*   Create working r e l e a s e f i l e RELEXT.DBF from s a v e d s t r u c t u r e RELSTRU.DBF

@ 9,12 SAY " C r e a t i n g R e l e a s e f i l e    . . . . . .''
CREATE t r i s \ r e l e x t FROM t r i s \ r e l s t r u

*   Create production index f i l e                                                                                      -
REINDEX

*   Add r e c o r d s t h a t have a nonzero release and are n o t underground i n j e c t i o n t o
*   t h e working Release f i l e from o r i g i n a l d a t a Release f i l e .

*   SET TALK ON e c h o s t h e number of r e c o r d s p r o c e s s e d t o t h e screen s o t h a t t h e
*   u s e r can see t h e p r o g r e s s o f t h e records b e i n g added.

SET TALK ON
APPEND FROM t r i s \ r e l e a s e FOR v a l ( r e 1 e a s e )       > 0 .AND. re1-medium <>          "4"
SET TALK OFF
@ 1 0 , O CLEAR
CLOSE DATABASE

!
C 9,41      SAY "Done"

*   Clean up EPA i d , NPDES i d , l a t / l o n g data, and CAS number i n w o r k i n g
*   Submission f i l e

USE t r i s \ s u b m e x t

*   C l e a n up of EPA I D i n v o l v e s r e p l a c i n g c a p i t a l 0's   found i n t h e EPA I D w i t h
*   z e r o s and r e p l a c i n g v a l u e s of NA w i t h a b l a n k .
@ 11,12 SAY " C l e a n i n g up EPA i d i n Submission f i l e                   ............    11

REPLACE ass-epa-i d WITH s p a c e ( 1 2 ) FOR ass-epa-id     = "NA"

*   Scans for EPA I D ' S         containing c a p i t a l 0

SCAN FOR "0" $ ass-e p a-i d

*   Repeat t h i s l o o p u n t i l t h e r e are n o c a p i t a l 0's      i n t h e EPA I D
    DO WHILE "0" $ ass-epa-id
                         -    -
      REPLACE a s s e p a i d WITH s t u f f (ass-e p a-i d , a t ("O",ass           -epa-i d ) ,1,"0")
    ENDDO

ENDSCAN

3
L 11,63 SAY "Done"
*   Clean up of NPDES numbers i n v o l v e s r e p l a c i n g c a p i t a l 0's found i n t h e NPDES
*   number w i t h z e r o s and r e p l a c i n g v a l u e s of NA w i t h a b l a n k .

@ 12,12 SAY " C l e a n i n g up NPDES i d i n Submission f i l e                  ,........."
REPLACE npdes -1 WITH s p a c e ( 9 ) F R npdes-1 = "NA"
                                       O

*   Scans for NPDES numbers c o n t a i n i n g c a p i t a l 0




TWORKING.PRG                                                                                                  Page C-9
SCAN FOR "0" $ npdes-1

*   Repeat t h i s l o o p u n t i l t h e r e are no c a p i t a l 0 ' s i n t h e NPDES number

    DO WHILE "0" $ npdes 1
                            -
      REPLACE npdes 1 WITH s t u f f (npdes-1, a t ("O",npdes 1),1,"0")          -
    ENDDO

ENDSCAN

@ 1 2 , 6 3 S Y "Done"
             A

*   C l e a n i n g up t h e CAS number i n v o l v e s c h a n g i n g t h e CAS number f r o m an a l l
*   numeric f o r m a t ( w i t h l e a d i n g z e r o s and no hyphens) t o a r i g h t - j u s t i f i e d ,
*   h y p h e n a t e d f o r m a t (123456-78-9,     w i t h l e a d i n g spaces), and r e p l a c i n g v a l u e s
*   o f NA w i t h b l a n k s .

@ 13,12 S Y " C l e a n i n g up CAS number i n Submission f i l e
         A                                                                               ........   a1




REPLACE cas-num W I T H s p a c e ( l 1 ) FOR cas-num                = "NA"

*   I n s e r t hyphens

REPLACE cas-num WITH l e f t (cas-num, 6 ) +
        s u b s t r (cas-num, 9 , l ) FOR cas-num
                                                              "-I'   +   s u b s t r ( c a s-
                                                               <> space (11)
                                                                                             num,7,2)    +     "-" +;
*   Replace l e a d i n g z e r o s w i t h spaces. I f z e r o s are f o u n d b u t are n o t l e a d i n g
*   z e r o s , none of t h e CASES w i l l be s a t i s f i e d , and no change w i l l be made t o
*   t h e CAS number.       T h e r e c a n be n o m o r e t h a n f o u r l e a d i n g zeros, s i n c e a
*   maximum of s i x d i g i t s i s allowed b e f o r e t h e f i r s t hyphen and t h e smallest
*   CAS number h a s a t l e a s t two n o n z e r o d i g i t s before t h e f i r s t hyphen.

SCAN FOR cas num = "0"
  l e a d i n g = i e f t (cas-num,4)

    DO CASE
    CASE l e a d i n g = " 0 0 0 0 "
      REPLACE cas num WITH                 space ( 4 ) + r i g h t (cas-num, 7 )
    CASE l e a d i n g   "000"
      REPLACE cas num W I T H              space ( 3 )   +   r i g h t (cas-num, 8)
    CASE l e a d i n o
            ~.        ~  "00"
      REPLACE cas num- W I T H             space ( 2 )   +   r i g h t (cas-num, 9)
    CASE l e a d i n s   "0"
      REPLACE cas-num W I T H              space (1)     +   r i g h t (cas-num, 1 0 )
  ENDCASE
     ~   ~~




ENDSCAN

@ 1 3 , 6 3 SAY "Done"

*   C l e a n up stream name,         t r a n s i t s i t e , and r a n g e release d a t a i n working Release
*   file.

*   C l e a n i n g up stream name a n d t r a n s i t s i t e i n v o l v e s r e p l a c i n g N A s w i t h b l a n k s
@ 1 5 , 1 2 SAY " C l e a n i n g up S t r e a m and POTW name i n Release f i l e                 .. .   11




USE t r i s \ r e l e x t

REPLACE stream nam WITH s p a c e ( 2 5 ) FOR s t r e a m nam = "NA"
REPLACE t r a n s-                                                   -
                  site WITH s p a c e ( 3 0 ) FOR t r a n s s i t e = "NA"
@ 1 5 , 6 5 S Y "Done"
             A


P a g e C-10                                                                                                      TWORKING.PRG
*   The TRIS Release f i l e i n d i c a t e s a r a n g e w i t h a number i n d i c a t i n g which of
*   s e v e r a l p o s s i b l e r a n g e s w a s c h o s e n . C l e a n i n g u p r a n g e release data i n v o l v e s
*   s e t t i n g a t r u e / f a l s e f l a g t h a t i n d i c a t e s whether or n o t t h e data a r e b a s e d
*   on a r a n g e . The m i d p o i n t of t h e range i s u s e d f o r t h e a c t u a l release v a l u e ;
*   up u n t i l 1 9 9 0 , t h i s m i d p o i n t w a s n o t i n t h e o r i g i n a l TRIS d a t a f i l e s and
*   had t o be e n t e r e d h e r e ; s t a r t i n g i n 1 9 9 0 , t h e TRIS f i l e s c o n t a i n t h e
*   m i d p o i n t as t h e release amount.
@ 16,12 SAY " I d e n t i f y i n g r a n g e d a t a i n Release f i l e               .............          11




REPLACE range WITH . T . FOR v a l ( r a n g e-code)                    > 0
@ 1 6 , 6 5 S Y "Done"
             A

*   Some EPA I D S a n d NPDES numbers may s t i l l be n o n s t a n d a r d e v a n a f t e r c l e a n up
*   t o change c a p i t a l O s t o z e r o s .           T h i s s e c t i o n of t h e program l e t s t h e u s e r
*   examine n o n s t a n d a r d EPA I D S and NPDES numbers and e i t h e r f i x or d e l e t e them.
*   T h i s u s e s t h e c o n d i t i o n a l i n d e x e s created when t h e working Submission f i l e
*   w a s created.
USE t r i s \ s u b m e x t ORDER epa-id-c

*   I n d e x EPA I D C i s c o n d i t i o n a l for ( i . e . , c o n t a i n s o n l y records m e e t i n g t h e
*   c o n d i t i o n 7 EFA I D n o t b l a n k and n o t s t a r t i n g w i t h NC

GO TOP                                            &&   Go t o t h e f i r s t record w i t h a n o n s t a n d a r d I D

I F .NOT. EOFO                                   &&    I f i t ' s t h e e n d of t h e f i l e , t h e n t h e r e are no
                                                 &&    n o n s t a n d a r d EPA I D S , and n o t h i n g need be done
    CLEAR
    TYPE t r i s \ t w o r k l .msg              &&    D i s p l a y s i n s t r u c t i o n s for r e s o l v i n g
                                                 &&    n o n s t a n d a r d EPA I D S
    WAIT    "I'



*   B r o w s e t h e n o n s t a n d a r d EPA I D S ; t h e u s e r i s n o t allowed t o add or d e l e t e
*   records.         The u s e r h a s t h e o p t i o n of e i t h e r f i x i n g t h e EPA I D so t h a t it i s
*   i n t h e s t a n d a r d f o r m a t or d e l e t i n g i t . E i t h e r of t h e s e a c t i o n s removes t h e
*   r e c o r d from t h e c o n d i t i o n a l i n d e x . When a l l records have been removed from
*   t h e i n d e x i n t h i s way, an e r r o r c o n d i t i o n r e s u l t s ; t h e ON ERROR CLEAR l i n e
*   c l e a r s t h e screen when t h i s happens, e f e c t i v e l y e n d i n g t h e B O S mode.R WE

    ON ERROR CLEAR
    BROWSE NOFOLLOW NOAPPEND NODELETE FIELDS ass-epa-i d
    ON ERROR

ENDIF

SET ORDER TO TAG n p d e s-c

*   I n d e x NPDES C i s c o n d i t i o n a l f o r ( i . e . , c o n t a i n s o n l y r e c o r d s m e e t i n g t h e
*   c o n d i t i o n ) SPDES number n o t b l a n k and n o t s t a r t i n g w i t h NC

GO TOP                                           &&    Go t o t h e f i r s t r e c o r d w i t h a n o n s t a n d a r d I D
I F . N O T . EOF()                              &&    I f i t ' s t h e e n d of t h e f i l e , t h e n t h e r e a r e no
                                                 &&    n o n s t a n d a r d NPDES Nos. and n o t h i n g need be done
    CLEAR
    TYPE t r i s \ t w o r k l . m s g           &&    Displays i n s t r u c t i o n s f o r resolving
                                                 &&    n o n s t a n d a r d NPDES numbers
    WAI T   ""


*   B r o w s e t h e n o n s t a n d a r d NPDES numbers; t h e u s e r i s n o t allowed t o add or
*   d e l e t e records. The u s e r h a s t h e o p t i o n o f e i t h e r f i x i n g t h e EPA I D s o t h a t

                                                                                                         ~~~




TWORKING.PRG                                                                                                           Page C-11
*   i t i s i n t h e s t a n d a r d f o r m a t o r d e l e t i n g i t . E i t h e r of t h e s e a c t i o n s removes
*   t h e r e c o r d from t h e c o n d i t i o n a l i n d e x . When a l l records h a v e b e e n removed
*   from t h e i n d e x i n t h i s way, an e r r o r c o n d i t i o n r e s u l t s ; t h e ON ERROR CLEAR
*   l i n e c l e a r s t h e s c r e e n when t h i s happens, e f e c t i v e l y e n d i n g t h e B O S mode.
                                                                                                          R WE

    ON ERROR CLEAR
     R WE OOL W
    B O S N F L O NOAPPEND NODELETE FIELDS npdes-1
    ON ERROR

ENDIF

*   R e s t o r e s c r e e n header (wiped o u t by B O S commands)
                                                      R WE

CLEAR
@0,6SAY"WRMS D A T A                         B A S E       C O N V E R S I O N             U T I L I T Y "

CLOSE ALL
RETURN & & t w o r k i n g . p r g

*   EOF: t w o r k i n g . p r g




Page 12-12                                                                                                  TWORKING.PRG
          WRMS           D A T A        B A S E          U P D A T E     U T I L I T Y


D i r e c t i o n s for c l e a n i n g up EPA and NPDES ids:

*   You w i l l be shown r e c o r d s w i t h non-standard EPA and NPDES i d s (first EPA,
    t h e n NPDES), i . e . , t h o s e t h a t do n o t s t a r t w i t h NC.

*   If t h e i d is g a r b a g e , delete it ( e . g . ,        v e r y s h o r t NPDES i d s , e s p e c i a l l y
    t h o s e e n d i n g w i t h R and a number).

*   If t h e p r o b l e m is a t y p o ( e . g . , MC i n s t e a d of NC) f i x i t .
*   Press < C t r l - E n d >   when f i n i s h e d .




                                                                               P r e s s any key t o c o n t i n u e   ...




TWOPXl .MSG                                                                                                        Page C-13
...............................................................................
*                                                                                                                             *
*   F i l e n a m e : TFAC.PRG                                                                                                *
*   Author:           Anne E . Crook, Research T r i a n g l e I n s t i t u t e                                              *
*   Created:          10/9/90           L a s t updated: 1 / 2 8 / 9 2                                                        *
*   C a l l e d by:CONVERT                                                                                                    *
*   Comments: T R I S f a c i l i t y matching r o u t i n e .                 The T R I S F a c i l i t y Matching i s       *
*                     d i v i d e d i n t o f i v e s e c t i o n s l i s t e d below.     The p r o c e d u r e name f o r   *   -
*                     e a c h s e c t i o n i s shown a t t h e end of t h e d e s c r i p t i o n .                          *
*                                                                                                                             *
*                   Automatic F a c i l i t y Matching: computer matches f a c i l i t i e s b a s e d                        *   _
*                     on EPA I D , NPDES number, and T R I I D . (AUTO)                                                       *   -
*                                                                                                                             *
*                   I n t e r a c t i v e Checking f o r D u p l i c a t e F a c i l i t i e s : u s e r c h e c k s new      *
                                                                                                                              *
*                      f a c i l i t y r e c o r d s t o b e s u r e t h e y do n o t d u p l i c a t e e x i s t i n g
*                       f a c i l i t y r e c o r d s . (DUPS)                                                                *
                                                                                                                              *
*
*                   Automatic Assignment of F a c i l i t y I D S t o N e w F a c i l i t i e s : computer                    *
*                     assigns WRMS F a c i l i t y IDS t o n o n d u p l i c a t e new f a c i l i t y r e c o r d s .        *    '
*
*                     (ASSIGN)                                                                                                *
                                                                                                                              *
*
*
                    I n t e r a c t i v e Checking of P o s s i b l y Mismatched F a c i l i t i e s :  user                  *
                        c h e c k s f a c i l i t y matches t h a t t h e computer h a s f l a g g e d a s                    *
*                      p o s s i b l e mismatches, b e c a u s e w h i l e one o r more I D S matched, one                    *
*                       or more I D S d i d n o t , o r t h e f a c i l i t y name, a d d r e s s , or c i t y                *
*                       appear t o be d i f f e r e n t . (MANUAL)                                                            *
                                                                                                                              *
*
*
*
                    Automatic Updating of WRMS F a c i l i t y I n f o r m a t i o n : t h e computer                         *
                      u p d a t e s c e r t a i n i n f o r m a t i o n i n t h e F a c i l i t y f i l e i f newer           *
*
*
                      i n f o r m a t i o n i s a v a i l a b l e i n t h e T R I S f i l e . (UPDATE)                        *
                                                                                                                              *
*           The u s e r c a n q u i t and resume l a t e r a f t e r any o f t h e s e s e c t i o n s *
*           or d u r i n g e i t h e r of t h e i n t e r a c t i v e s e c t i o n s .                *
*                                                                                                      *
...............................................................................
*   I n i t i a l i z e variable

m-continue        = "Y"             &&   does u s e r want t o c o n t i n u e
*   T h e s t a t u s v a r i a b l e s 1 f a u t o , 1 fdup, 1 f a s s i g n , and 1-fmanual i n d i c a t e
*   whether t h e u s e r h a s c z m p l e t e d & t o f a c x l i t y matching, d u p l i c a t e c h e c k i n g ,
*   a s s i g n m e n t o f f a c i l i t y IDS, and manual c h e c k i n g of p o s s i b l e mismatches,
*   respectively.               I f u p d a t i n g f a c i l i t y i n f o r m a t i o n i s c o m p l e t e , t h e whole
*   f a c i l i t y m a t c h i n g p r o c e s s i s complete, as i n d i c a t e d by 1 f a c-done. -
*   I f t h e a u t o f a c i l i t y match h a s n o t been done, do i t , t h e n see if t h e u s e r
*   wants t o q u i t and resume l a t e r (ift h e y do, t h e ASK Q U I T p r o c e d u r e w i l l
*   r e t u r n c o n t r o l t o CONVERT).     If t h e Auto f a c i l i t y G t c h h a s a l r e a d y been
*   done, go on t o t h e n e x t t a s k .

I F .NOT. 1 f a u t o
              -
   DO a u t o
    DO ask-quit
END I F

*   Auto f a c i l i t y match i s complete, e i t h e r b e c a u s e i t was j u s t done, o r i t was
*   done e a r l i e r a n d t h e u s e r h a s resumed.

*   I f c h e c k i n g for d u p l i c a t e s h a s n o t been done, do i t , t h e n see i f t h e u s e r
*   wants t o q u i t and resume l a t e r (ift h e y do, t h e ASK Q U I T p r o c e d u r e w i l l
*   r e t u r n c o n t r o l t o CONVERT).         If c h e c k i n g f o r d u p l i c a t e s h a s a l r e a d y been


Page C-14                                                                                                                     .
                                                                                                                        TFAC PRG
*   done, go on t o t h e next t a s k

I F .NOT.       -
               1 fdup

    DO dups

*   U s e r h a s e x i t e d d u p l i c a t e checking
                                                                                                                                 ~




*   If u s e r i n d i c a t e d t h e y w e r e n o t done w i t h d u p l i c a t e c h e c k i n g ,   assume t h e y
*   want t o q u i t and r e t u r n c o n t r o l t o CONVERT.
                                                                                                                                 _
    I F .NOT. 1 fdup-                                                                                                                -
       RETURN

*   User i n d i c a t e d t h e y were done w i t h d u p l i c a t e c h e c k i n g ; see i f t h e y want t o
*   q u i t and resume l a t e r ( i f t h e y do, t h e ASK-Q U I T p r o c e d u r e w i l l r e t u r n c o n t r o l
*   t o CONVERT).
    ELSE

       DO a s k-q u i t

    ENDIF

ENDIF

*   D u p l i c a t e f a c i l i t y c h e c k i n g i s complete, e i t h e r b e c a u s e i t was j u s t done, or
*   i t was done e a r l i e r and t h e u s e r h a s resumed.

*   I f a s s i g n i n g new f a c i l i t y I D S has n o t been done, do i t , t h e n see i f t h e u s e r
*
*
    wants t o q u i t and resume l a t e r ( i f t h e y do, t h e ASK Q U I T p r o c e d u r e w i l l
    r e t u r n c o n t r o l t o CONVERT).        If a s s i g n i n g new f a c i l r t y I D S h a s a l r e a d y been
*   done, go on t o t h e n e x t t a s k .

I F .NOT. 1 f a s s i g n
   DO a s s i g n
   DO a s k-q u i t
ENDIF
*   Assignment of f a c i l i t y IDS i s complete, e i t h e r b e c a u s e it was j u s t done, or
*   i t was done e a r l i e r and t h e u s e r h a s resumed.

* If      c h e c k i n g f o r mismatches h a s n o t been done, do it, t h e n see i f t h e u s e r
*   wants t o q u i t and resume l a t e r ( i f t h e y do, t h e ASK Q U I T p r o c e d u r e w i l l
*   r e t u r n c o n t r o l t o CONVERT). If c h e c k i n g f o r mismatzhes h a s a l r e a d y been
*   done, go on t o t h e n e x t t a s k .

I F .NOT.      1-fmanual

    DO manual

*   User h a s e x i t e d c h e c k i n g for mismatches

*   I f u s e r i n d i c a t e d t h e y were n o t done w i t h c h e c k i n g for mismatches, assume
*   t h e y want t o q u i t and r e t u r n c o n t r o l t o CONVERT.

    I F .NOT.     1 fmanual
                   -
       RETURN

*   User i n d i c a t e d t h e y were done w i t h c h e c k i n g for mismatches; see i f t h e y want
*   t o q u i t and resume l a t e r (if t h e y do, t h e ASK -QUIT p r o c e d u r e w i l l r e t u r n


       .
TFAC PRG                                                                                                             Page C-15
*   c o n t r o l t o CONVERT)
    ELSE

                -
       DO a s k q u i t

    ENDIF

ENDIF

*   Checking f o r mismatches i s c o m p l e t e , e i t h e r because it w a s j u s t done, or
*   it w a s done e a r l i e r and t h e u s e r h a s resumed.

*   Presumably, u p d a t i n g f a c i l i t y i n f o r m a t i o n h a s n o t been done, b e c a u s e i f i t
*   had, f a c i l i t y m a t c h i n g would be complete and t h e u s e r would n o t h a v e been
*   able t o resume f a c i l i t y m a t c h i n g .           T h e r e f o r e , do u p d a t i n g f a c i l i t y
*                                                                                                      -
    i n f o r m a t i o n . A f t e r t h i s , f a c i l i t y m a t c h i n g i s done; t h e 1 f a c-done s t a t u s
*   v a r i a b l e i s reset t o i n d i c a t e t h i s .

DO u p d a t e
1 f a c-done = . T .
 -
RETURN & & t f a c . p r g
********X******f**********X                 PROCEDURE DEFINITIONS              ******X***********XX*****x****


PROCEDURE a s k-q u i t

*   See i f u s e r w a n t s t o q u i t and resume l a t e r .

@   1,O CLEAR
@   8,12 TO 15,66
@   10,14 S Y " P r e s s Y t o c o n t i n u e f a c i l i t y m a t c h i n g , "
           A
@   11,14 S Y " P r e s s N t o e x i t and resume f a c i l i t y m a t c h i n g l a t e r . "
           A
@   13,32 SAY " C o n t i n u e ? Y / N : "
@   13,47 GET m-c o n t i n u e PICTURE "Y"
READ

*   If t h e u s e r does want t o q u i t , r e t u r n c o n t r o l t o CONVERT.

I F m c o n t i n u e = "N"
   RETURN MASTER
             TO
ENDIF

                 q
RETURN & & a s k- u i t

...............................................................................
PROCEDURE a u t o

*   Matches f a c i l i t i e s based on EPA I D , NPDES number, a n d T R I I D .

*   Initialize variables

match = 0                     & & c o u n t s number o f TRIS r e c o r d s matched
no match = 0                  LL   counts     number     of TRIS r e c o r d s n o t matched
new f a c s = 0               &&   counts     number     o f new WRMS f a c i l i t y records c r e a t e d
facerrs = o                   &&   counts     number     of TRIS r e c o r d s p o s s i b l y mismatched
processed = 0                 &&   counts     number     of T R I S r e c o r d s p r o c e s s e d
match epa = 0                 &&   counts     number     of TRIS records matched on EPA I D
matchInpd = 0                 &&   counts     number     of TRIS records matched on NPDES number
match-t r i = 0               &&   counts     number     o f TRIS r e c o r d s matched on T R I I D


Page C-16                                                                                                                  .
                                                                                                                    TFAC PRG
matched-on           =   ""         & & s t r i n g i n d i c a t i n g which i d e n t i f i e r match   was made on
*   Open f i l e s .          The f i l e s are n o t l i n k e d .

USE t r i s \ s u b m e x t I N 1 A L I A S s u b
USE f a c i l i t y I N 2 ALIAS f a c
SELECT s u b

*   D e t e r m i n e t o t a l number of T R I S r e c o r d s t o p r o c e s s

t o t a l-recs = r e c c o u n t ("sub")

*   C a l l p r o c e d u r e t o d i s p l a y s t a t u s r e p o r t on screen

DO a u t o - r p t

*   Main l o o p ; processes e a c h r e c o r d i n working Submission f i l e

SCAN
  p r o c e s s e d = r e c n o ("sub")                      &&   S e t number of records - r o c e s s e d
                                                                                                    p
  m a t ch-f nd = F       . .                                &&   I n i t i a l i z e match f l a g
  SELECT f a c

*   Look f o r m a t c h i n g EPA i d i n WRMS F a c i l i t y f i l e

    SET ORDER TO TAG epa i d
    SEEK sub->ass -e p a -id-

*   I f a nonblank match i s found,                     s e t match f l a g t o t r u e

                                                -     -
    I F f o u n d 0 .AND. sub->ass epa i d <> s p a c e ( l 2 )
       match f n d = . T .
       mat chsd-on = "epa"

    ELSE

*   No EPA I D m a t c h f o u n d ; l o o k f o r m a t c h i n g NPDES i d i n W M F a c i l i t y f i l e
                                                                                  R S

            R E
       SET O D R TO TAG n p d e s
       SEEK sub->npdes -1

*   If a nonblank m a t c h i s f o u n d , set match f l a g t o t r u e

       I F f o u n d 0 .AND. sub->npdes-l                  <> space(9)
          match f n d = . T .
          matchgd-on = "npd"

       ELSE
*   NO NPDES match found;                  l o o k f o r m a t c h i n g T R I I D i n WRMS F a c i l i t y f i l e

           SET ORDER TO TAG t r i - i d
                                   -
           SEEK s u b - > t r i f a c i d-
*   I f a m o d e r a t e l y r e l i a b l e match i s f o u n d , s e t m a t c h f l a g t o t r u e . TRI IDS
*   t h a t e n d i n POBOX are c o n s i d e r e d s o u n r e l i a b l e t h a t t h e y are n o t a c c e p t e d a s
*   a match h e r e .        T R I I D i s assumed n e v e r t o b e b l a n k i n t h e T R I S d a t a f i l e s .

           I F f o u n d ( ) .AND. r i g h t ( s u b - > t r i -f a c i d , 5 ) <> "POBOX"
              match f n d = . T .
              matchsd-on = " t r i "
           ENDIF


TFAC. PRG                                                                                                             Page C-17
       ENDIF

    ENDIF

*   E v a l u a t e match s t a t u s

    DO CASE

       CASE .NOT. match f n d                                            &&   no match found
         no match = no-match               +   1
         new f a c s = new-f a c s         +   1
         DO make-new                                                     &&   C a l l t h e p r o c e d u r e t o make a
                                                                         &&   new F a c i l i t y r e c o r d
                                   -
          REPLACE sub->fac i d WITH fac->temp -i d                       &&   Put t e m p o r a r y f a c i l i t y I D
                                                                         &&   i n working f i l e
       CASE temp-i d <> s p a c e ( l 0 )                                &&   match found t o new F a c i l i t y
                                                                         &&   r e c o r d , so no match t o
                                                                         &&   existing F a c i l i t y record
          no match = no match    1         +
                                   -
          REFLACE sub->?ac i d WITH fac->temp -i d                       &&   Copy t e m p o r a r y f a c i l i t y I D
                                                                         &&   t o working f i l e

       OTHERWISE                                                         &&   match found t o e x i s t i n g
                                                                         &&   F a c i l i t y record
          match = match + 1
          match-&matched on = match-&matched on
                        -                  -                        +    1    &&   Increment appropriate
                                                                              &&   matched on c o u n t e r
                                   -
          REPLACE s u b - > f a c i d WITH f a c - > f a c -i d          &&   Copy f a c i l i t y I D t o working
                                                                         &&   file
          DO f i n d- i s
                     m                                                   &&   C a l l p r o c e u d r e t o check f o r
                                                                         &&   p o s s i b l e mismatches
    ENDCASE

*   C a l l procedure t o update s t a t u s report display

    DO auto-say

*   Reselect working f i l e f o r c o r r e c t f u n c t i o n i n g of SCAN l o o p

    SELECT s u b

ENDSCAN

*   A l l TRIS r e c o r d s have been a u t o matched

*   W r i t e f i n a l s t a t u s r e p o r t t o f i l e and screen

SET DEVICE TO FILE t r i s \ t f a c a u t o . t x t
DO a u t o r p t
SET DEVTCE SCREEN  TO
DO a u t o - r p t

*   Update s t a t u s v a r i a b l e s

 -
1 fauto = .T.

*   I f no new f a c i l i t y r e c o r d s were c r e a t e d , t h e r e can b e no d u p l i c a t e s of
*   e x i s t i n g f a c i l i t y r e c o r d s , s o t h e r e i s no need t o check d u p l i c a t e s o r
*   a s s i g n new f a c i l i t y I D S and t h e s t a t u s v a r i a b l e s f o r t h o s e t a s k s
*   c a n b e changed t o i n d i c a t e t h o s e t a s k s a r e d o n e .



Page C-18                                                                                                                  .
                                                                                                                    TFAC PRG
I F new facs = 0
                            -
   S T O G . T . TO 1 f d u p , 1 - f a s s i g n
ENDIF

*   I f no p o s s i b l e mismatches were f l a g g e d , t h e n t h e r e i s no need t o do
*   i n t e r a c t i v e c h e c k i n g o f p o s s i b l e mismatches and t h e s t a t u s v a r i a b l e
*   f o r t h a t t a s k can b e changed t o i n d i c a t e t h a t t a s k i s done.
                                                                                                                                        -
I F f a c errs = 0
                   -
   S O - . T . TO 1 fmanual
    TW
                                                                                                                                        _
ENDIF
                                                                                                                                        -
@ 2 2 , 1 9 SAY "Auto F a c i l i t y Match Complete.
WAIT       ""
                                                                                 P r e s s any key t o c o n t i n u e   . . ."
CLOSE ALL
RETURN & & a u t o
...............................................................................
PROCEDURE f i n d-mis

*   Make r e c o r d o f d i s c r e p a n c i e s between t h e WRMS F a c i l i t y f i l e and t h e T R I S
*   working f i l e t h a t may i n d i c a t e a mismatdh. FAC-ERROR is set t o True for
*   any p o s s i b l e mismatch; ERR FIELD i n d i c a t e s which f i e l d s c o n t a i n d i s c r e p a n c i e s .
*   Note t a h t t h e s e d i s c r e p a n c x e s o n l y i n d i c a t e t h e p o s s i b i l i t y of a mismatch.

*   Check t h a t nonblank EPA I D matches e x a c t l y

I F sub->assuepa i d <> s p a c e ( 1 2 ) .AND. epa i d <> sub->ass-epa-id -
   REPLACE sub->zac e r r o r WITH .T.,:
                                -                                              -
            s u b - > e r r - f i e l d WITH t r i m ( sub->err f i e l d ) +"E"
ENDIF

*   Check t h a t nonblank NPDES number matches e x a c t l y

I F sub->npdes-l <> s p a c e ( 9 ) . A N D . npdes <> sub->npdes -1
   REPLACE sub->fac e r r o r W I T H . T . , ;
                                                                               -
           s u b - > e r c - i e l d WITH t r i m ( s u b - > e r r f i e l d ) +"N"
                           -f
ENDIF

*   Check t h a t T R I I D matches e x a c t l y

I F t r i i d <> s u b - > t r i f a c i d
   REPLZCE s u b - > f a c - e r r o r EITH . T . , ;
                                -                                              -
              s u b - > e r r f i e l d WITH t r i m ( s u b - > e r r f i e l d ) + " T "
ENDIF

*   Check t h a t t h e f i r s t 5 c h a r a c t e r s o f f a c i l i t y name match.    A complete match
*   o f f a c i l i t y name i s u n l i k e l y even f o r c o r r e c t l y matched f a c i l i t i e s , due t o
*   v a r i a n t s i n s p e l l i n g and a b b r e v i a t i o n s .

I F l e f t ( f a c name, 5 ) <> l e f t (sub->fac -name-l,5)
   REPLACE s c b - > f a c - e r r o r WITH . T . , ;
                                -
                 s u b - > e r r f i e l d WITH t r i m ( s u b - > e r r -f i e l d ) t " F "
ENDIF

*   Check t h a t t h e f i r s t 1 0 c h a r a c t e r s of t h e s t r e e t a d d r e s s match. A complete
*   match o f s t r e e t address i s u n l i k e l y even f o r c o r r e c t l y matched f a c i l i t i e s ,
*   due t o v a r i a n t s i n s p e l l i n g and a b b r e v i a t i o n s .

                  -
I F l e f t (street 1 , l O )        <> l e f t ( s u b - > s t r e e t - l , l O )


       .
TFAC PRG                                                                                                                    Page C-19
  REPLACE sub->fac error WITH .T.,;
                  -
          sub->err-field WITH trim(sub->err-field) +"A"
ENDIF
* Check that city matches exactly
IF city <> left (sub->city,l5)
  REPLACE sub->fac error WITH .T.,;
                  -
          sub->err-field WITH trim(sub->err-field)+"C"
ENDIF
* If any discrepancies were found, increment data mismatch counter.
IF sub->fat-error
  fac errs = fac-errs      +   1
ENDIF-
RETURN   &&   find-m i s
...............................................................................
PROCEDURE make-new
* Creates a new WRMS Facility record for unmatched facilities. A temporary
* Facility ID is assigned, pending human check for match. The temporary
*   facility ID has the format T#####.
*   Currently selected data base is FACILITY
APPEND BLANK
REPLACE created WITH date(), year added WITH val(sub->rptqrear),;
        temp id WITH "TO"+ right (%r(new facs+10000,5),4) ,;
        fac Td WITH find id(sub->fac-namg-l),;
        fac-name WITH le& (trim(sub->fac-name-l) + I 1 "+sub->fac_name-Z, 40), ;
        street 1 WITH sub->street 1, street 2 WITH sub->street 2 , ;
        city WITH left(sub->city,iS), county WITH left(sub->county,12),:
        zip WITH left (sub->zipcode, ;
                                     5),
        contact WITH sub->contact, phone WITH sub->phone,;
        sic 1 WITH sub->sic 1, sic 2 WITH sub->sic 2, sic 3 WITH sub->sic-3 , ;
        epa-id WITH sub->ass epa ia, npdes WITH suE->npdes 1,;-
                                 -
        tri-id WITH sub->tri-fac-id,;
        lat-WITH sub->facil-iat, long WITH sub->fadl-long
RETURN   &&   make-new
...............................................................................
FUNCTION find-id
*   Creates the four letter facility ID prefix from the facility name (the prefix
*   is the first four charcters of the facility name, with spaces changed to
*   underscores). Accepts the facility name as a parameter from the calling
*   program, and returns a four character string representing the facility ID
*   prefix.
PARAMETERS name
id-code = left (name, )
                     4                   &&   facility ID prefix
DO WHILE "   $ id-code
               I'

 id code = STUFF(id-code,at        ("   ",id-code),l,"-")
ENDEO


Page C-20                                                                    TFAC.PRG
                      -
    RETURN(id c o d e )                  &&   f i n d-i d
    ...............................................................................
PROCEDURE a u t o-r p t

    *   D i s p l a y s s t a t i c p o r t i o n s of f a c i l i t y m a t c h i n g s t a t u s report on s c r e e n

        @ 1,0 CLEAR
        @ 4 , 2 6 SAY "TRIS DATA CONVERSION"
        (d 5 . 2 1 SAY "FACILITY MATCHING STATUS REPORT"
           .,    ~~-~     ~    ~~   ~~        ~    ~    ~~~~~       ~   ~   ~    ~     ~




        @ 8,17 SAY "Number of TRIS records processed:"
        @ 8,52 SAY processed PICTURE "99999"
        @ 8 , 5 8 SAY " o f "
        @ 8,61 SAY t o t a l recs PICTURE "99999"
        @ 1 0 , 1 3 S Y " T o t a l number of TRIS records matched:"
                     A
        @ 1 0 , 5 2 S Y match PICTURE "99999"
                     A
        @ 1 1 , 9 SAY "Number of TRIS records matched on EPA i d : "
        @ 1 1 / 5 2 SAY match epa PICTURE "99999"
        @ 12,7 SAY "Number of TRIS records matched on NPDES i d : "
        @ 1 2 , 5 2 SAY match npd PICTURE "99999"
        @ 1 3 , 9 SAY "Number of TRIS records matched on T R I i d : "
        @ 1 3 , 5 2 SAY match t r i PICTURE "99999"
        @ 1 5 , 2 SAY "Number of FACILITY records w i t h data mismatches:"
        @ 1 5 , 5 2 S Y f a c e r r s PICTURE "99999"
                     A
        @ 1 7 , 1 5 SAY "Nuiiiber of TRIS records n o t matched:"
        @ 17,52 SAY no-match PICTURE "99999"
        @ 1 9 ' 9 SAY "Number of new FACILITY records g e n e r a t e d : "
                                         -
        @ 19,52 SAY new f a c s PICTURE "99999"

RETURN & & a u t o-r p t

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


PROCEDURE a u t o-s a y

*       D i s p l a y s dynamic p o r t i o n of f a c i l i t y m a t c h i n g s t a t u s report                                        (counter
*       variables)

        @ 8,52 S Y processed PICTURE "99999"
                    A
        @ 1 0 , 5 2 SAY m a t c h PICTURE "99999"
        @ 11,52 SAY match epa PICTURE "99999"
        l3           A
          1 2 , 5 2 S Y match-nDd PICTURE "99999"
        @ 13;52 SAY match-tki PICTURE "99999"
        @ 15,52 SAY f a c errs PICTURE "99999"
.       @ 1 7 / 5 2 S Y no match PICTURE "99999"
                     A
        @ 1 9 / 5 2 SAY ne; -f a c s PICTURE "99999"

RETURN & & auto-say
...............................................................................
PROCEDURE d u p s

*       User c h e c k s new f a c i l i t y records t o be s u r e t h e y do n o t d u p l i c a t e e x i s t i n g
*       f a c i l i t y records.

*       Initialize variables

done = "N"                                        &&    I n d i c a t e s w h e t h e r user i s done c h e c k i n g for d u p l i c a t e s
e x i t l o o p = .F.                             &&    I n d i c a t e s w h e t h e r u s e r pressed e x i t key (F10) t o q u i t



TFAC PRG     .                                                                                                                                                    Page C-21
*   Open f i l e s . F a c i l i t y and working s u b m i s s i o n f i l e a r e l i n k e d on permanent
*   facility ID.           S i n c e new f a c i l i t y r e c o r d s have o n l y a t e m p o r a r y I D (which i s
*   i n t h e TEMP I D f i e l d of t h e f a c i l i t y f i l e , n o t t h e permanent FAC I D f i e l d ) ,
*   t h i s l i n k w r l l n o t f i n d a c o r r e s p o n d i n g working f i l e r e c o r d f o r f i e w F a c i l i t y
*   r e c o r d s . However, when p o t e n t i a l d u p l i c a t e s a r e found, t h e F a c i l i t y w i t h
*   a permanent f a c i l i t y I D may have a c o r r e s p o n d i n g working f i l e record, which
*   may s h e d l i g h t on w h e t h e r t h e f a c i l i t y r e c o r d s a r e d u p l i c a t e s o r n o t .
USE f a c i l i t y I N 1 ORDER i d num ALIAS f a c
USE t r i s \ s u b m e x t I N 2 ORDER f a c i d A L I A S s u b
SET RELATION TO f a c-i d I N T O sub-

*   Determine n e x t u n a s s i g n e d f a c i l i t y I D s e r i a l number. The f a c i l i t y I D i s made
*   up of t h e p r e f i x d e r v i e d from t h e f a c i l i t y name and t h i s s e r i a l number.

GO BOTTOM
next i d = r i g h t (fac-id, 6 )
DO fynd-n e x t                   & & r e t u r n s n e x t s e r i a l number as a s t r i n g i n NEXT-ID

*   D i s p l a y i n s t r u c t i o n s f o r c h e c k i n g f o r d u p l i c a t e f a c i l i t i e s and t h e n e x t
*   a v a i l a b l e f a c i l i t y I D s e r i a l number.

CLEAR
TYPE t r i s \ t f a c l . m s g
@0,6SAY"WRMS D A T A B A S E C O N V E R S I O N                                                     U T I L I T Y "
@ 23,O SAY "The n e x t a v a i l a b l e i d num i s : "
@ 23,30 SAY n e x t i d
@ 23,50 S Y "Press any key t o c o n t i n u e
         A                                                11       .. .
WAIT     ""


*   D a t a b a s e c u r r e n t l y i n use i s F a c i l i t y i n work area 1, a l i a s FAC

SET ORDER TO TAG c i t y-name                                      &&   Order i s c i t y       +   f a c i l i t y name
GO TOP

ON K E Y LABEL F10 e x i t l o o p = . T .                         &&   S e t s up F10 as e x i t key
SET STATUS ON                                                      &&   Displays status l i n e for easier
                                                                   &&   n a v i g a t i o n i n BROWSE

*   E n t e r i n t e r a c t i v e BROWSE mode.   Loop w i l l c o n t i n u e t o d i s p l a y F a c i l i t y f i l e
*   and working f i l e a l t e r n a t e l y u n t i l e x i t k e y (F10) i s p r e s s e d .

DO WHILE .NOT.            exitloop

    SELECT f a c

*   BROWSE F a c i l i t y f i l e ; u s e r i s n o t a l l o w e d t o add r e c o r d s . S t a n d a r d dBase
*   c o n t r o l keys t o end BROWSE are i n e f f e c t ( E s c f o r end w i t h o u t s a v i n g changes
*   t o current record;             Ctrl-End        f o r end s a v i n g changes t o c u r r e n t r e c o r d ) .
    BROWSE NOFOLLOW NOAPPEND LOCK 1 FIELDS f a c i d , temp i d ,                                   c i t y , fac-name,;
       street-1, s t r e e t 2 , c o u n t y , z i p , e p a-id,-npdes,                  tri-id,        l a t , long,;
       c o n t a c t , phone, sic-1, s i c-2, s i c-3

*   User p r e s s e d ESC or Ctrl-End t o e x i t browse o f F a c i l i t y f i l e .                        I f user
*   p r e s s e d F10 b e f o r e ESC o r Ctrl-End, e x i t l o o p .

    IF exitloop
      EXIT
    ENDIF

*   BROWSE working f i l e ; u s e r i s n o t a l l o w e d t o add r e c o r d s .                   S t a n d a r d dBase


Page C-22                                                                                                                           .
                                                                                                                                TFAC PRG
         c o n t r o l k e y s t o end BROWSE are i n e f f e c t ( E s c f o x end w i t h o u t s a v i n g changes
         t o c u r r e n t r e c o r d ; Ctrl-End f o r end s a v i n g changes t o c u r r e n t r e c o r d ) .

         SELECT s u b
         BROWSE NOAPPEND NODELETE LOCK 1 FIELDS fac-id, c i t y , fac-name-1,;
           f a c name-2, street-1, s t r e e t 2 , c o u n t y , z i p c o d e , ass-epa i d , npdes 1,;
           t r i z f a c i d , f a c i l l a t , f a c i l - l o n g , c o n t a c t , phone, sic-17 sic-2, sic-3,;
                                                          -
            cas-num;       chem-namg                                                                                                      -
         U s e r p r e s s e d ESC or Ctrl-End t o e x i t browse of working f i l e .           If user pressed
         F10 v e f o r e ESC or Ctrl-End, t h e l o o p c o n d i t i o n w i l l no l o n g e r be s a t i s f i e d ,
         and t h e program w i l l c o n t i n u e a f t e r t h e l o o p .

ENDDO                    &&   r e s t a r t l o o p if F10 w a s n o t p r e s s e d b e f o r e E s c or Ctrl-End
*        T u r n s t a t u s l i n e back o f f , and reset ON KEY command ( u s e d e a r l i e r t o d e t e c t
*        u s e r p r e s s i n g F 1 0 ) . The i = i n k e y 0 l i n e c l e a r s t h e F10 key p r e s s from t h e
*        t y p e a h e a d b u f f e r of t h e keyboard:

SET STATUS OFF
ON K E Y
i = inkey()

*        See i f u s e r i s done c h e c k i n g d u p l i c a t e f a c i l i t i e s .
CLEAR
~  ~~~.
    ~~




TYPE t r i s \ t f a c 2 . m s g                            &&   D i s p l a y s message a s k i n g i f u s e r i s done.
@ 6.6 TO 19.73
@ l7,52 GET'done PICTURE "Y"                                &&   G e t s r e s p o n s e and s a v e s i t i n DONE
READ

*        I f u s e r i n d i c a t e s t h e y are done c h e c k i n g d u p l i c a t e s , u p d a t e s t a t u s v a r i a b l e

I F done = "Y"
   1-fdup = . T .
ENDIF

*        R e s t o r e h e a d e r wiped o u t by BROWSE

@0,6SAY"WRMS D A T A                                 B A S E        C O N V E R S I O N                U T I L I T Y "

CLOSE ALL
RETURN & & dups
...............................................................................
PROCEDURE a s s i g n

         Assign f a c i l i t y I D S t o r e m a i n i n g new F a c i l i t y r e c o r d s , r e p l a c e temporary
         f a c i l i t y I D S w i t h permanent f a c i l i t y i d s , d e l e t e temporary I D S from F a c i l i t y ,
         and pack F a c i l i t y t o delete r e c o r d s marked a s d u p l i c a t e s i n t h e p r e v i o u s s t e p .

         Data b a s e i n u s e i s F a c i l i t y

         1 , 0 CLEAR
         9,12 SAY " A s s i g n i n g FAC IDS t o n o n - d u p l i c a t e d
                                               -                                     facilities         ...   11




         Determine n e x t a v a i l a b l e f a c i l i t y I D s e r i a l number

                                                -
USE f a c i l i t y I N 1 ORDER i d num A L I A S f a c
GO BOTTOM
n e x t -i d = r i g h t ( f a c i d , 6 )


TFAC PRG    .                                                                                                                 Page C-23
DO f i n d-n e x t                        &&   r e t u r n s n e x t s e r i a l number as a s t r i n g i n NEXT-ID

*   R e t u r n d a t a b a s e t o n a t u r a l o r d e r and go t o t h e t o p

SET ORDER TO
GO TOP

*   Assign a c o m p l e t e f a c i l i t y I D t o a l l r e c o r d s w i t h n o s e r i a l number i n t h e
*   f a c i l i t y I D ( t h e f a c i l i t y I D p r e f i x w a s entered during t h e auto f a c i l i t y
*   m a t c h ) . These a r e t h e s a m e r e c o r d s t h a t have a t e m p o r a r y f a c i l i t y I D .

SCAN FOR r i g h t t f a c-i d , 6 ) = space(6)
*   A d d a s e r i a l number t o t h e f a c i i t y I D p r e f i x .

    REPLACE f a c id WITH t r i m ( f a c i d ) + n e x t i d
    DO f i n d-n e x t          & & r e F u r n s nexF s e r i a l number as a s t r i n g i n NEXT-ID

ENDSCAN

@ 9,63 SAY “Done“
@ 10,12 SAY “Copying f a c i l i t y i d s t o T R I S f i l e             ................      1,




*   Copy new f a c i l i t y I D S t o t h e working f i l e .
*   Currently s e l e c t e d d a t a base i s F a c i l i t y . Open working f i l e a l s o and select
*   it.
SET ORDER TO temp i d
USE t r i s \ s u b m e x t F N 2 A L I A S s u b
SELECT sub

*   P r o c e s s a l l working f i l e r e c o r d s w i t h a temporary f a c i l i t y I D .

SCAN FOR l i k e (‘IT?????                ”,fac-id)

    SELECT f a c                                                 &&   Select Facility f i l e
    SEEK s u b - > f a c i d                                     &&   F i n d temporary f a c i l i t y I D
    REPLACE sub->?ac -i d W I T H f a c - > f a c -i d           &&   Copy permanent f a c i l i t y I D t o
                                                                 &&   working f i l e

*   S e l e c t working f i l e f o r c o r r e c t f u n c t i o n i n g of SCAN l o o p

    SELECT s u b

ENDSCAN

*   Delete t e m p o r a r y f a c i l i t y I D S from F a c i l i t y f i l e

SELECT f a c
                          -
REPLACE ALL temp i d W I T H s p a c e ( l 0 )
@ 1 0 , 6 3 SAY “Done”

*   Delete d u p l i c a t e F a c i l i t y r e c o r d s   (marked i n d u p l i c a t e matching s t e p ) from
*   Facility f i l e .

@ 11,12 SAY “ D e l e t i n g d u p l i c a t e FACILITY r e c o r d s        ..............     “


PACK

@ 1 1 , 6 3 SAY “Done”


Page C-24                                                                                                              .
                                                                                                                TFAC PRG
*   Update s t a t u s v a r i a b l e t o i n d i c a t e f a c i l i t y I D a s s i g n s t e p i s d o n e .

1-fassign        = .T.

CLOSE ALL
RETURN & & a s s i g n
...............................................................................
PROCEDURE f i n d-n e x t

*   Increment n e x t -i d v a r i a b l e

n e x t i d = s t r ( v a l ( n e x t - i d ) + l,6)
DO WriILE        I'  $ next-id
   n e x t -i d = s t u f f ( n e x t-i d , a t ( " " , n e x t -i d ) ,1,"0")
ENDDO

RETURN & & f i n d-n e x t
...............................................................................
PROCEDURE manual

*   User c h e c k s f a c i l i t y matches t h a t t h e computer h a s f l a g g e d as p o s s i b l e
*   mismatches, b e c a u s e w h i l e one o r more I D S matched, one or more I D S d i d n o t ,
*   or t h e f a c i l i t y name, address, o r c i t y appear t o b e d i f f e r e n t . Any r e c o r d s
*   s t i l l f l a g g e d when u s e r i n d i c a t e s t h e y are done c h e c k i n g mismatches w i l l be
*   used t o create a new F a c i l i t y r e c o r d .

*   I n i t i a l i z e variables
done = "N"                          &&      I n d i c a t e s whether u s e r i s done c h e c k i n g f o r d u p l i c a t e s
e x i t l o o p = .F.               &&      I n d i c a t e s whether u s e r p r e s s e d e x i t key (F10) t o q u i t

*   Open F a c i l i t y and working f i l e s

USE t r i s \ s u b m e x t I N 1 A L I A S s u b
                                             -
USE f a c i l i t y I N 2 ORDER i d num ALIAS f a c

*   Determine n e x t a v a i l a b l e f a c i l i t y I D s e r i a l number

SELECT fac
GO BOTTOM
n e x t i d = r i g h t ( f a c-i d , 6 )
           -
DO f r n d n e x t

*   Link working f i l e and F a c i l i t y f i l e on f a c i l i t y I D

SET ORDER TO f a c i d
SELECT s u b
                          -
SET RELATION TO f a c-i d I N T O f a c

*   D i s p l a y i n s t r u c t i o n s f o r c h e c k i n g p o s s i b l e mismatches ( 2 s c r e e n s ) , and t h e
*   n e x t a v a i l a b l e f a c i l i t y I D s e r i a l number.
CLEAR
TYPE t r i s \ t f a d . m s g
WAIT ""
TYPE t r i s \ t f a c l . m s g
@ 21,O SAY "The n e x t a v a i l a b l e i d-num i s : "
@ 21,30 SAY n e x t -i d



       .
TFAC PRG                                                                                                              Page C-25
WAIT     'I "



ON K E Y LABEL F10 e x i t l o o p = . T .                     &&   S e t s up F10 as e x i t key
SET STATUS ON                                                  &&   D i s p l a y s s t a t u s l i n e f o r easier
                                                               &&                   R WE
                                                                    navigation i n B O S
*   E n t e r i n t e r a c t i v e B O S mode. Loop w i l l c o n t i n u e t o d i s p l a y working f i l e
                                     R WE
*   a n d F a c i l i t y f i l e a l t e r n a t e l y u n t i l e x i t key (F10) i s pressed.

DO WHILE .NOT.           exitloop
*   B O S working f i l e ; u s e r i s n o t allowed t o add o r d e l e t e records.
     R WE                                                                                                     Standard
*   dBase c o n t r o l k e y s t o e n d B O S are i n e f f e c t (Esc f o r e n d w i t h o u t s a v i n g
                                                  R WE
*   c h a n g e s t o c u r r e n t r e c o r d ; Ctrl-End f o r end s a v i n g c h a n g e s t o c u r r e n t r e c o r d ) .

    SELECT s u b
    B O S NOAPPEND NODELETE LOCK 1 FIELDS fac i d , f a c e r r o r , e r r f i e l d , ;
     R WE
      f a c name 1, fac-name-2,           street-1, s t r e e t I 2 , c i t y , c o u n t y , zypcode,;
      facrl       lac,
                    f a c i l-l o n g , c o n t a c t , phone, sic-1, ass-epaid, npdes-1,;
      t r i-    fac
               -i d
*   U s e r p r e s s e d ESC o r Ctrl-End t o e x i t browse of F a c i l i t y f i l e .              If u s e r
*   pressed F10 b e f o r e ESC o r Ctrl-End, e x i t l o o p .

    IF exitloop
      EXIT
    ENDIF

*   B O S F a c i l i t y f i l e ; u s e r i s n o t a l l o w e d t o add or delete records. S t a n d a r d
     R WE
*   dBase c o n t r o l k e y s t o e n d B O S are i n e f f e c t ( E s c f o r e n d w i t h o u t s a v i n g
                                            R WE
*   c h a n g e s t o c u r r e n t record; Ctrl-End f o r end s a v i n g c h a n g e s t o c u r r e n t r e c o r d ) .

    SELECT f a c
    B O S NOAE'PEND NODELETE LOCK 1 FIELDS fac-id, f a c name, street-1, s t r e e t - 2 , ;
     R WE
      c i t y , c o u n t y , z i p , l a t , l o n g , c o n t a c t , phone,  sic
                                                                               -1, epa-id, npdes, t r i - i d
*   U s e r p r e s s e d ESC o r Ctrl-End t o e x i t browse of working f i l e .         If u s e r pressed
*   F10 v e f o r e E s c or Ctrl-End, t h e loop c o n d i t i o n w i l l no l o n g e r be s a t i s f i e d ,
*   a n d t h e p r o g r a m w i l l c o n t i n u e a f t e r t h e loop.

ENDDO               &&   r e s t a r t l o o p i f F10 w a s n o t pressed b e f o r e ESC o r Ctrl-End

*   Turn s t a t u s l i n e back o f f , a n d reset ON KEY command ( u s e d e a r l i e r t o detect
*   u s e r p r e s s i n g F 1 0 ) . The i = i n k e y ( ) l i n e clears t h e F10 key press f r o m t h e
*   t y p e a h e a d b u f f e r of t h e k e y b o a r d .

SET STATUS OFF
ON K E Y
i = inkey()

*   R e s t o r e h e a d e r wiped o u t by B O S
                                              R WE
@0,6SAY"WRMS                    D A T A           B A S E    C O N V E R S I O N              U T I L I T Y "

*   Determine c o m p l e t i o n s t a t u s b y c h e c k i n g f o r r e m a i n i n g T r u e s i n FAC ERROR
*   f i e l d of w o r k i n g f i l e ( t h e r e may be some l e f t e v e n when u s e r i s done;
*   however, if none are l e f t , t h e u s e r i s assumed t o be d o n e ) .
@ 9,33      S Y "Please w a i t
             A                         ...   $1




SELECT s u b
LOCATE FOR f a c-e r r o r


Page C-26                                                                                                                   .
                                                                                                                       TFAC PRG
I F .NOT.          found0                           &&   N o more d i s c r e p a n c i e s l e f t

    1 fmanual = . T .                      & & Update s t a t u s v a r i a b l e
    @-l,O CLEAR                            & & D i s p l a y done message
    @ 9 , 1 6 TO 13,62 DOUBLE
    @ 11,18 SAY " A l l f a c i l i t y mismatches have been r e s o l v e d . "
    @ 22,50 SAY "Press any key t o c o n t i n u e             I,   ...
    WAIT     I"'



ELSE                                                &&   Some r e c o r d s a r e s t i l l m a r k e d w i t h
                                                    &&   discrepancies
    @ 1 , 0 CLEAR
    @ 9 , 1 9 TO 14,52                                         & & See i f u s e r i s done
    @ 11,21 SAY "Have you f i n i s h e d manual check"
    @ 1 2 , 2 1 SAY "of f a c i l i t y mismatches? Y / N : I'
    @ 12,SO GET done PICTURE "Y"                               & & G e t r e s p o n s e and s a v e t o DONE
    READ

    I F done = "Y'l                                                                   -
                                          & & u s e r i n d i c a t e d t h e v w e r e done
       @ 1,O CLEAR
       @ 9,22 S Y " C r e a t i n g new WRMS f a c i l i t i e s
               A                                                       I,  .. .
       SET RELATION TO                             &&    Unlink t h e F a c i l i t y and working f i l e s
       SELECT s u b

*   P r o c e s s o n l y working f i l e r e c o r d s s t i l l f l a g g e d ; t h i s i s t h e u s e r ' s way t o
*   i n d i c a t e a new F a c i l i t y r e c o r d i s needed.

       SCAN FOR f a c e r r o r
         SELECT fat-

*   Create a new f a c i l i t y r e c o r d

           APPEND BLANK
           REPLACE c r e a t e d W I T H d a t e ( ) , y e a r -added WITH v a l ( s u b - > r p t - y e a r ) , ;
             fat i d W I T H sub->fac-id,;
              f a c n a m e WITH l e f t ( t r i m ( s u b - > f a c name-l)+" "+sub->fac na1ne-2~40) ,;
              street         1 WITH s u b - > s t r e e t 1, street 2 WITH sub->streeF-2,;
              c i t y WITH l e f t ( s u b - > c i t y , i 5 ) , c o u n t y WITH l e f t (sub->county, 1 2 ) ' ;
              z i p W I T H l e f t (sub->zipcode, 5), ;
              c o n t a c t W I T H s u b - > c o n t a c t , phone WITH sub->phone,;
              s i c 1 W I T H s u b - > s i c 1, s i c 2 WITH s u b - > s i c 2 , s i c 3 W I T H sub->sic-3,;
              epa-id WITH s u b - > a s s epa-iz, npdes W I T H s&->npdeZ-l,;
                                                     -
              t r i - i d WITH s u b - > t r i - f a c i d , ;
              l a t - W I T H s u b - > f a c i l - a t , l o n g WITH s u b - > f a c i l -l o n g
                                                   r

*   Reset d i s c r e p a n c y f l a g

           SELECT s u b
           REPLACE f a c-e r r o r W I T H . F .

       ENDSCAN

       @ 9 , 5 5 SAY "Done"

*   Update s t a t u s v a r i a b l e

       1 fmanual = . T .
        -
    ENDIF

ENDIF


       .
TFAC PRG                                                                                                             Page C-27
CLOSE ALL
RETURN & & manual
...............................................................................
PROCEDURE u p d a t e

*
*   Update b l a n k f i e l d s i n F a c i l i t y f i l e , p l u s u p d a t e c o n t a c t f i e l d s (even i f
    not blank)

*   Open F a c i l i t y and working f i l e s and l i n k them on f a c i l i t y I D

USE f a c i l i t y I N 1 A L I A S f a c
USE t r i s \ s u b m e x t I N 2 ORDER f a c i d ALIAS sub
SET RELATION TO f a c-i d I N T O sub-

@ 1 , 0 CLEAR

*   Update c o n t a c t name and phone number f o r a l l F a c i l i t y r e c o r d s t h a t d o n ' t
*   a g r e e w i t h c o r r e s p o n d i n g working f i l e record, b u t d o n ' t o v e r w r i t e d a t a i f
*   working f i l e h a s no d a t a . Each replace command o p e r a t e s on t h e whole
*   F a c i l i t y f i l e w i t h w h a t e v e r r e s t r i c t i o n s are s p e c i f i e d .
@  9 , 2 4 SAY "Updating c o n t a c t d a t a            ....
                                                            11

REPLACE c o n t a c t W I T H s u b - > c o n t a c t , phone WITH sub->phone, u p d a t e d WITH d a t e ( ) ;
           FOR c o n t a c t <> s u b - > c o n t a c t .AND. s u b - > c o n t a c t <> s p a c e ( 3 0 )
@ 9 , 5 1 SAY "Done"

*   Update b l a n k street d a t a i n F a c i l i t y f i l e w i t h d a t a i n c o r r e s p o n d i n g
*   working f i l e r e c o r d .

@ 1 0 , 2 4 SAY "Updating s t r e e t d a t a           .....
                                                         I,


REPLACE s t r e e t 1 WITH s u b - > s t r e e t - 1 , street-2 W I T H sub->street -2 , ;
            u p d a t e 3 W I T H date ( ) ;
            FOR s t r e e t-1 = s p a c e ( 3 0 ) .AND. s u b - > s t r e e t -1 <> s p a c e ( 3 0 )
@ 1 0 , 5 1 SAY "Done"

*   Update b l a n k c o u n t y d a t a i n F a c i l i t y f i l e w i t h d a t a i n c o r r e s p o n d i n g
*   working f i l e r e c o r d .

@ 1 1 , 2 4 SAY "Updating c o u n t y d a t a           . . . . ."
REPLACE c o u n t y W I T H l e f t (sub->county, 1 2 ) , u p d a t e d W I T H d a t e 0 ;
            FOR c o u n t y = s p a c e ( l 2 ) . A N D . sub->county <> s p a c e ( 2 5 )
@ 11,51 SAY "Done"

*   Update b l a n k l a t / l o n g d a t a i n F a c i l i t y f i l e w i t h d a t a i n c o r r e s p o n d i n g
*   working f i l e r e c o r d .

@ 12,24 SAY "Updating l a t / l o n g d a t a               . .."
REPLACE l a t W I T H s u b - > f a d l -l a t , l o n g WITH s u b - > f a c i l - l o n g , u p d a t e d WITH d a t e ( ) ;
            FOR l a t = s p a c e ( 7 ) .AND. s u b - > f a c i l -l a t 4> s p a c e ( 7 )
@ 1 2 , 5 1 SAY "Done"

*   Update b l a n k S I C code d a t a i n F a c i l i t y f i l e w i t h d a t a i n c o r r e s p o n d i n g
*   working f i l e r e c o r d .

@ 1 3 , 2 4 SAY "Updating S I C d a t a           I,
                                                    ........
REPLACE s i c 1 WITH s u b - > s i c 1, s i c 2 WITH s u b - > s i c -2 , s i c 3 W I T H sub->sic-3,;
            u p d a t e d WITH date()-FOR siZ-1 = s p a c e ( 4 ) .AND. sui;->sic-l        <> s p a c e ( 4 )
@ 1 3 , 5 1 SAY "Done"

*   Count how many F a c i l i t y r e c o r d s w e r e u p d a t e d .


Page (2-28
COUNT TO f-updates FOR u p d a t e d = d a t e 0

*   D i s p l a y number of r e c o r d s u p d a t e d .

@ 16,22 SAY f u p d a t e s PICTURE "99999"
@ 16,28 SAY " k M S f a c i l i t y r e c o r d s u p d a t e d . "
@ 22,50 SAY "Press any key t o c o n t i n u e
WAIT    ""
                                                            . . ."
CLOSE ALL
RETURN       &&   update

*   EOF: t f a c . p r g




TFAC. PRG                                                             Page C-29
          W R M S        D A T A        B A S E        C O N V E R S I O N           U T I L I T Y

D i r e c t i o n s f o r marking d u p l i c a t e f a c i l i t i e s :

*   WRMS F a c i l i t y r e c o r d s w i l l be shown i n d e x e d by c i t y , t h e n f a c i l i t y name

*   I f a new r e c o r d     (one w i t h a TEMP-ID)           matches no o t h e r r e c o r d ,   do n o t h i n g ,

*   I f a new r e c o r d matches an e x i s t i n g r e c o r d , e n t e r t h e f a c i d from t h e
    e x i s t i n g r e c o r d i n t h e new r e c o r d , and mark t h e new r e c o r a f o r d e l e t i o n .

*   I f a new r e c o r d matches a n o t h e r new r e c o r d , a s s i g n a new f a c i d and e n t e r
    it i n BOTH r e c o r d s , and mark one r e c o r d f o r d e l e t i o n . The f a c i d i s t h e
    f i r s t 4 c h a r s o f t h e f a c i l i t y name ( u s i n g - f o r s p a c e s ) p l u s a-serial i d num.

*   I n general, t h e i d e a i s t o l e a v e one complete r e c o r d f o r e a c h f a c i l i t y ,
    and mark any d u p l i c a t e s f o r d e l e t i o n . However, a f a c i d must b e e n t e r e d
    f o r e v e r y d u p l i c a t e r e c o r d , whether marked f o r d e l e t i o n o r n o t . Records t h a t
    are n o t d u p l i c a t e s do n o t need a fac-id e n t e r e d ; t h e program w i l l a s s i g n one.
*   U s e <Esc> or <Ctrl-End> t o t o g g l e between TRIS d a t a and t h e c o r r e s p o n d i n g
    WRMS d a t a . P r e s s F10 t h e n <Esc> or <Ctrl-End> t o q u i t .              < E x > w i l l not save
    any changes t o t h e c u r r e n t r e c o r d b e f o r e t h e s w i t c h ; <Ctrl-End> w i l l .




Page C-30                                                                                                          TFACl .MSG
      W R M S     D A T A       B A S E       C O N V E R S I O N             U T I L I T Y




        I f you have f i n i s h e d marking d u p l i c a t e f a c i l i t i e s , new FAC I D S
        w i l l be a s s i g n e d t o a l l r e m a i n i n g f a c i l i t i e s , new FAC I D S w i l l
        b e c o p i e d t o t h e T R I S f a c i l i t y f i l e , TEMP I D S w i l l be-deleted
        from t h e WRMS f a c i l i t y f i l e , and a l l recoyds marked f o r d e l e t i o n
        i n t h e WRMS f a c i l i t y f i l e w i l l be d e l e t e d .
        P r e s s Y if you have f i n i s h e d marking d u p l i c a t e f a c i l i t i e s ,
        P r e s s N i f you have n o t .

        Marking D u p l i c a t e F a c i l i t i e s Complete? Y/N:




TFAC2 .MSG                                                                                                   Page C-31
          W R M S        D A T A         B A S E        C O N V E R S I O N                U T I L I T Y

I n s t r u c t i o n s f o r manual check of f a c i l i t y matching:

*   T R I S f a c i l i t y d a t a w i l l be d i s p l a y e d i n n a t u r a l o r d e r .     A l l records f o r a
    s i n g l e f a c i l i t y w i l l t y p i c a l l y be t o g e t h e r i n one b l o c k .

*   Use <Esc> o r <Ctrl-End> t o t o g g l e between T R I S f a c i l i t y d a t a and t h e c o r r -
    e s p o n d i n g WRMS f a c i l i t y d a t a . <Est> w i l l n o t s a v e any changes t o t h e c u r r e n t
    r e c o r d b e f o r e t h e switch; C t r l - E n d w i l l .

*   Look f o r T R I S r e c o r d s w i t h f a c - e r r o r = T ( t r u e ) . The e r r f i e l d column shows
    which f i e l d d o e s n o t match: A = a d d r e s s , C = c i t y , E = EPA i d , F = f a c name,
    N = NPDES i d , T = T R I i d .

*   Change f a c-e r r o r t o F ( f a l s e ) f o r o b v i o u s t y p o s .

*   If t h e e r r o r a p p e a r s n o t t o b e a t y p o and t h e f a c i l i t y match a p p e a r s c o r r e c t ,
    u p d a t e t h e WRMS f a c i l i t y d a t a t o c o r r e s p o n d w i t h t h e T R I S d a t a f o r EPA and
    NPDES i d s , b u t i n g e n e r a l , do n o t u p d a t e w i t h v a r i a n t s of t h e T R I i d .
    Change f a c-e r r o r t o F .
                                                                                                                           ...
                                                             P r e s s any k e y t o c o n t i n u e i n s t r u c t i o n s




Page C-32                                                                                                            TFAC3. MSG
           W R M S       D A T A       B A S E        C O N V E R S I O N             U T I L I T Y


I n s t r u c t i o n s f o r manual c h e c k of f a c i l i t y matching ( c o n t i n u e d ) :

*   If t h e f a c i l i t y match a p p e a r s i n c o r r e c t ,   check t h e W M f a c i l i t y d a t a f o r a
                                                                                    R S
    c o r r e c t match.

    -   I f a m a t c h i s found, r e p l a c e t h e i n c o r r e c t f a c i d i n t h e T R I S f i l e w i t h t h e
                                                 -
        c o r r e c t one and change f a c e r r o r t o F ( f a l s e ) Tor a l l T R I S r e c o r d s f o r t h a t
        facility    .
    -   If no match i s found, a s s i g n a new f a c i d and e n t e r it i n a l l T R I S r e c o r d s
        f o r the f a c i l i t y . Leave f a c e r r o r T (Frue) f o r ONE T R I S r e c o r d o n l y and
        change fac e r r o r t o F f o r t h e r e m a i n i n g T R I S r e c o r d s f o r t h a t f a c i l i t y .
        CONVERT w i i l a u t o m a t i c a l l y create a new WRMS f a c i l i t y r e c o r d .

*   Press <F10> t h e n <Esc> o r <Ctrl-End> t o q u i t . <Esc> q u i t s w i t h o u t s a v i n g
    changes t o t h e c u r r e n t r e c o r d ; <Ctrl-End> q u i t s and s a v e s changes t o t h e
    current record.



                                                                                Press any key t o c o n t i n u e    . ..




TFAC4.MSG                                                                                                       Page C-33
.................................................................................
*                                                                                                                                         *
* F i l e n a m e : TCHEM.PRG                                                                                                             *
* Author:           A n n e E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                                  *
* C r e a t e d : 10/9/90 L a s t u p d a t e d : 7 / 1 5 / 9 2                                                                           *
* C a l l e d by:CONVERT                                                                                                                  *
* Comments: T R I S c h e m i c a l m a t c h i n g r o u t i n e . The T R I S Chemical Matching i s                                     *
*                   d i v i d e d i n t o two s e c t i o n s l i s t e d below.       The p r o c e d u r e name f o r                   *
*                   e a c h s e c t i o n i s shown a t t h e e n d of t h e d e s c r i p t i o n .                                      *
*                                                                                                                                         *
*                       A u t o m a t i c c h e m i c a l m a t c h i n g : computer m a t c h e s c h e m i c a l s b a s e d            *
*                           on CAS number and c h e m i c a l name. (AUTO)                                                                *
*                                                                                                                                         *
*                       I n t e r a c t i v e m a t c h i n g of unmatched c h e m i c a l s : t h e u s e r a s s i g n s                *
*                           c h e m i c a l IDS t o any unmatched c h e m i c a l s , and marks any new                                   *
*                           c h e m i c a l s t h a t need t o be added t o t h e Chemical f i l e .                   The                *
*                           computer creates a new Chemical r e c o r d f o r any marked new                                              *
*                           chemicals. T h i s s e c t i o n i s f r e q u e n t l y u n n e c e s s a r y . (MIS)                        *
*                                                                                                                                         *
*                       The u s e r c a n q u i t and resume l a t e r a f t e r any of t h e s e sections                                *
*                       or during t h e i n t e r a c t i v e section.                                                                    *
*                                                                                                                                         *
...............................................................................
*   I n i t i a l i z e variables

n e x t i d = "I'                     &&    n e x t a v a i l a b l e c h e m i c a l I D s e r i a l number
m-c o K t i n u e = "Y"               &&    d o e s u s e r want t o c o n t i n u e

*   The s t a t u s v a r i a b l e 1 c a u t o i n d i c a t e s w h e t h e r t h e u s e r h a s c o m p l e t e d a u t o
*   chemical matching.              IT i n t e r a c t i v e c h e c k i n g o f unmatched c h e m i c a l s i s done,
*                                                                                                                  -
    t h e whole c h e m i c a l m a t c h i n g p r o c e s s i s c o m p l e t e , as i n d i c a t e d by 1 chm-done.

*   C o n t i n u e t o a l t e r n a t e a u t o c h e m i c a l m a t c h i n g and i n t e r a c t i v e m a t c h i n g , u n t i l
*   u s e r a s k s t o q u i t o r chemical matching i s complete.

DO WHILE . N O T .        1 chm-done
                           -
*   I f t h e a u t o c h e m i c a l match h a s n o t been done,                 do i t .

    I F .NOT.       1 cauto
                     -
       DO a u t o

*   Auto c h e m i c a l match h a s j u s t been c o m p l e t e d .                I f chemical matching i s not
*   c o m p l e t e ( b e c a u s e t h e r e a r e unmatched c h e m i c a l s l e f t ) see i f t h e u s e r wants
*   t o q u i t and resume l a t e r ( i f t h e y do, t h e ASK QUIT p r o c e d u r e w i l l r e t u r n
*   c o n t r o l t o CONVERT).             I f c h e m i c a l m a t c h i n g i s d o n e , r e t u r n c o n t r o l t o CONVERT.

       I F . N O T . 1 chm-done
          DO a s k-@it
       ELSE
          EXIT
       ENDIF

    ENDIF

*   Auto c h e m i c a l match i s COT            ? t e , e i t h e r b e c a u s e i t was j u s t done and t h e u s e r
*   d i d n o t q u i t , o r b e c a u s e i t was done e a r l i e r and t h e u s e r h a s resumed.
*   However, t h e r e a r e unmatched c h e m i c a l s ( o r t h e whole c h e m i c a l m a t c h i n g
*   process would be done a n d t h e program would n o t have r e a c h e d t h i s p o i n t ) ,
*   s o c a l l p r o c e d u r e t o l e t u s e r check unmatched c h e m i c a l s .


Page C-34                                                                                                                     TCHEM. PRG
@   1,O CLEAR
@   8,12 TO 15,66
@ 10,14 SAY "Press Y to continue chemical matching,"
@ 11,14 SAY "Press N to exit and resume chemical matching later."
@ 13,32 SAY "Continue? Y/N:"
@ 13,47 GET m-continue PICTURE "Y"
READ
* If the user does want to quit, return control to CONVERT.
IF m-continue = "N"
  RETURN TO MASTER
ENDIF
RETURN   &&   ask-quit
...............................................................................
PROCEDURE auto
* Initialize variables.
match = 0                  &&   Count number of TRIS records matched
no-match = 0
processed   0 -            &&
                           &&
                                Count number of TRIS records not matched
                                Count number of TRIS records processed
* Open working Submission file and       WRMS Chemical file.    Files are unlinked.
USE tris\submext IN 1 ALIAS sub
USE chemical IN 2 ALIAS chem
SELECT sub
* Determine total number of TRIS records to process.
total-recs = reccount ("sub")
*   Display matching status report on screen
DO report
* Main loop; processes each record in working Submission file
SCAN
  processed = recno ("sub")                  &&   Set number of records processed
  SELECT chem
* Look for matching CAS number in       WRMS Chemical file
    SET ORDER TO cas nun
    SEEK sub->cas-num


TCHEM.PRG                                                                           Page C-35
* If a nonblank match is found, increment match counter and copy chemical     ID
* to working Submission file.
    IF  found0 .AND. sub->cas-num <> space(l1)
       match = match + 1
                                           -
       REPLACE sub->them-id WITH chem->chem id
    ELSE

*   N o CAS number match found, look f o r matching chemical name in WRMS Chemical
*   file.
       SET ORDER TO use-name
       SEEK sub->chem name
                     -
* If a match is found, increment match counter and copy chemical     I D to working
* Submission file.
       I F found0

           match   5   match     +   1
           REPLACE sub->chem-id WITH chem->chem-id

      ELSE

* N o match found; increment no match counter and set unmatched flag in working
* Submission file.
           no match = no-match + 1
           REFLACE sub->chem-mis WITH . T .

      ENDIF

    ENDIF

* Update matching status report on screen
    DO s a y s
*   Select working file for correct functioning of SCAN loop.
    SELECT sub

ENDSCAN

*   Write final chemical matching status report to file and screen
S E T DEVICE TO F I L E tris\tchmauto.txt
DO report
S E T DEVICE TO SCREEN
DO report

* Update status variables
1 cat0 = .T.
 -

* If no chemicals were left unmatched, chemical matching is complete; set
* 1-chm-done accordingly.
I F no match =         0
    1 cih-done     =       .T.
ENDTF


Page C-36                                                                    TCHEM.PRG
@ 22,19 S Y "Auto Chemical Match Complete.
         A                                                                P r e s s any key t o c o n t i n u e     ..."
WAIT     ""


CLOSE ALL
RETURN & & a u t o
...............................................................................
PROCEDURE r e p o r t

*   D i s p a l y s s t a t i c p o r t i o n s o f c h e m i c a l m a t c h i n g s t a t u s r e p o r t o n screen.

    @   1,0 CLEAR
    @             A
        4,26 S Y "TRIS DATA CONVERSION"
    @             A
        5 , 2 1 S Y "CHEMICAL MATCHING STATUS REPORT"
    @   8 , 2 2 S Y "Number o f r e c o r d s processed:"
                  A
    @   8,52 S Y processed PICTURE "99999"
                  A
    @   8,58 S Y "of"
                  A
    @   8,61 SAY t o t a l recs PICTURE "99999"
    @   1 0 , 2 4 S Y "Number of records matched:"
                   A
    @   10,52 SAY match PICTURE "99999"
    @              A
        1 2 , 2 0 S Y "Number of r e c o r d s n o t matched:"
    @              A
        12,52 S Y n o-match PICTURE "99999"

RETURN & & r e p o r t
...............................................................................
PROCEDURE s a y s

*   D i s p l a y s dynamic p o r t i o n of c h e m i c a l m a t c h i n g s t a t u s r e p o r t    (counter
*   variables)

    @ 8 , 5 2 S Y processed PICTURE "99999"
                A
    @ 10,52 S Y match P I C T U R E "99999"
                 A
    @ 1 2 ' 5 2 S Y no-
                 A     match PICTURE "99999"

RETURN & & s a y s
...............................................................................
PROCEDURE m i s

*   U s e r c h e c k s unmatched c h e m i c a l s and e i t h e r a s s i g n s a c o r r e c t c h e m i c a l I D
*   f r o m a p r i n t e d l i s t or marks t h e c h e m i c a l f o r a d d i t i o n t o t h e WRMS Chemical
*   f i l e . The computer makes any n e c e s s a r y a d d i t i o n s t o t h e Chemical f i l e .
*   I n i t i a l i z e variable

m-chem-id        =   'I"             &&   s t o r e s newly c o n s t r u c t e d c h e m i c a l IDS
*   Open working Submission f i l e . The I n d e x i s c o n d i t i o n a l on t h e unmatched
*   f l a g b e i n g t r u e , s o o n l y unmatched c h e m i c a l s a r e shown.

USE submext I N 1 ORDER chm-name-c ALIAS s u b

*   D i s p l a y i n s t r u c t i o n s f o r r e s o l v i n g unmatched c h e m i c a l s .

CLEAR
TYPE t r i s \ t c h e m l . m s g
WAIT " "




TCHEM. PRG                                                                                                                Page C-37
*   BROWSE t h e unmatched c h e m i c a l s ; t h e u s e r i s n o t a l l o w e d t o add r e c o r d s .
*   The u s e r w i l l change t h e unmatched f l a g t o F a l s e a s e a c h c h e m i c a l i s
*   r e s o l v e d ( e i t h e r by a s s i g n i n g a c h e m i c a l I D or m a r k i n g it f o r a d d i t i o n t o
*   t h e Chemical f i l e ) . Changing t h e unmatched f l a g t o False removes a r e c o r d
*   from t h e c o n d i t i o n a l i n d e x .      When a l l r e c o r d s have been removed f r o m t h e
*   i n d e x i n t h i s way, a n e r r o r c o n d i t i o n r e s u l t s ; t h e ON ERROR CLEAR l i n e
*   c l e a r s t h e s c r e e n when t h i s happens, e f f e c t i v e l y e n d i n g t h e BROWSE.              The
*   u s e r may a l s o e x i t t h e Browse w i t h ESC or Ctrl-End b e f o r e a l l unmatched
*   c h e m i c a l s h a v e been d e a l t w i t h .

ON ERROR CLEAR
                 O O L W FIELDS chem-m i s ,
BROWSE NOAPPEND N F L O                                             chem-i d , cas-num         / r r chem-name / r
ON ERROR

*   R e s t o r e h e a d e r wiped o u t by BROWSE.

CLEAR
@0,6SAY"WRMS                     D A T A       B A S E       C O N V E R S I O N               U T I L I T Y "

*   Copy marked c h e m i c a l s t o WRMS c h e m i c a l f i l e

@ 11,22 SAY "Updating WRMS c h e m i c a l f i l e                 .. . "
*   R e t u r n working f i l e t o n a t u r a l o r d e r and open Chemical f i l e .

SET ORDER TO
                                          -
USE c h e m i c a l I N 2 ORDER i d num ALIAS chem

*   Determine n e x t a v a i l a b l e c h e m i c a l I D s e r i a l number

SELECT chem
GO BOTTOM
n e x t i d = r i g h t (chem-id, 5 )
            -
DO fTnd n e x t                       & & r e t u r n s n e x t s e r i a l number as a s t r i n g i n NEXT-ID

SELECT s u b

*   P r o c e s s e s marked r e c o r d s i n t h e w o r k i n g f i l e ( t h e d e l e t i o n m a r k e r i s u s e d t o
*   mark c h e m i c a l s f o r a d d i t i o n t o t h e Chemical f i l e ) .

SCAN FOR d e l e t e d 0

*   Construct a chemical I D f o r t h e c u r r e n t record.
*   The p r e f i x C i n t h e c h e m i c a l I D i n d i c a t e s t h e p o l l u t a n t i s a c h e m i c a l .
*   The r e s t of t h e c h e m c i a l I D i s made up of t h e f i r s t f o u r s o r t i n g c h a r a c t e r s
*   o f t h e c h e m i c a l name p l u s a s e r i a l number.

    m-chem-id       = "C"    +   f i n d-id(sub->chem-name)            +    next-id

*   Add a b l a n k r e c o r d t o t h e Chemical f i l e and copy t h e new c h e m i c a l I D ,                 the
*   c h e m i c a l name, and t h e CAS number t o i t .

    SELECT chem
    APPEND BLANK
    REPLACE chem i d WITH m chem i d , chem-name W I T H                       sub->them-name,;
            cas-num W I T H s<b->cas-num
*   Remove d e l e t i o n m a r k e r from working f i l e r e c o r d .

    SELECT s u b
    RECALL




Page C-38                                                                                                            TCHEM. PRG
*   E n t e r new c h e m i c a l I D i n working f i l e .

    REPLACE chem i d WITH                m-chem i d
    DO f i n d-next-                            & & - r e t u r n s n e x t s e r i a l number as a s t r i n g i n NEXT-ID

ENDSCAN

@ 11,54 SAY "Done"

*   S e e if any unmatched c h e m i c a l s r e m a i n ( u s e r may have e x i t e d before a l l were
*   matched).

LOCATE F R chem-i d = s p a c e ( 5 )
        O

*   I f unmatched c h e m i c a l s a r e s t i l l found, reset a u t o match s t a t u s v a r i a b l e t o
*   F a l s e ; a u t o match w i l l t h e n run a g a i n ( w i t h a n y a d d i t i o n s t o Chemical f i l e
*   made a b o v e ) . The u s e r w i l l b e g i v e n t h e o p p o r t u n i t y t o q u i t a f t e r a u t o match
*   h a s run a g a i n .

IF found0
   -
  1 cauto = .F.

ELSE

*   I f no unmatched c h e m i c a l s are found, t h e n c h e m i c a l matching is done.

    1-chm -done = . T .

ENDIF

CLOSE ALL
RETURN & & m i s
...............................................................................
PROCEDURE f i n d-n e x t

*   I n c r e m e n t n e x t -i d v a r i a b l e
next i d = s t r ( V a l (next-id)              + 1,5)
DO WHILE '' " $ n e x t i d



RETURN      &&           -
                  f i n d next
...............................................................................
FUNCTION f i n d-i d

*   C r e a t e s t h e f o u r l e t t e r c h e m i c a l I D p r e f i x from t h e c h e m i c a l name.       The
*   p r e f i x i s t h e f i r s t f o u r "good" c h a r a c t e r s of t h e c h e m i c a l name (numbers,
*   p u n c t u a t i o n , and p r e f i x e s n o t c o n t r i b u t i n g t o t h e s o r t o r d e r , such a s alpha-,
*   a r e e x c l u d e d ) . Accepts t h e c h e m i c a l name a s a p a r a m e t e r from t h e c a l l i n g
*   program, and r e t u r n s a f o u r c h a r a c t e r s t r i n g .

PARAMETERS name
i d code = '"'
DO-WHILE l e n ( i d c o d e ) < 4
  IF i s u p p e r (name)
                          -
    i d code = i d code + l e f t ( n a m e , l )
    ENDIF

TCHEM. PRG                                                                                                         Page C-39
    IF len(trim(name)) > 1
     name = substr(name,2)
    ELSE
     id code = left(id-code      +   -
                                     I
                                     ‘   “r4)
    EXTT
 ENDIF
ENDDO
            -
RETURN(id code)       &&   find-id

*    EOF: tchem.prg




                                                 ~




Page C-40                                       TCHEM. PR
         W R M S        D A T A       B A S E        C O N V E R S I O N                U T I L I T Y


D i r e c t i o n s f o r r e s o l u t i o n o f unmatched c h e m i c a l d a t a :
*   Unmatched TRIS r e c o r d s w i l l b e d i s p l a y e d , i n d e x e d on chem-name.

*   You w i l l o n l y be able t o e d i t t h e chem-id             and chem-mis         fields.

*   Look up t h e correct chem i d i n t h e a l p h a b e t i c a l l i s t i n g o f t h e WRMS
    c h e m i c a l f i l e and e n t e r T t i n t h e chem-id f i e l d . Change t h e chem- i s
                                                                                                m
    field t o F (False).

*   I f a c h e m i c a l needs t o be added t o t h e WRMS c h e m i c a l f i l e , change chem mis
    t o F f o r ALL records c o n t a i n i n g t h a t chemical, and m a r k ONE r e c o r d conFaining
    t h e chemical u s i n g < C t r l - U > .    T h e program w i l l c r e a t e t h e a p p r o p r i a t e WRMS
    chemical r e c o r d a u t o m a t i c a l l y .

*   Press <Ctrl-End> when f i n i s h e d .


                                                                                Press any key t o c o n t i n u e   ...




TCHEM1.MSG                                                                                                    Page C-41
...............................................................................
*                                                                                                                          *
* Filename: TEMISS.PRG                                                                                                     *
* Author: Anne E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                                *
* Created: 8/15/90 L a s t updated: 7/30/92                                                                                *
* C a l l e d by:CONVERT                                                                                                   *
* Comments: C o n v e r t s e m i s s i o n s d a t a from T R I S t o WRMS f o r m a t . Assumes a l l                    *
*                 f a c i l i t i e s and c h e m i c a l s have been c o r r e c t l y matched. Creates                   *
*                 1 S t a t u s and 1 Emission r e c o r d from 1 working Submission r e c o r d                           *
*                 and 1 o r more working R e l e a s e r e c o r d s .                                                     *
*                                                                                                                          *
...............................................................................
*   I n i t i a l i z e variables

s u b rec = 0                      & & Count number of Submission r e c o r d s p r o c e s s e d
r e l- e c = 0
      r                            & & Count number of Release r e c o r d s p r o c e s s e d

*   Open d a t a base f i l e s : WRMS S t a t u s and Emission f i l e s and working Submission
*   and R e l e a s e f i l e s . F i l e s are u n l i n k e d . Working Submission f i l e i s s e l e c t e d .

USE s t a t u s I N 1 ALIAS s t a t ORDER f a c i d-y r
USE e m i s s i o n I N 2 A L I A S e m
USE t r i s \ s u b m e x t I N 3 A L I A S s u b
USE t r i s \ r e l e x t I N 4 ALIAS re1 ORDER doc-c n t l
SELECT s u b

*   D i s p l a y e m i s s i o n c o n v e r s i o n s t a t u s r e p o r t on screen

DO r e p o r t
@ 9,55 SAY s u b rec P I C T U R E "99999"
@ 10,55 SAY r e i-r e c PICTURE "99999"

*   Process a l l r e c o r d s i n Submission f i l e

SCAN

*   Reset status report variables

*   Number of Release r e c o r d s c o n s o l i d a t e d (by r e l e a s e media) for t h i s Submission

    STORE 0 TO f u g i t add, -         s t a c k -add, water-add, l a n d-add, potw-add, o f f -add

*   T o t a l amount of r e l e a s e t o w a t e r , l a n d , potw, and o f f - s i t e ( a i r i s n o t
*   i n c l u d e d b e c a u s e t h e r e i s n e v e r more t h a n one r e c o r d t o c o n s o l i d a t e and
*   release amount can be t a k e n d i r e c t l y from Release f i l e ) .

    STORE 0 TO water r e l , -          l a n d-r e l , potw-r e l , o f f -r e 1

*   Maximum o f amounts a s s o c i a t e d w i t h each b a s i s code f o r water, l a n d , potw, and
*   off-site.         T h i s i s u s e d t o d e t e r m i n e what b a s i s t o a s s i g n a c o n s o l i d a t e d
*   release amount. A i r i s n o t i n c l u d e d b e c a u s e t h e r e i s n e v e r more t h a n one
*   r e c o r d t o c o n s o l i d a t e and t h e r e f o r e o n l y one b a s i s .

                       -
    STORE 0 TO w max b a s , -          1-max-bas,       p-max-bas,        o-max-bas

*   Amounts a s s o c i a t e d w i t h e a c h b a s i s code (measured, c a l c u l a t e d ,           estimated, o r
*   o t h e r ) f o r w a t e r , l a n d , potw, and o f f - s i t e .     These a r e u s e d t o       determine
*   what b a s i s t o a s s i g n a c o n s o l i d a t e d r e l e a s e amount. A i r i s n o t        included
*   b e c a u s e t h e r e i s n e v e r m o r e t h a n one r e c o r d t o c o n s o l i d a t e and   therefore
*   o n l y one b a s i s .




Page C-42                                                                                                         TEMISS.PRG
    STORE 0 TO        w b a s i s m, w-basis c, w basis-e, w-basis-o,                         w-no-basis
    STORE 0 TO                        -
                      1-basism, 1 b a s i s c , 1-b a s i s e, 1 basis-o,
                                                 -                                            1 no-basis
    STORE 0 TO        p-basis-m,        p-basis-c,        p-basisIe,        pIbasis-o,        pxno-basis
    STORE 0 TO                 -
                      oIbasis-m,         -
                                        o b a s i s I c , o-basis-e,        o-basis-o,        o-no-basis
*   I n d i c a t e s whether a c o n s o l i d a t e d amount i s b a s e d on any v a l u e s t h a t were
*   d e r i v e d from a r a n g e , f o r l a n d , water, potw, and o f f - s i t e .           A i r i s not
*   i n c l u d e d b e c a u s e t h e s e r i s n e v e r more t h a n one r e c o r d t o c o n s o l i d a t e and
*   t h e r e f o r e , t h e r a n g e code can b e t a k e n d i r e c t l y from t h e Release f i l e .

    STORE . F . TO l a n d-r a n g e ,        w a t r-r a n g e , potw-range,       o f f -range
*   I n d i c a t e s whether a new s t a t u s r e c o r d was c r e a t e d f o r a Submission r e c o r d .

    STORE     .F. TO new-s t a t u s
*   See if a S t a t u s r e c o r d e x i s t s f o r t h e f a c i l i t y f o r t h e r e p o r t i n g y e a r b e i n g
*   converted.

    SELECT s t a t
    SEEK sub->fac        -i d +    sub->rpt-year
*   If no S t a t u s r e c o r d i s found, c r e a t e one and f i l l i t i n from t h e Submission
*   record.

    I F .NOT. f o u n d ( )
       APPEND BLANK
       REPLACE s t a t - > f a c i d WITH sub->fac-id,;
                   stat->yea? WITH val(sub->rpt-year)
       new s t a t u s = . T .
    ENDIF-
*   Add a b l a n k r e c o r d t o Emission and fill i n d a t a from Submission f i l e

    SELECT e m
    APPEND BLANK
    REPLACE em->source WITH "T", ;
             em->source i d WITH sub->doc-cntl,;
             em->fac id-WITH sub->fat-id,;
             em->chem i d W I T H sub->them-id,;
             em->year-WITH v a l ( s u b - > r p t y e a r ) , ;
             em->curr amt W I T H val(sub-%ur-yr                   qty),;
             em->prevzamt W I T H v a l ( s u b - > p r i - y r I q t y ) , ;
             e m - > p c t change WITH val(sub->pet-change),;
             em->wasFe min WITH sub->min-code,;
             em->min-reason WITH sub->min a c t i o n , ;
                              -
             em->prod ndx WITH v a l ( s u b - > n h - i n d e x )
*   F i n d r e c o r d s i n Release f i l e c o r r e s p o n d i n g t o Submission r e c o r d .

    SELECT re1
    SEEK sub->doc -c n t l
*   P r o c e s s a l l R e l e a s e r e c o r d s c o r r e s p o n d i n g t o c u r r e n t Submission r e c o r d

    SCAN WHILE r e l - > d o c     -c n t l   = sub->doc-cntl

       re1-rec = re1-rec            +   1          &&   Increment number of release r e c o r d s p r o c e s s e d
*   Copy r e l e a s e amount, release b a s i s , and release r a n g e f l a g t o a p p r o p r i a t e
*   f i e l d s i n Emission b a s e d on release medium i n Release f i l e , and increment
*   a p p r o p r i a t e media c o u n t e r .


TEMISS.PRG                                                                                                               Page C-43
      DO CASE
*   Fugitive air
         CASE re1 medium
           REPLACE
                          -"1"
                   em->fugit amt WITH val (release),;
                   em->fugit-bas WITH basis code,;
                   em->fugitIrnge WITH range
           fugit-add = fugit-add + 1
*   Stack air
         CASE re1 medium = "2"
           REPLACE em->stack amt WITH val(release),;
                   em->stack-bas WITH basis code,;
                   em->stackIrnge WITH range
           stack-add = stack-add + 1
*   For water, land, potw, and off-site, multiple records may have to be
*   consolidated, so increment appropriate variables instead of copying data to
*   Emission file. Consolidated data will be copied to Emission file after all
*   Release records for the Submission have been processed.
*   Water
        CASE rel-medium = "3"
          water-re1 = water-re1 + val (release)
          watr range = watr-range .OR. range
          DO CKSE
            CASE upper(basis code) = "M"
              w basis m = w gasis-m + val(re1ease)
                                       I"
            CASE upper(basiz-code) = ' C
              w basis c = w-basis-c + val(re1ease)
            CASE upper(basis code) = "E"
              w-basis-e = w-gasis-e + val(re1ease)
            CASE upper (basis-code) = "0"
              w basis o = w- basis-o + val(re1ease)
              OTHERWISE-
                w no-basis = w-no-basis   + val(re1ease)
            ENDCA~E
            water-add = water-add + 1
*   Copy stream name to Status for first water Release record found for a
*   facility.
            IF water add = 1 .AND. new status
                                                    -
                REPLXCE stat->receiv-hZo WITH stream nam
            ENDIF
* Land
       CASE re1 medium = "5"
         land-re1 = land-re1 + val(re1ease)
         land range = land-range .OR. range
         DO CZSE
           CASE upper(basis code) = "M"
             1 basis m = 1 Easis-m + val(re1ease)
           CASE uppeT(basiF-code) = "C"
             1 basis c = 1 basis-c + val(rel'ease)
           CASE uppeT(basis code) = "E"
             1 basis e = 1-Easis-e + val(re1ease)
           CASE upper(basis-code) = "0"


Page C-44                                                                   TEMISS.PRG
                       1 b a s i s o = 1 b a s i s -o
                                        -                   +   val(re1ease)
                 OTHERWISE-
                     1-no-basis    = 1-no-basis                 +   val(re1ease)
              ENDCASE
                   ~       ~~




              l a n d add = l a n d add + 1
                       -                     -
*   POTW

           CASE re1 medium = "6"
             potw       re1= potw re1 + v a l ( r e 1 e a s e )
             potwzrange = poFw -range .OR. r a n g e
             DO CASE
                CASE u p p e r ( b a s i s code) = "M"
                  p-basis m = p E a s i s m + v a l ( r e 1 e a s e )
                CASE u p p e r ( b a s i s code7 = "C"
                  p-basis c = p Easis c + val(re1ease)
                CASE u p p e r ( b a s i s c o d e i = "E"
                  p-basis e = p-Easis-e               + val(re1ease)
                CASE u p p e r ( b a s i s c o d e ) = "0"
                  p-basis o = p-Sasis-o                + val(re1ease)
                OTHERWISE-
                  P-nO- b a s i s = p n o b a s i s + v a l ( r e 1 e a s e )
                                                  - -
             ENDCASE
             potw add = potw add + 1
             I F pztw add = l-.AND. new s t a t u s
                  R E P ~ A C E s t a t - > p o t w WITHt r a n s -s i t e
             ENDIF

*   Off-site

           CASE r e 1 medium = "I"
             off r e i = off re1 + val(re1ease)
             o f f - r a n g e = o?f-range           .OR. r a n g e
             DO CASE
                 CASE u p p e r ( b a s i s c o d e )
                      o basis m = o gasis m + val(re1ease)
                                                           -
                                                          "M"
                 CASE u p p e r ( b a s i s c o d e r = "C"
                      o b a s i s c = o-Easis-c          + val(re1ease)
                 CASE u p p e r ( b a s i s - c o d e ) = "E"
                      o b a s i s e = o-basis e + v a l ( r e 1 e a s e )
                 CASE u p p e r ( b a s i s _ c o d e i = "0"
                      o-basis o = o-basis-o              + val(re1ease)
                 OTHERWISE-
                      o no b a s i s = o-no-basis + v a l ( r e 1 e a s e )
                  -
             ENDCASE
              off-add           =        -
                                      o f f add   +   1

       ENDCASE

    Update e m i s s i o n c o n v e r s i o n s t a t u s r e p o r t

       @ 10,55 SAY r e 1-r e c PICTURE "99999"

    ENDSCAN                       &&    Loop t o n e x t R e l e a s e r e c o r d f o r c u r r e n t Submission r e c o r d

    F o r w a t e r , l a n d , potw, and o f f - s i t e , d e t e r m i n e t h e c o n s o l i d a t e d b a s i s . This
    i s t h e b a s i s a s s o c i a t e d w i t h t h e l a r g e s t p o r t i o n of t h e t o t a l amount r e l e a s e d .
    Copy c o n s o l i d a t e d d a t a t o E m i s s i o n f i l e .

    Water

    I F w a t e r -re1          > 0


TEMISS.PRG                                                                                                            Page C-45
     w-max-bas =
max (max(max(max(w basis-m, w-basis-c) ,w-basis-e) ,w-basis-o), w-no-basis)
     REPLACE em->water-amt WITH water-rel, em->water-rnqe WITH watr-range
      DO CASE
        CASE w max-bas = w basis-m
          REPLfiCE em->water bas WITH    "M"
        CASE w max-bas = w-jsasis-c
          REPLZiCE em->water bas WITH    "C"
        CASE w max bas = w sasis-e
          REPLZiCE e">wateF-bas WITH     "E"
        CASE w max-bas = w basis-o
          REPLZCE em->water bas WITH     "0"
        CASE w-max-bas = w 60-basis
          REPLACE em->wateT-bas WITH     "I'

      ENDCASE
    ENDIF

*   Land
               > 0
    I F land re1
     1 max-bas =
max (max(max(max(1 basis- m -1 basis c) ,l-basis e),1-basis-o) ,l-no-basis)
                          1
     REPLACE em->land-amt WITH l a d-rel, em->iand-rnge WITH land-range
      DO CASE
        CASE 1 max-bas = 1 basis m
          REPLfiCE em->land-bas WITH    "M"
        CASE 1 max bas = 1-basis c
          REPLACE e">land-bas WITH      'IC"
        CASE 1 max bas = 1-basis e
          REPLfiCE e">land-bas  WITH    "E"
        CASE 1 max-bas = 1-basis o
          REPLZiCE em->land-bas WYTH    "0"
        CASE 1 max bas = 1-no basis
                           -
          REPLfiCE e">land-bas WITH     '"'
      ENDCASE
    ENDIF

*   POTW

I F potw re1 > 0
   -p-max-bas =
max (max(max(max(p-basis-m,p-basis-c) ,p-basis-e! lp-basis-o) ,p-no basis)
     REPLACE em->potw-amt WITH potw-rel, em->potw-rnqe WITH potwIrange
      DO CASE
        CASE p max bas = p basis m
          REPLXCE e">potw-bas   WITH "M"
        CASE p max bas = p-basis-c
          REPLACE e">potw-bas   WITH "C"
        CASE p max-bas = p-basis e
           REPLACE em->potw-bas WTTH"E"
        CASE p max-bas = p-basis o
          REPLACE em->potw-bas WITH "0"
        CASE p max bas = p-no-basis
                          -
          REPLZiCE e">potwbas WITH " "
      ENDCASE
    ENDIF

* Off-site
I F off re1 > 0
      -a-a
     o:xbs     =
max (max(max(max (0 basis- o-basis -c),o-basis-e)
                  -       m,                        ,o-basis-o) ,o-no-basis)

Page C-46                                                                      TEMISS.PRG
      REPLACE em->off-amt WITH off-rel, em->off-rnge WITH off-range
      DO CASE
        CASE o-max-bas = o basis-m
          REPLACE em->off Eas WITH "M"
        CASE o-max-bas = E-basis-c
                       -
          REPLACE em->off -
        CASE o max bas
                             bas WITH "C"
                            o basis e
          REPL~CEe " > o f f a s WITH"E"
                            -
        CASE o max bas = o basis-o
          REPL~~CEe">off 5as WITH "0"
        CASE o-max-bas = o-no-basis
          REPLACE em->off-bas WITH " "
      ENDCASE
    ENDIF
*   Update emission conversion status report
    @ 9,55 SAY recno("sub") PICTURE "99999"

*   Select Submission file for correct functioning of SCAN
    SELECT sub
ENDSCAN                LL   Loop to next Submission record

*   All Submission records (and their corresponding Release records) have been
*   processed. Update status varibale to indicate emission conversion is complete.
1 emiss = .T.
 -

CLOSE ALL
* Delete working files
@ 1,0 CLEAR
@ 9,12 SAY "Deleting working files     ...
DELETE   FILE tris\submext.dbf         &L    working Submission file
DELETE   FILE tris\submext.mdx         &&    working Submission file index
DELETE   FILE tris\relext.dbf          L&    working Release file
DELETE   FILE tris\relext.mdx          LL    working Release file index
DELETE   FILE tris\tstatus.mem         &&    Saved status variables
DELETE   FILE tris\tfacauto.txt        LL    Final facility matching status report
DELETE   FILE tris\tchmauto.txt        &&    Final chemical matching status report
@ 9,39   SAY "Done"
*   Display message that data conversion is complete.
@ 1,0 CLEAR
@ 9,25 TO 13,53 DOUBLE
@ 11,27 SAY "Data conversion complete."
@ 22,50 SAY "Press any key to continue . .
WAIT " "
                                               ."


PROCEDURE report
* Display static protions of emissions conversion status report

TEMISS.PRG                                                                    Page C-47
@ 1,0 CLEAR
@ 4,26 SAY "TRIS DATA CONVERSION"
@ 5,16 SAY "EMISSION AND STATUS UPDATE STATUS REPORT"
@ 9,15 SAY "Number of submission records processed:"
@ 10,15 SAY "Number of release records processed: "
RETURN & & report

*   EOF: temiss.prg




Page C-48                                               TEMISS.PRG
................................................................................
*                                                                                                       *
* Filename: SWORKING.PRG                                                                                *
* Author: Anne E. Crook, Research T r i a n g l e I n s t i t u t e                                     *
* Created: 1 / 8 / 9 1 L a s t u p d a t e d : 1/29/92                                                  *
* C a l l e d by:CONVERT                                                                                *
* Comments: Creates working S t a t e Annual R e p o r t f i l e s f o r c o n v e r s i o n program, *
*                 w i t h s t r u c t u r e extended t o i n c l u d e f i e l d s used i n processing. *
*                 Also c l e a n s up some f i e l d s .                                                *
*                                                                                                       *
................................................................................
*   I n i t i a l i z e status variables.     These v a r i a b l e s i n d i c a t e which steps o f t h e
*   c o n v e r s i o n process have b e e n completed.

1-fac-done  = .F.                     &&   F a c i l i t y matching done
1 chm done = .F          .            LL   Chemical matching done
lIemiZs = . F .                       LL   E m i s s i o n s c o n v e r s i o n done

*   I n i t i a l i z e other variables.

myear = space ( 2 )                   LL   Year t o be c o n v e r t e d
u n s o r t e d = I"'                 L&   U n s o r t e d waste code s t r i n g
sorted      E   ""                    LL   S o r t e d waste code s t r i n g
f i r s t = 1111                      LL   F i r s t waste code
second = ""                           LL   Second waste code
third = ~ 1 1                         &&   T h i r d waste code
f o u r t h = '"'                     &&   F o u r t h waste code

*   Ask f o r y e a r b e i n g c o n v e r t e d .
@ 1 , 0 CLEAR
SET CONFIRM ON
@ 9 , 2 0 S Y " E n t e r y e a r o f d a t a b e i n g c o n v e r t e d : 19"
           A
@ 9,58 GET myear PICTURE "99"
READ
SET CONFIRM OFF

*   C r e a t e working d a t a f i l e ANREPEXT.DBF from s a v e d s t r u c t u r e ARSTRU.DBF

@ 1 , 0 CLEAR
@ 8 , 2 0 S Y " C r e a t i n g working f i l e
           A                                            .   . . ' I



                                    R M
CREATE s t a t e \ a n r e p e x t F O s t a t e \ a r s t r u

*   Create i n d e x on EPA ID, c o n d i t i o n a l on i t b e i n g n o n s t a n d a r d ( i . e . , nonblank
*   and n o t m a t c h i n g t h e s t a n d a r d f o r m a t of NC f o l l o w e d by numbers). The i n d e x
*   w i l l be u s e d l a t e r i n c l e a n i n g up n o n s t a n d a r d EPA I D S .

                                    - -
I N D E X ON e p a i d TAG epa i d c FOR .NOT.                        like("NC*",epaid)

*   A d d r e c o r d s t h a t are n o t h e a d e r r e c o r d s
                                                             ( h e a d e r r e c o r d s have l i n e no. 0 0 0 0 )
*   and t h a t d o n o t r e f l e c t j u s t storage t o t h e working f i l e from t h e o r i g i n a l
*   data f i l e .

*   SET TALK ON e c h o s t h e number o f records p r o c e s s e d t o t h e s c r e e n s o t h a t t h e
*   u s e r c a n see t h e p r o g r e s s o f t h e r e c o r d s b e i n g added.

SET TALK ON
APPEND F O s t a t e \ a n n r e p FOR l i n e n o <> "0000"
         R M                                                                  .AND.;
   .NOT. ( t r t c o d e = "S" .AND. t o t a l s h i p = 0 )
SET TALK OFF


SWORKING. PRG                                                                                                Page C-49
@ 9,0 CLEAR
CLOSE DATABASE

@ 8 , 4 6 SAY "Done"

*   E n t e r y e a r b e i n g c o n v e r t e d i n working f i l e

USE s t a t e \ a n r e p e x t
@ 11,20 SAY " E n t e r i n g y e a r i n working f i l e                    ...   11


REPLACE ALL y e a r WITH v a l ( " 1 9 " + myear)
@ 11,54 SAY "Done"

*   Convert Annual Report q u a n t i t y b a s i s codes t o WRMS b a s i s codes ( E s t i m a t e d ,
*   C a l c u l a t e d , Measured, O t h e r ) . Annual R e p o r t d a t a u s e f o u r y e s / n o f i e l d s f o r
*   t h e f o u r b a s e s , w h i l e WRMS u s e s a s i n g l e l e t t e r - c o d e d f i e l d .
@ 12,20       SAY " C l e a n i n g up b a s i s c o d e s        .........        $1


REPLACE       b a s i s WITH "0" FOR q t y d = "X"
REPLACE       b a s i s W I T H "M" FOR q t y a = "X"
REPLACE       basis WITH "C" FOR q t y c = "X"
REPLACE       b a s i s W I T H "E" FOR q t y b = "X"
@ 12,54       SAY "Done"

*   C l e a n up of EPA I D i n v o l v e s r e p l a c i n g c a p i t a l 0's             i n t h e EPA I D w i t h
*   zeros.
@ 13,20 SAY " C l e a n i n g up EPA i d                 ..............            ,I




*   S c a n s f o r EPA I D S c o n t a i n i n g c a p i t a l 0

SCAN FOR "0"           $ epaid

*   Repeat t h i s l o o p u n t i l t h e r e are no c a p i t a l 0's                  i n t h e EPA I D

    DO WHILE "0" $ e p a i d
      e p a i d = s t u f f ( e p a i d , a t ("O",epaid) , l , " O " )
    ENDDO

ENDSCAN

@ 13,54 SAY "Done"

*   Annual Report d a t a r e p o r t s up t o f o u r EPA HW c o d e s .                         WRMS can accomodate all
*   f o u r ( c o n c a t e n a t e d t o g e t h e r ) , b u t f o r c h e m i c a l m a t c h i n g p u r p o s e s , t h e y need
*   t o be i n a l p h a b e t i c a l order ( s o t h a t wastes w i t h t h e same c o d e s match
*   r e g a r d l e s s of t h e o r d e r of t h e c o d e s ) . T h i s program segment s o r t s t h e
*   codes f o r a l l records i n t h e working f i l e .
@ 1 4 , 2 0 SAY " S o r t i n g w a s t e codes            ............."
SCAN
  u n s o r t e d = trim(wasteno)+wasteno2+wasteno3+wasteno4
  first = min (min ( l e f t (unsorted, 4 ) , s u b s t r (unsorted, 5,4) ) ;                       ,
                     m i n ( s u b s t r (unsorted, 9,4) , r i g h t (unsorted, 4 ) ) )
  unsorted = s t u f f (unsorted,at (first,unsorted),4,"")
  second = min (min ( l e f t ( u n s o r t e d , 4 ) , s u b s t r ( u n s o r t e d , 5 , d ) ) , r i g h t ( u n s o r t e d , 4 ) )
  u n s o r t e d = s t u f f ( u n s o r t e d , a t ( s e c o n d , u n s o r t e d ) , 4 , "'I)
  t h i r d = min ( l e f t ( u n s o r t e d , 4 ) , r i g h t ( u n s o r t e d , 4 ) )
  f o u r t h = max(1eft (unsorted, 4) , r i g h t (unsorted, 4 ) )
  s o r t e d = ltrim(first+second+third+fourth)
  REPLACE wasteno W I T H s o r t e d
ENDSCAN
@ 14.54 SAY "Done"


Page C-50                                                                                                                   SWORKING.PRG
*   Some EPA I D S may s t i l l be n o n s t a n d a r d even a f t e r c l e a n up t o change c a p i t a l
*   0's t o z e r o s . T h i s s e c t i o n of t h e program l e t s t h e u s e r examine n o n s t a n d a r d
*   EPA I D S and e i t h e r f i x o r d e l e t e them.   This uses t h e conditional index
*   created when t h e working f i l e w a s c r e a t e d .

SET ORDER TO TAG epa-id-c

*   Index EPA I D C i s c o n d i t i o n a l f o r ( i . e . , c o n t a i n s o n l y records m e e t i n g t h e
*   c o n d i t i o n 7 EPA I D n o t s t a r t i n g w i t h NC.
GO TOP                                     &&   Go t o t h e f i r s t record w i t h a n o n s t a n d a r d I D

I F .NOT.        EOFO                      &&   I f i t ' s a t t h e end o f t h e f i l e , t h e n t h e r e are n o
                                           &&   n o n s t a n d r a d EPA I D S a n d n o t h i n g need be done
    CLEAR
    TYPE s t a t e \ s w o r k l . m s g   & & Displays      i n s t r u c t i o n s f o r r e s o l v i n g nonstandard
                                           & & EPA I D S
    WAIT    ""


*   B r o w s e t h e n o n s t a n d a r d EPA I D S ; t h e u s e r i s n o t allowed t o add o r d e l e t e
*   records.          The u s e r h a s t h e o p t i o n of e i t h e r f i x i n g t h e EPA I D so t h a t it i s
*   i n t h e s t a n d a r d format o r d e l e t i n g i t . E i t h e r of t h e s e a c t i o n s removes t h e
*   r e c o r d f r o m t h e c o n d i t i o n a l i n d e x . When a l l r e c o r d s have been removed from
*   t h e i n d e x i n t h i s way, an e r r o r c o n d i t i o n r e s u l t s ; t h e ON ERROR CLEAR l i n e
*   c l e a r s t h e screen when t h i s happens, e f f e c t i v e l y e n d i n g t h e BROWSE mode.
    ON ERROR CLEAR
    B O S NOFOLLOW NOAPPEND NODELETE FIELDS epaid
     R WE
    ON ERROR

ENDIF

*                                                         R WE
    R e s t o r e s c r e e n h e a d e r wiped o u t by B O S command.

CLEAR
@0,6SAY"WRMS D A T A                            B A S E     C O N V E R S I O N              U T I L I T Y "

CLOSE ALL
RETURN & & s w o r k i n g . p r g

*   EOF: s w o r k i n g . p r g




SWORKING.PRG                                                                                                      Page C-51
          W R M S       D A T A       B A S E          U P D A T E   U T I L I T Y


D i r e c t i o n s f o r c l e a n i n g up EPA i d s :

*   You w i l l be shown r e c o r d s w i t h non-standard          EPA ids, i . e . , t h o s e t h a t do n o t
    s t a r t w i t h NC.
*   I f t h e problem i s a t y p o ( e . g . , MC i n s t e a d of NC) f i x i t .

*   Press < C t r l - E n d > when f i n i s h e d .




                                                                          P r e s s any key t o c o n t i n u e   ...




Page C-52                                                                                                 SWORKl MS  .
................................................................................
*                                                                                                                         *
* F i l e n a m e : SFAC.PRG                                                                                              *
* Author: Anne E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                               *
* C r e a t e d : 1 / 8 / 9 1 L a s t u p d a t e d : 7/15/92                                                             *
* C a l l e d by:CONVERT                                                                                                  *
* Comments: Annual R e p o r t f a c i l i t y matching r o u t i n e . Annual Report f a c i l i t i e s                 *
*                   a r e matched t o T R I S f a c i l i t i e s i n WRMS b a s e d on EPA I D . If no                   *
*                   match i s found, t h e Annual Report r e c o r d i s d e l e t e d .                                  *
*                                                                                                                         *
................................................................................
*   Open working f i l e and WRMS F a c i l i t y f i l e , and l i n k on EPA I D .

USE s t a t e \ a n r e p e x t I N 1 A L I A S a r
USE f a c i l i t y I N 2 ORDER e p a i d A L I A S f a c
SET RELATION TO e p a i d I N T O f a c

@ 1,O CLEAR

*   For a l l Annual R e p o r t working f i l e r e c o r d s w i t h a c o r r e s p o n d i n g WRMS F a c i l i t y
*   f i l e r e c o r d , copy t h e WRMS f a c i l i t y I D from t h e F a c i l i t y f i l e r e c o r d t o t h e
*   Annual R e p o r t working f i l e r e c o r d .      Only WRMS F a c i l i t i e s added t o t h e d a t a
*   base b e f o r e or d u r i n g t h e Annual Report d a t a y e a r b e i n g c o n v e r t e d are
*   c o n s i d e r e d e l i g i b l e f o r a match.

*   SET TALK ON e c h o s t h e number of r e c o r d s p r o c e s s e d t o t h e screen s o t h a t t h e
*   u s e r can see t h e p r o g r e s s of t h e f a c i l i t y m a t c h i n g .

@ 9,16 SAY " A s s i g n i n g FAC-I D S t o matched f a c i l i t i e s          ...   11

SET TALK ..
      _ ON
       .     .
REPLACE ar->fac i d W I T H f a c - > f a c i d F R f a c - > f a c -i d
                                                 O                                <> s p a c e ( l 0 ) ;
         . A N D . fac->year-added       <-ar->year
SET TALK OFF
@ 10,O CLEAR
@ 9,60 SAY "Done"
*   Mark unmatched f a c i l i t i e s i n t h e Annual Report working f i l e for d e l e t i o n .
@ 10,16 SAY "Marking unmatched f a c i l i t i e s                 ..............            7,

SET TALK ON
DELETE FOR f a c-i d = s p a c e ( l 0 )
SET TALK OFF
@ 11,o CLEAR
(3 10,60 SAY "Done"

*   P a c k t h e Annual R e p o r t working f i l e t o d e l e t e unmatched f a c i l i t i e s .
@ 11,16 SAY " D e l e t i n g unmatched f a c i l i t i e s         .............            I,

SET TALK ON
PACK
SET TALK OFF
@ 12,O CLEAR
@ 11,60 SAY "Done"

*   Update s t a t u s v a r i a b l e t o i n d i c a t e f a c i l i t y matching i s c o m p l e t e .

 -
1 fac-done        = .T.

@ 2 2 , 2 4 SAY " F a c i l i t y Match Complete.            Press any key t o c o n t i n u e             ..."
WAIT " "




       .
SFAC PRG                                                                                                          Page C-53
CLOSE ALL
RETURN L L sfac.prg

*   EOF: sfac.pry




Page C-54             SFAC. PRG
................................................................................
*                                                                                *
* Filename : SCHEM. PRG                                                          *
*   Author:         Anne E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                          *
*   Created:        1 / 8 / 9 1 L a s t updated: 1 / 2 6 / 9 2                                                                 *
*   C a l l e d by:CONVERT                                                                                                     *
*   Comments: Annual r e p o r t c h e m i c a l matching r o u t i n e .             Checks wastes i n Annual                 *
*                   R e p o r t working f i l e f o r match i n WRMS Chemical f i l e a n d e i t h e r                        *
*                   copies or a s s i g n s a new c h e m i c a l I D depending on whether or n o t a                          *
*                   match i s found.                                                                                           *
*                                                                                *
................................................................................
*   I n i t i a l i z e variables.

next i d = space(5)                     &&  next avaiable             chemical I       D s e r i a l number
matcii = 0                              &&  c o u n t s number        of Annual        Report r e c o r d s matched
n o match = 0                           & & c o u n t s number        o f Annual       Report records n o t matched
processed         =   0                 & & c o u n t s number        of Annual        Report records processed
*   Open Annual R e p o r t working f i l e and WRMS Chemical f i l e ; f i l e s are u n l i n k e d .

USE s t a t e \ a n r e p e x t I N 1 ALIAS a r
USE c h e m i c a l I N 2 ALIAS chem ORDER TAG id-num

*   F i n d n e x t a v a i l a b l e c h e m i c a l I D s e r i a l number.

SELECT chem
start-new = r e c c o u n t o           +    1          & & I n d i c a t e s where    t o s t a r t c r e a t i n g waste
                                                        &&   descriptions later.
GO BOTTOM
n e x t i d = r i g h t (chem_id,5)
DO f h d-n e x t                                 && Returns next           s e r i a l number as a s t r i n g i n NEXT-ID

*   Change o r d e r o f Chemical f i l e t o f a c i l i t a t e s e a r c h i n g

SET ORDER TO TAG waste-id                               &&   Order i s waste-code+form -code+srce-code

*   Determine t o t a l number o f Annual Report records t o p r o c e s s .

SELECT a r
t o t a l -recs = r e c c o u n t ("ar")

*   D i s p l a y c h a e m i c a l m a t c h i n g s t a t u s r e p o r t on s c r e e n .

DO r e p o r t

*   Main loop; p r o c e s s e s e a c h r e c o r d i n Annual Report working f i l e .

SCAN
    processed         =   r e c n o ("ar")                    &&   S e t number of r e c o r d s p r o c e s s e d
    SELECT chem

*   Look for m a t c h i n g w a s t e I D (waste code p l u s form code p l u s s o u r c e c o d e ) i n
*   WRMS Chemical f i l e .
    SEEK ar->wasteno             +   ar->form       +    ar->source

*   I f a match is f o u n d , increment match c o u n t e r ; o t h e r w i s e , increment unmatched
*   c o u n t e r a n d c r e a t e a new WRMS Chemical r e c o r d f o r t h e waste.

    IF found()


SCHEM.PRG                                                                                                                Page C-55
       match = match + 1
     ELSE
       no match = no-match + 1
       APPEND BLANK                        & & to WRMS Chemical file
       REPLACE chem id WITH "W" + left(ar->wasteno + " -   " , 4 ) + next-id,;
         waste code-WITH ar->wasteno, form-code WITH ar->form,;
                o e WITH ar->source
          srce ; d
               -
       DO fin3 next
     ENDIF
*    Copy chemical ID to Annual Report working file.
     REPLACE ar->chem-id WITH chem->chem-id
* Update chemical matching status report on screen.
     DO says
*    Select Annual Report working file for correct functioning of SCAN loop.
     SELECT ar
ENDSCAN
*    Write final chemical matching status report to file and screen.
SET DEVICE TO FILE state\schmauto.txt
DO report
SET DEVICE TO SCREEN
DO report
* Create waste descriptions     f o r new Chemical file records from descriptions of
* form and source codes.
@ 1,0 CLEAR
@ 9,6 SAY "Generating waste descriptions from form and source codes              ...   11


CLOSE ALL
* Open Chemical file and Form and Source code description files. Chemical file
* is linked to Form code description file by form code and to Source code
* description file by source code.
USE chemical IN 1 ALIAS chem
USE state\formcode IN 2 ORDER code ALIAS form
USE state\srcecode IN 3 ORDER code ALIAS source
                    -
SET RELATION TO form code INTO form
SELECT form
SET RELATION TO chem->srce-code INTO source
SELECT chem
GO start-new                   & & Go to first new Chemical file record

* Generate waste description. SET TALK ON echos the number of records
*    processed to the screen so that the user can see the progress of the waste
* descriptions being added.
SET TALK ON
REPLACE REST use-name WITH trim(form->form)      +   "   FROM   "   + source->source
SET TALK OFF
(3   10,O CLEAR
(3   9,67 SAY "Done"



Page C-56                                                                                   SCHEM,PR
*   Update s t a t u s v a r i a b l e s t o i n d i c a t e c h e m i c a l m a t c h i n g i s complete.

1 chm-done = . T .
 -
@ 22,19 S Y "Auto Chemical Match Complete.
         A                                                                 P r e s s any key t o c o n t i n u e        ..."
WAIT " "

CLOSE ALL
RETURN & & schem.prg
*****t***h****h************                         PROCEDURE DEFINITIONS             X*hh****h**X*******h****h***h*


PROCEDURE r e p o r t

*   D i s p l a y s s t a t i c p o r t i o n s of c h e m i c a l m a t c h i n g s t a t u s r e p o r t on s c r e e n .

    @   1,0 CLEAR
    @   4,22      A
                 S Y "STATE ANNUAL REPORT DATA CONVERSION"
    @   5,25      A
                 S Y "WASTE MATCHING STATUS REPORT"
    @   8,22     S Y "Number of records processed:"
                  A
    @   8,52      A
                 S Y p r o c e s s e d PICTURE "99999"
    @   8,58     S Y "of"
                  A
    @   8,61 SAY t o t a l r e a PICTURE "99999"
    @              A
        10,24 S Y " N u s e r o f r e c o r d s matched:"
    @              A
        1 0 , 5 2 S Y match PICTURE "99999"
    @   12,24 S Y "Number of records created:"
                   A
    @   12,52 S Y n o-match PICTURE "99999"
                   A

RETURN      &&   report
................................................................................
PROCEDURE s a y s

*   D i s p l a y s dynamic p o r t i o n of c h e m i c a l matching s t a t u s r e p o r t              (counter
*   variables)

    @ 8,52 S Y p r o c e s s e d PICTURE "99999"
            A
    @ 10,52 S Y match PICTURE "99999"
             A
    @ 12,52 S Y no-match PICTURE "99999"
             A

RETURN & & s a y s
................................................................................
                        -
PROCEDURE f i n d n e x t

*   I n c r e m e n t n e x t-i d v a r i a b l e

next i d = s t r ( V a l (next i d ) + 1,5)
DO WHILE " '' $ next-id-
  n e x t -i d = s t u f f ( n e x t - i d , a t ( " " , n e x t -i d ) ,1,"0")
ENDDO

                        -
RETURN & & f i n d n e x t

*   EOF: schem.prg




SCHEM.PRG                                                                                                                     Page C-57
...............................................................................
*                                                                                                                                  *
*   F i l e n a m e : SEMISS.PRG                                                                                                   *
*   Author:           Anne E. Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                             *
*   Created:          1 / 8 / 9 1 L a s t updated: 7 / 1 5 / 9 2                                                                   *
*   C a l l e d by:CONVERT                                                                                                         *
*   C o m m e n t s : C o n v e r t s e m i s s i o n s d a t a f r o m S t a t e A n n u a l R e p o r t t o WRMS f o r m a t .   *
*                     A s s u m e s a l l f a c i l i t i e s and w a s t e s have been c o r r e c t l y m a t c h e d .          *
*                     ( A l l u n m a t c h e d f a c i l i t i e s w e r e deleted i n t h e F a c i l i t y Matching             *
*                     step.)         C r e a t e s 1 E m i s s i o n record f r o m 1 A n n u a l R e p o r t w o r k i n g        *
*           f i l e record.                                                     *
*                                                                               *
...............................................................................
*   O p e n E m i s s i o n f i l e and A n n u a l R e p o r t w o r k i n g f i l e .    F i l e s are u n l i n k e d

USE e m i s s i o n I N 1 A L I A S e m
USE state\anrepext I N 2 A L I A S a r
SELECT ar

*   D i s p l a y e m i s s i o n c o n v e r s i o n s t a t u s report t i t l e s on screen.

@   1 , 0 CLEAR
@   4,22    SAY    "STATE ANNUAL REPORT DATA CONVERSION"
@   5,25    SAY    "EMISSION UPDATE STATUS REPORT"
@   9,15    SAY    "Number of records processed:                   of"
@   9,47    SAY    "0"
@   9,52    SAY    r e c c o u n t ( " a r " ) PICTURE " 9 9 9 9 "
*   P r o c e s s a l l records i n A n n u a l R e p o r t w o r k i n g f i l e .

SCAN

    A d d record t o E m i s s i o n f i l e and fill i n d a t a from A n n u a l R e p o r t w o r k i n g f i l e .

    SELECT e m
    APPEND BLANK
    REPLACE e m - > s o u r c e WITH "S" r ;
             e m - > s o u r c e i d WITH ar->formno + ar->epaid + a r - > l i n e n o , ;
             e m - > f a c id-WITH ar->fac i d , ;
             e m - > c h e m i d WITH a r - > c h e m -i d , ;
             em->year-WITH           ar->year,;
             em->curr-amt           WITH a r - > t o t a l g e n , ;
             e m - > w a s t e m i n WITH a r - > w n o l + a r - > w n o 2 + a r - > w n o 3 + a r - > w n o 4 , ;
             e m - > p r o d Kdx WITH v a l ( a r - > p e r c e n t ) , ;
                            -
             e m - > o f f a m t WITH a r - > t o t a l s h i p

    C o p y t h e b a s i s code f o r o f f - s i t e     o n l y if w a s t e w a s shipped o f f - s i t e .

    I F em->off a m t > 0
       REPLACE e " > o f f -bas WITH ar->basis
    ENDIF

    T r e a t e d on-site     d a t a a r e copied o n l y i f t h e y do n o t r e f l e c t s t o r a g e .

    I F ar->trtcode <> "S"
       REPLACE em->on -a m t WITH a r - > t o t a l t r t ,            em->on    -bas     WITH ar->basis
    ENDIF

    Update e m i s s i o n s c o n v e r s i o n s t a t u s report o n s c r e e n .

    @ 9 , 4 4 SAY r e c n o ( " a r " )   PICTURE " 9 9 9 9 "


Page C-58                                                                                                                SEMISS.PR
*   Select Annual Report working file for correct functioning of SCAN loop.
    SELECT ar
ENDSCAN
* Update status variable to indicate emissions conversion is complete.
1-emiss = .T.
CLOSE ALL
*   Delete the intermediate files created during the conversion process.
@ 1,0 CLEAR
@ 10,12 SAY "Deleting working files   ...   11

DELETE   FILE   state\anrepext.dbf
DELETE   FILE   state\anrepext.mdx
DELETE   FILE   state\sstatus.mem
DELETE   FILE   state\schmauto.txt
@ 10,39 SAY "Done"

* Display conversion complete message.
@   1,0 CLEAR
@   9,25 TO 13,53 DOUBLE
@   11,27 SAY "Data conversion complete."
@ 22,50 SAY "Press any key to continue      ...   11

WAIT " "
RETURN   &&   semiss
* EOF: semiss.prg




SEMISS.PRG                                                                 Page C-59
................................................................................
*                                                                                                                              *
* Filename: NWORKING.PRG                                                                                                       *
* Author:         Anne E . Crook, Research T r i a n g l e I n s t i t u t e                                                   *
* Created: 2/13/91 L a s t updated: 1/15/92                                                                                    *
* C a l l e d by:CONVERT                                                                                                       *
* Comments: Creates working NPDES f i l e s f o r c o n v e r s i o n program, w i t h s t r u c t u r e                       *
*                 e x t e n d e d t o i n c l u d e f i e l d s used i n p r o c e s s i n g . A l s o c l e a n s up          *
*                 some f i e l d s .                                                                                           *
*                                                                                                                              *
................................................................................
*   I n i t i a l i z e status variables.        T h e s e v a r i a b l e s i n d i c a t e which s t e p s of t h e
*   c o n v e r s i o n p r o c e s s have been completed.

1 fac done = . F .                      &&   F a c i l i t y matching done
lIchm-done = . E .                      &&   Chemical m a t c h i n g done
1-cauto = . F .                         &&   Auto c h e m i c a l matching done
 -
1 emiss = .F.                           &&   E m i s s i o n s c o n v e r s i o n done

*   I n i t i a l i z e other variable.

myear = s p a c e ( 2 )                 &&   Year t o be c o n v e r t e d

*   Ask f o r y e a r b e i n g c o n v e r t e d .

@ 1 , O CLEAR
SET CONFIRM ON
@ 9,20 SAY " E n t e r y e a r of d a t a b e i n g c o n v e r t e d : 1 9 "
@ 9,58 GET myear PICTURE "99"
READ
SET CONFIRM OFF

*   C r e a t e i n t e r m e d i a t e NPDES d a t a f i l e t h e original data f i l e i s i n ASCII
*   f o r m a t ; t h i s j u s t p u l l s i t i n t o dBase f o r m a t .

*   SET TALK ON e c h o s t h e number of r e c o r d s p r o c e s s e d t o t h e screen so t h a t t h e
*   u s e r c a n see t h e progress of t h e r e c o r d s b e i n g added.

@ 1,0 CLEAR
@ 8,11 SAY " C r e a t i n g i n t e r m e d i a t e f i l e            ....        11




CREATE npde s \ npdes i n t F O npde s \ n i n t s t r u
                                RM
SET TALK ON
        RM
APPEND F O n p d e s \ n p d e s . d a t TYPE SDF

*   Convert a v e r a g e s from c h a r a c t e r t o numeric f o r m a t , and c o n s o l i d a t e w e i g h t i n g
*   v a r i a b l e s ( o n l y one of c n t l 9 and c n t 2 6 w i l l b e nonzero f o r a r e c o r d ) .

REPLACE ALL avg W I T H v a l ( c a v g ) , weight WITH c n t l 9                        + cnt26
S E T TALK OFF
@ 9 , 0 CLEAR
CLOSE DATABASE
@ 8 , 4 3 SAY "Done"

*   The i n t e r m e d i a t e f i l e i s d i v i d e d i n t o two working f i l e s , one f o r f l o w d a t a
*   and one f o r p o l l u t a n t c o n c e n t r a t i o n and l o a d i n g d a t a .

@ 9 , 1 1 SAY " C r e a t i n g Flow f i l e          . . . . . . . . . . . . ' I



*   C r e a t e working Flow f i l e . P i p e i n d e x i s f o r l i n k i n g t o c o n c e n t r a t i o n f i l e .
*   Parameter code 50050 i s flow; u n i t s code 03 i s MGD.                    A l l flow v a l u e s s h o u l d



Page C-60                                                                                                    NWORKING PRG  .
*   be in MGD; any that aren't are not used.
CREATE npdes\nflowext FROM npdes\flowstru
INDEX ON npdes + pipe-num TAG pipe
SET TALK ON
APPEND FROM npdes\npdesint FOR param-code = " 5 0 0 5 0 "    .AND. paran-units   =   "03"
SET TALK OFF
<LOSE DATABASE
@ 9,43 SAY "Done"

*   Flow records with bad flow units (not MGD) are saved in a file of the same
*   structure as the working flow file. The file is created only if it does not
*   already exist.
* Create or use bad flow records file.
@ 10,11 SAY "Saving bad flow records       ....... I,

IF .NOT. file ("npdes\nflowbad.dbf")
  CREATE npdes\nflowbad FROM npdes\flowstru
  INDEX ON npdes + pipe-num TAG pipe
____
ELSE
  USE npdesbflowbad
ENDIF
*   Copy flow records not in MGD to bad flow file.
SET TALK ON
APPEND FROM npdes\npdesint FOR param-code = " 5 0 0 5 0 "    .AND. param-units <> "03"
SET TALK OFF
@ 11,o CLEAR
CLOSE DATABASE
@ 10,43 SAY "Done"

*   Create working Concentration file.
@ 11,11 SAY "Creating Concentration file       . . ."
CREATE npdes\nconcext FROM npdes\concstru
*   Create index on NPDES number, conditional on it being nonstandard (i.e., not
*   matching standard format of NC followed by numbers). The index will be used
*   later in cleaning up nonstandard NPDES numbers.
INDEX ON npdes TAG npdes-c FOR .NOT. like("NC*",npdes) .OR. "0" $ npdes
                                                                !

* Create index on parameter code, conditional on no chemical match found.
*   The index will be used in chemical matching.
INDEX ON param-code TAG param-c FOR chem-m i s
* Create index unique to pipe and parameter. The index will be used in
* emissions conversion.
INDEX ON npdes   +   pipe-num   + param-code + param-name TAG pipeparamu UNIQUE
*   Copy records from intermediate data file. Parameter code 50050 is flow; all
*   others are concentration or loading values.
SET TALK ON
APPEND FROM npdes\npdesint FOR param-code <> " 5 0 0 5 0 "   .AND. param-units $ "19,26"
SET TALK OFF
@ 1 2 , O CLEAR


NWORKING.PRG                                                                         Page C-61
CLOSE DATABASE
@ 11,43 SAY "Done"

*   Concentration records with bad units (not mg/l or lb/day) are saved in a file
* of the same structure as the working concentration file. The file is created
*   only if it does not already exist. Concentrations in other units cannot be
*   used because the origianl data file did not contain weighting information
*   for units other than mg/l and lblday. If these weights are available in
*   later data years, the concentration records can be used by modifying this
*   part of the program.
* Create or use bad concentration records file.
@ 12,11 SAY "Saving bad conc records . . . . .
IF .NOT. file ("npdes\nconcbad.
                              dbf")
                                                    . ."
  CREATE npdes\nconcbad FROM npdes\concstru
  INDEX ON npdes TAG npdes c FOR .NOT. like("NC*",npdes) .OR. "0" $ npdes
  INDEX ON param-code TAG param-c FOR chem-mis
~ ~ _ _
ELSE
  USE npdes\nconcbad
ENDIF
* Copy concentration records not in mg/l          o r lb/day to bad concentration file.
SET TALK ON
APPEND FROM npdes\npdesint FOR param-code <> "50050" .AND. .NOT. param-units $
" 19,26"
SET TALK OFF
@ 13,O CLEAR
CLOSE DATABASE
@ 12,43 SAY ;Done"

* Enter year in working Concentration file and bad flow and concentration files.
@ 14,11 SAY "Entering year in working file ..."
USE npdes\nconcext
REPLACE ALL year WITH val("19" + myear)
USE npdes\nconcbad
REPLACE year WITH val("19" + myear) FOR year = 0
USE npdes\nflowbad
REPLACE year WITH val("19" + myear) FOR year   0
@ 14,45 SAY "Done"

*   Clean up NPDES numbers in working Concentration file. This involves
*   replacing capital Os in the NPDES number with zeros. NPDES numbers are not
*   cleaned up in the flow file, since this could result in two flow records for
*   the same facility. Multiple concentration records for the same facility
*   can be weighted and aggregated, but not flows. Therefore, only flow records
*   with good NPDES numbers are used.
@ 15,11 SAY "Cleaning up NPDES ids        .. . . .. . .... "
USE npdes\nconcext
SCAN FOR "0" $ npdes
* Repeat this loop until there are no capital              Os in the NPDES number.
    DO WHILE "0" $ nDdes
      REPLACE npdes-i WITH stuff (npdes,at("O",npdes) l , " O " )
                                                     ,
    ENDDO
ENDSCAN
@ 15,45 SAY "Done"


Page C-62                                                                            NWORI(ING.PR
*   Some NPDES numbers may s t i l l be n o n s t a n d a r d e v e n a f t e r c l e a n up t o change
*   c a p i t a l Os t o z e r o s . T h i s s e c t i o n of t h e program l e t s t h e u s e r examine non-
*   s t a n d a r d NPDES numbers and e i t h e r f i x o r d e l e t e them.          This uses t h e
*   c o n d i t i o n a l i n d e x created when t h e working C o n c e n t r a t i o n f i l e was created.

USE n p d e s \ n c o n c e x t ORDER npdes c
GO TOP                                 & & GG t o t h e f i r s t r e c o r d w i t h a n o n s t a n d a r d no.

I F .NOT.         EOFO                   &&   If i t ' s a t t h e end o f t h e f i l e , t h e n t h e r e are
                                         &&   n o n o n s t a n d a r d NPDES nos. and n o t h i n g need be done
    CLEAR
    TYPE npdes\nworkl.msg                &&   Displays i n s t r u c t i o n s f o r r e s o l v i n g nonstandard
                                         &&   NPDES numbers
    WAIT    '"'
*   B r o w s e t h e n o n s t a n d a r d NPDES numbers; t h e u s e r i s n o t a l l o w e d t o add o r
*   d e l e t e records. T H e u s e r h a s t h e o p t i o n of e i t h e r f i x i n g t h e NPDES number s o
*   t h a t i t i s i n t h e s t a n d a r d f o r m a t o r d e l e t i n g i t . E i t h e r of t h e s e a c t i o n s
*   removes t h e record from t h e c o n d i t i o n a l index. When a l l records have been
*   removed f r o m t h e i n d e x i n t h i s way, a n e r r o r c o n d i t i o n r e s u l t s ; t h e ON ERROR
*   CLEAR l i n e c l e a r s t h e screen when t h i s happens, e f f e c t i v e l y e n d i n g t h e
*   B O S mode.
      R WE

    ON ERROR CLEAR
    B O S N F L O NOAPPEND NODELETE FIELDS npdes
     R WE OOL W
    ON ERROR

ENDIF

*   R e s t o r e s c r e e n h e a d e r wiped o u t b y B O S command.
                                                           R WE

CLEAR
@ 0,6 S Y "W R M S
       A                           D A T A B A S E        C 0 N V E R S I 0 N             U T I L I T Y"
CLOSE ALL
RETURN & & n w o r k i n g . p r g

*   EOF: n w o r k i n g . p r g




NWORKING.PRG                                                                                                     Page C-63
          W R M S      D A T A       B A S E        U P D A T E       U T I L I T Y


D i r e c t i o n s f o r c l e a n i n g up NPDES i d s :

*   You w i l l b e shown r e c o r d s w i t h non-standard NPDES i d s , i . e . , t h o s e t h a t d o n ' t
    s t a r t w i t h N C . I D S c o n t a i n i n g c a p i t a l 0 i n s t e a d of z e r o w i l l a l s o be shown.
*   I f t h e p r o b l e m i s a t y p o ( e . g . , MC i n s t e a d of NC)   f i x it.

*   Change c a p i t a l 0 t o z e r o (0).

*   P r e s s <Ctrl-End> when f i n i s h e d .




                                                                            P r e s s any key t o c o n t i n u e   ..




Page C-64                                                                                                    NWORKl MS .
................................................................................
*                                                                                                                                    *
* F i l e n a m e : NFAC.PRG                                                                                                         *
* Author:           Anne E . Crook, Research T r i a n g l e I n s t i t u t e                                                       *
* Created: 2 / 1 9 / 9 1 Last updated: 1/15/92                                                                                       *
* C a l l e d by:CONVERT                                                                                                             *
* Comments: NPDES f a c i l i t y matching r o u t i n e . NPDES f a c i l i t i e s are matched t o                                 *
*                   T R I S f a c i l i t i e s i n WRMS b a s e d on NPDES number.             If no match i s                      *
*                   found, t h e N P D E S r e c o r d i s d e l e t e d . F a c i l i t i e s are o n l y matched                   *
*                                                                                                        *
                    i n t h e working C o n c e n t r a t i o n f i l e ; r e c o r d s i n t h e working Flow
*           f i l e t h a t c o r r e s p o n d t o unmatched f a c i l i t i e s w i l l s i m p l y be *
*           ignored during t h e emissions conversion step.                                              *
*                                                                                                        *
................................................................................
*   Open working C o n c e n t r a t i o n f i l e and WRMS F a c i l i t y f i l e .                 F i l e s are l i n k e d on
*   NPDES number.

USE n p d e s \ n c o n c e x t I N 1 ALIAS c o n c
USE f a c i l i t y I N 2 ORDER npdes A L I A S f a c
SET RELATION TO npdes INTO f a c

@ 1,O CLEAR

*   F o r a l l working C o n c e n t r a t i o n f i l e records w i t h a c o r r e s p o n d i n g WRMS F a c i l i t y
*   f i l e r e c o r d , copy t h e WRMS F a c i l i t y I D from t h e F a c i l i t y f i l e r e c o r d t o t h e
*   working C o n c e n t r a t i o n f i l e r e c o r d . Only W S F a c i l i t i e s added t o t h e d a t a
*   b a s e b e f o r e o r d u r i n g t h e NPDES d a t a y e a r b e i n g c o n v e r t e d are c o n s i d e r e d
*   e l i g i b l e f o r a match.

*   SET TALK ON e c h o s t h e number of r e c o r d s p r o c e s s e d t o t h e s c r e e n s o t h a t t h e
*   u s e r can see t h e progress o f t h e f a c i l i t y m a t c h i n g .
@ 9 , 1 6 SAY " A s s i g n i n g FAC I D S t o , m a t c h e d f a c i l i t i e s
                                        -                                             ...   t1

SET TALK ON
REPLACE c o n c - > f a c i d W I T H f a c - > f a c i d FOR f a c - > f a c -i d <> s p a c e ( 1 0 ) ;
           . A N D . fac=>year-added <= conc->year
SET TALK OFF
@ 10,O CLEAR
@ 9 , 6 0 SAY "Done"

*   Mark unmatched f a c i l i t i e s i n t h e working C o n c e n t r a t i o n f i l e f o r d e l e t i o n .
@ 1 0 , 1 6 SAY "Marking unmatched f a c i l i t i e s              ..............               11

SET TALK ON
DELETE FOR f a c-i d = s p a c e ( l 0 )
SET TALK OFF
@ 11,O CLEAR
@ 10,60 SAY "Done"

*   P a c k t h e working C o n c e n t r a t i o n f i l e t o d e l e t e unmatched f a c i l i t i e s

@ 1 1 , 1 6 SAY " D e l e t i n g unmatched f a c i l i t i e s       .............              "
SET TALK ON
PACK
SET TALK OFF
@ 1 2 , O CLEAR
@ 11,60 SAY "Done"

*   Update s t a t u s v a r i a b l e t o i n d i c a t e f a c i l i t y matching i s c o m p l e t e .

1 f a c-done = . T .
 -

NFAC. PRG                                                                                                                 Page C-65
@ 22,24     SAY "Facility Match Complete.   Press any key to continue   ..."
WAIT   "
       I'



CLOSE ALL
RETURN & & nfac.prg

*   EOF: nfac.prg




Page C-66                                                                          .
                                                                               NFAC PRG
................................................................................
*                                                                                                                                                                   *
*   F i l e n a m e : NCHEM.PRG                                                                                                                                     *
*   Author:           Anne E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                                                             *
*   Created: 2 / 1 9 / 9 1 L a s t u p d a t e d : 1 / 1 5 / 9 2                                                                                                    *
*   C a l l e d by:CONVERT                                                                                                                                          *
*   Comments: NPDES c h e m i c a l m a t c h i n g r o u t i n e . Checks c h e m i c a l s i n working                                                            *
*                     C o n c e n t r a t i o n f i l e f o r match i n WRMS Chemical f i l e and a s s i g n s a                                                   *
*                     chemical i d .                                                                                                                                *
*                                                                                                                                                                   *
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .



*   I n i t i a l i z e variables

next i d =          '"'                                    &&    n e x t a v a i l a b l e c h e m i c a l I D s e r i a l number
m-continue            = "Y"                                &&    d o e s u s e r want t o c o n t i n u e

*   The s t a t u s v a r i a b l e 1 c a u t o i n d i c a t e s w h e t h e r t h e u s e r h a s c o m p l e t e d a u t o
*   chemical m a t c h i n g .      If i n t e r a c t i v e c h e c k i n g o f unmatched c h e m i c a l s i s done,
*   t h e whole c h e m i c a l m a t c h i n g p r o c e s s i s c o m p l e t e , as i n d i c a t e d b y 1-chm-done.

*   C o n t i n u e t o a l t e r n a t e a u t o c h e m i c a l m a t c h i n g and i n t e r a c t i v e matching,                                   until
*   u s e r a s k s t o q u i t o r chemical matching i s complete.

DO WHILE .NOT.                 -
                              1 chm-done

*   I f t h e a u t o c h e m i c a l match h a s n o t been done, d o i t .

    I F .NOT.             -
                      1 cauto

       DO a u t o

*   Auto c h e m i c a l m a t c h i n g h a s j u s t been c o m p l e t e d .        I f chemical matching i s not
*   c o m p l e t e ( b e c a u s e t h e r e a r e unmatched c h e m i c a l s l e f t ) see i f t h e u s e r wants
*   t o q u i t and resume l a t e r (if t h e y do, t h e ASK Q U I T p r o c e d u r e w i l l r e t u r n
*   c o n t r o l t o CONVERT).             I f c h e m i c a l m a t c h i n g is-done, r e t u r n c o n t r o l t o CONVERT.

       I F . N O T . 1 chm-done
          DO a s k-&it
       ELSE
          EXIT
       ENDIF

    ENDIF

*   Auto c h e m i c a l match i s complete, e i t h e r b e c a u s e i t was j u s t done and t h e u s e x
*   d i d n o t q u i t , o r b e c a u s e it w a s done e a r l i e r and t h e u s e r h a s resumed.
*   However, t h e r e are unmatched c h e m i c a l s ( o r t h e whole c h e m i c a l m a t c h i n g
*   p r o c e s s would b e done and t h e program would n o t have r e a c h e d t h i s p o i n t ) ,
*   s o c a l l p r o c e d u r e t o l e t u s e r c h e c k unmatched c h e m i c a l s .
    DO mis

ENDDO

RETURN & & nchem.prg
*X*****X*****h*h**hX*h***XX                             PROCEDURE D E F I N I T I O N S               ****hX****hh*h***hh**hf*h**h*******


PROCEDURE a s k-q u i t

*   See if u s e r w a n t s t o q u i t a n d resume l a t e r .

                                                                                                                                                   ~~      ~    ~




NCHEM. PRG                                                                                                                                              Page C-67
@ 1 , 0 CLEAR
I 8.12
2        TO 1 5 . 6 6
  16,ld-SAY ; ' P r e s s Y t o c o n t i n u e c h e m i c a l m a t c h i n g , "
@ 11,14 S Y " P r e s s N t o e x i t and resume c h e m i c a l m a t c h i n g l a t e r . "
           A
@ 13,32 SAY "Continue? Y / N : "
@ 13,47 GET m-c o n t i n u e PICTURE "Y"
READ

*   I f t h e u s e r does want t o q u i t , r e t u r n c o n t r o l t o CONVERT.

I F m-continue = "N"
   RETURN TO MASTER
ENDIF

RETURN & & a s k-q u i t
................................................................................
PROCEDURE a u t o

*   I n i t i a l i z e variables.

match = 0                         &&   Count number of NPDES c o n c e n t r a t i o n r e c o r d s matched
n o match = 0                     &&   Count number of NPDES c o n c e n t r a t i o n records n o t matched
processed = 0                     &&   Count number of NPDES c o n c e n t r a t i o n records processed

*   Open woring C o n c e n t r a t i o n f i l e a n d W M Chemical f i l e .
                                                         R S                            F i l e s are u n l i n k e d .
*   Chemical f i l e order i s on STORET parameter number.

USE n p d e s \ n c o n c e x t I N 1 ALIAS c o n c
USE c h e m i c a l I N 2 ALIAS chem ORDER TAG s t o r e t-num
SELECT c o n c

*   Determine t o t a l number o f NPDES C o n c e n t r a t i o n records t o process.

t o t a l -recs = r e c c o u n t ("conc")
*   D i s p l a y m a t c h i n g s t a t u s report on s c r e e n .

DO r e p o r t

*   Main loop; p r o c e s s e s e a c h record i n working C o n c e n t r a t i o n f i l e .

SCAN
  p r o c e s s e d = r e c n o ("conc")                  &&   S e t number of records p r o c e s s e d

    SELECT chem

*   Look f o r m a t c h i n g STORET parameter code i n W M Chemical f i l e .
                                                          R S

    SEEK conc->param -code

*   I f a nonblank match i s found, i n c r e m e n t match c o u n t e r a n d copy c h e m i c a l I D t o
*   working C o n c e n t r a t i o n f i l e .

                       conc->param -code <> s p a c e ( 2 )
    I F f o u n d 0 .AND.
       match = match    1    +
       REPLACE conc->chem -i d W I T H chem->chem -i d

    ELSE

*   N o match found;         i n c r e m e n t n o match c o u n t e r a n d s e t unmatched f l a g i n working


Page C-68                                                                                                       NCHEM P RG.
*   Concentration f i l e .

      no match = no-match + 1
      REFLACE conc-%hem -mis WITH . T .
    ENDIF

*   Update m a t c h i n g s t a t u s r e p o r t o n s c r e e n .

    DO s a y s

*   S e l e c t working C o n c e n t r a t i o n f i l e f o r c o r r e c t f u n c t i o n i n g of SCAN l o o p .

    SELECT c o n c

ENDSCAN

*   Write f i n a l c h e m i c a l m a t c h i n g s t a t u s r e p o r t t o f i l e and s c r e e n .

SET DEVICE TO FILE n p d e s \ n c h m a u t o . t x t
DO r e p o r t
SET DEVICE TO SCREEN
DO r e p o r t

*   Update s t a t u s v a r i a b l e s
1-cauto         = .T.

*   I F no c h e m i c a l were l e f t unmatched, c h e m i c a l m a t c h i n g i s complete; set
* 1 chm-done
   -                accordingly.

I F no-match = 0
   1 chm-done = . T           .
ENDTF
@ 2 2 , 1 9 SAY "Auto Chemical Match Complete.                              P r e s s a n y key t o c o n t i n u e      ...   11

WAIT     " 'I


CLOSE ALL
RETURN & & a u t o
................................................................................
PROCEDURE r e p o r t

*   D i s p l a y s s t a t i c p o r t i o n o f c h e m i c a l m a t c h i n g s t a t u s r e p o r t on s c r e e n .

    @   1 , 0 CLEAR
    @   4,2 6 SAY "NPDES DATA              COP;VERSION"
    @   5,21      A
                 S Y "CHEMICAL MATCHING STATUS REPORT"
    @   8,22     S Y "Number of r e c o r d s p r o c e s s e d : "
                  A
    @   8,52     S Y p r o c e s s e d PICTURE " 9 9 9 9 9 "
                  A
    @   8,58     S Y "of"
                  A
    @   8,61 SAY t o t a l recs PICTURE " 9 9 9 9 9 "
    @   1 0 , 2 4 S Y "Numb-er o f records matched:"
                   A
    @              A
        1 0 , 5 2 S Y match PICTURE "99999"
    @   1 2 , 2 0 S Y "Number of records n o t matched:"
                   A
    @   1 2 , 5 2 S Y no-match P I C T U R E "99999"
                   A

RETURN & & r e p o r t
................................................................................


NCHEM PRG.                                                                                                                   Page C-69
    PROCEDURE s a y s

    *   D i s p l a y s dynamic p o r t i o n of c h e m i c a l m a t c h i n g s t a t u s r e p o r t   (counter
    *   variables).

        @ 8,52 SAY p r o c e s s e d PICTURE "99999"
'       @ 1 0 , 5 2 SAY match PICTURE " 9 9 9 9 9 "
        @ 1 2 , 5 2 SAY no-match PICTURE "99999"

    RETURN & & s a y s
    ................................................................................
    PROCEDURE m i s

    *   U s e r c h e c k s unmatched c h e m i c a l s and e i t h e r a s s i g n s a c o r r e c t c h e m i c a l I D
    *   from a p r i n t e d l i s t o r marks t h e c h e m i c a l f o r a d d i t i o n t o t h e WRMS Chemical
    *   file.       The computer makes a n y n e c e s s a r y a d d i t i o n s t o t h e Chemical f i l e .

    *   I n i t i a l i z e variable

    m-chem    -i d   =   ""                 & & S t o r e s newly c o n s t r u c t e d c h e m i c a l I D S

    *   Open working C o n c e n t r a t i o n f i l e . The i n d e x i s c o n d i t i o n a l on t h e unmatched
    *   f l a g b e i n g t r u e , so o n l y unmatched c h e m i c a l s are shown.

    USE n p d e s \ n c o n c e x t I N 1 ORDER param-c A L I A S conc

    *   Display i n s t r u c t i o n s f o r r e s o l v i n g u n d t c h e d chemicals.

    CLEAR
    TYPE npdes\ncheml.msg
    WAIT " "

    *   BROWSE t h e unmatched c h e m i c a l s ; t h e u s e r i s n o t a l l o w e d t o add r e c o r d s .
    *   The u s e r w i l l change t h e unmatched f l a g t o F a l s e as e a c h c h e m i c l a i s
    *   r e s o l v e d ( e i t h e r by a s s i g n i n g a c h e m i c a l I D or marking it for a d d i t i o n t o
    *   t h e Chemical f i l e ) . Changing t h e unmatched f l a g t o F a l s e removes a r e c o r d
    *   from t h e c o n d i t i o n a l i n d e x . When a l l r e c o r d s have been removed from t h e
    *   i n d e x i n t h i s way, an e r r o r c o n d i t i o n r e s u l t s ; t h e ON ERROR CLEAR l i n e
    *   c l e a r s t h e s c r e e n s h e n t h i s happens, e f f e c t i v e l y e n d i n g t h e BROWSE. The
    *   u s e r may a l s o e x i t t h e Browse w i t h ESC o r Ctrl-End b e f o r e a l l unmatched
    *   c h e m i c a l s have b e e n d e a l t w i t h .

    ON ERROR CLEAR
                     O O L W FIELDS chem-m i s ,
    BROWSE NOAPPEND N F L O                                              chem-id,      param-code          / r , paran-name   /r
    ON ERROR

    *   R e s t o r e h e a d e r wiped o u t by BROWSE.

    CLEAR
    @ 0 , 6 S A Y " W R M S          D A T A        B A S E       C O N V E R S I O N                U T I L I T Y "

    *   Copy m a r k e d c h e m i c a l s t o WRMS c h e m i c a l f i l e
    @ 11,22 SAY "Updating WWS c h e m i c a l f i l e                   .. .,I




    *   R e t u r n working C o n c e n t r a t i o n f i l e t o n a t u r a l o r d e r and open Chemical f i l e

    SET ORDER TO
                                               -
    USE c h e m i c a l I N 2 ORDER i d num A L I A S chem


    Page C-70                                                                                                           NCHEM. PRG
*   Determine n e x t a v a i l a b l e c h e m i c a l I D s e r i a l number

SELECT chem
GO BOTTOM
                             -
n e x t i d = r i g h t (chem i d , 5 )
DO f h d - n e x t                          &&   r e t u r n s n e x t s e r i a l number as a s t r i n g i n NEXT-ID

SELECT conc

*   P r o c e s s e s marked r e c o r d s i n t h e working C o n c e n t r a t i o n f i l e ( t h e d e l e t i o n
*   m a r k e r i s u s e d t o mark c h e m i c l s € o r a d d i t i o n t o t h e Chemical f i l e ) .

      O
SCAN F R d e l e t e d 0

    Construct a chemical I D f o r t h e c u r r e n t r e c o r d .
    The p r e f i x S i n t h e c h e m i c a l I D i n d i c a t e s t h e p o l l u t a n t i s a STORET p a r a m e t e r .
    The rest of t h e Chemical I D i s made up of t h e f i r s t f o u r c h e a r a c t e r s of t h e
    p a r a m e t e r name p l u s a s e r i a l number.

    m chem-id = "S"          +   f i n d-id(conc->paran-name)            +   next-id
    SELECT chem
    APPEND BLANK
    REPLACE chem i d WITH m chem i d , chem-name                      WITH conc->param-name,:
            s t o r s t -num WITH con&>param-code

    Remove d e l e t i o n marker f r o m working C o n c e n t r a t i o n f i l e r e c o r d .

    SELECT conc
    RECALL

    E n t e r new c h e m i c a l I D i n working f i l e .
    REPLACE chem i d WITH m-chem i d
    DO f i n d next-
               -              & & - r e t u r n s n e x t s e r i a l number as a s t r i n g i n NEXT-ID

ENDSCAN

@ 11,54 SAY "Done"

*   See if a n y unmatched c h e m i c a l s remain ( u s e r may have e x i t e d b e f o r e a l l were
*   matched).

LOCATE FOR chem-id             = space(5)

*   I f unmatched c h e m i c a l s a r e s t i l l found, reset a u t o matche s t a t u s v a r i a b l e t o
*
*
    F a l s e : a u t o match w i l l t h e n run a g a i n ( w i t h any a d d i t i o n s t o Chemical f i l e
    made a b o v e ) . The u s e r w i l l be g i v e n t h e o p p o r t u n i t y t o q u i t a f t e r a u t o match
*   has run a g a i n .

IF found0
  1-cauto = . F .

ELSE

*   I f n o unmatched c h e m i c a l s a r e found, t h e n c h e m i c a l matching i s done.

    1-chm-done       = .T.

ENDIF

CLOSE ALL
RETURN & & m i s


NCHEM. PRG                                                                                                          Page C-71
................................................................................
PROCEDURE f i n d-n e x t

*    I n c r e m e n t n e x t -i d v a r i a b l e

n e x t i d = s t r ( v a l ( n e x t - i d ) + 1,5)
DO WEILE '! " $ n e x t i d
   n e x t -i d = s t u f f ( n e x t-i d , a t ( " " , n e x t   -i d ) ,1,"0")
ENDDO

RETURN & & f i n d-n e x t
................................................................................
FUNCTION f i n d-i d

*    C r e a t e s t h e f o u r l e t t e r c h e m i c a l I D p r e f i x from t h e parameter name.             The
*    p r e f i x i s t h e f i r s t f o u r "good" c h a r a c t e r s of t h e parameter name (numbers,
*    p u n c t u t a t i o n , a n d lowercase c h a r a c t e r s n o t c o n t r i b u t i n g t o t h e s o r t o r d e r
*    are e x c l u d e d ) . A c c e p t s t h e p a r a m e t e r name a s a parameter f r o m t h e c a l l i n g
*    program, and r e t u r n s a f o u r c h a r a c t e r s t r i n g .

PARAMETERS name
id-code = " "
DO WHILE l e n ( i d c o d e ) C 4
 I F i s u p p e r (namg)
    i d code = i d-code + l e f t ( n a m e , l )
    ENDIF
    IF len(trim(name)) > 1
     name = s u b s t r (name, 2 )
    ELSE
     i d code = l e f t ( i d-code           +   "-..--'I,   4)
     EXTT
 ENDIF
ENDDO

RETURN(id-c o d e ) & & f i n d-i d

*    EOF: nchem.prg




Page C-I2                                                                                                             NCHEM. PRG
          W R M S       D A T A       B A S E       C O N V E R S I O N              U T I L I T Y


D i r e c t i o n s f o r r e s o l u t i o n of unmatched c h e m i c a l parameters:

*   Unmatched NPDES r e c o r d s w i l l be d i s p l a y e d ,       i n d e x e d on paran-code.

*   You w i l l o n l y be able t o e d i t t h e chem-id            and chem-mis f i e l d s .
*   Look up t h e c o r r e c t chem i d i n t h e a l p h a b e t i c a l l i s t i n g of t h e WRMS
    c h e m i c a l f i l e and e n t e r Ft i n t h e chem-i d f i e l d . Change t h e chem-m i s
    f i e l d t o F (False).

*   I f a parameter n e e d s t o be added t o t h e WRMS c h e m i c a l f i l e , change chem m i s
    t o F f o r ALL r e c o r d s c o n t a i n i n g t h a t c h e m i c a l , and mark ONE r e c o r d c o n t a i n i n g
    t h e chemical u s i n g < C t r l - U > . T h e program w i l l create t h e a p p r o p r i a t e WRMS
    chemical r e c o r d a u t o m a t i c a l l y .

*   P r e s s <Ctrl-End> when f i n i s h e d .


                                                                              Press any key t o c o n t i n u e        ..




NCHEMl MSG.                                                                                                       Page C-I3
...............................................................................
*                                                                                 *
* Filename: NEMISS.PRG                                                            *
* Author: Anne E. Crook, Research Triangle Institute                              *
* Created: 7/17/91 Last updated: 1/15/92                                          *
* Called by:CONVERT                                                               *
* Comments: Converts emissions data from NPDES to WRMS format. Assumes all        *
*           facilities and chemicals have been correctly matched. Creates         *
*           1 Emission record from 1 o r more working Concentration records.      *
*                                                                                 *
...............................................................................
* Open data base files: working Concentration and Flow files. Files are linked
*   on NPDES number and pipe.
@ 1 , 0 CLEAR
@ 9,19 SAY "Calculating emissions   ..............     11




USE npdes\nconcext IN 1 ALIAS conc
USE npdes\nflowext IN 2 ORDER pipe ALIAS flow
SET RELATION TO npdes + pipe-num INTO flow
*   Calculate daily emissions from concentration and flow. If concentration units
*   are mg/l (coded as "19"), concentration is multiplied by flow and a conversion
*   factor to produce lbs/day. If concentration is already in lbs/day (coded as
*   "26"), it is multiplied by 1 (i.e., unchanged). The calculated emission is
*   placed in the emiss field of the working Concentration file.
SET TALK ON
REPLACE ALL emiss WITH conc->avg   * iif(param-unit           = "26",lr;
             flow->avg * 8.3)
SET TALK OFF
@ 10,O CLEAR
@ 9,56 SAY "Done"

* Close working Flow file.
@ 10,19 SAY "Deleting records with no data    .. .. . .     11




SET RELATION TO
SELECT flow
USE
* Delete working Concentration records for which emissions are zero.
SELECT conc
SET TALK ON
DELETE FOR emiss = 0
PACK
SET TALK OFF
@ 11,O CLEAR
@ 10,56 SAY "Done"

*   Data base in use is working Concentration file. This file may contain
*   multiple records for a specific NPDES number, pipe, and parameter if data
*   were originally reported in two different units. These have now been
*   converted to emissions with common units, and need to be combined.
*   Create a new data base file with one blank record per pipe and parameter
*   to hold emissions averaged across different units.
@ 11,19 SAY "Creating intermediate files   . . . . . . . ."

Page C-74                                                                  NEMISS.PRG
SET ORDER TO pipeparamu       &&   order   =   npdes+pipe+param-code+param -name UNIQUE
SET TALK ON
COPY TO npdes\nconcavg
SET TALK OFF
*   Separate records in working Concentration file into two separate files by
* original concentration units (i.e., one for units   = mg/l and one for units =
*   lbs/day).
SET ORDER TO
SET TALK ON
COPY TO npdes\nconcl9 FOR param units = “19“
COPY TO npdes\nconc26 FOR parm1units = “26“
SET TALK OFF
@ 12,O CLEAR
@ 11,56 SAY “Done”
*   Open empty average concentration file and two unit-specific files. Create
* index tags needed for linking.
@ 12,19 SAY “Averaging emissions across units          ...   11

USE npdes\nconcavg IN 1 ALIAS avg
INDEX ON npdes   +   param-code TAG facgaram
USE npdes\nconcl9 IN 2 ALIAS c19
SELECT c19
INDEX ON npdes + pipe-num + param-code         + param-name TAG pipeparam
USE npdes\nconc26 IN 3 ALIAS c26
SELECT c26
INDEX ON npdes + pipe-num + param-code         + param-name TAG pipeparam
* Average concentration file is selected. Average concentration file is linked
*   to both unit-specific files on NPDES number, pipe number. paramater code, and
*   parameter name.
SELECT avg
SET RELATION TO npdes + pipe-num + param-code + param-name INTO c19
SELECT c19
SET RELATION TO avg->npdes + avg->pipe num + avg->param-code +;
                avg->param-name INTO c76
SELECT avg
* Calculate weighted average emissions in lbs/yr. The weight fields indicate
* the number of months concentrations were reported in each set of units (mgfl
* or lb/day).
SET TALK ON
REPLACE ALL emiss WITH 365*(~19->weight*c19->emiss + c26->weight*c26->emiss)/;
                   (cl9->weight + c26->weight)
SET TALK OFF
@ 13,O CLEAR
@ 12,56 SAY “Done”

*   Close all data base files. The average concentration file now contains
*   one emission value for each NPDES number, pipe, and parameter.
CLOSE ALL
* Aggregate emissions to NPDES number level (across pipes) and enter in
* Emission file.


NEMISS.PRG                                                                        Page C-75
* Initialize variables.
processed    =   0          &&   Count number of average concentration records processed.
added = 0                   &&   Count number of Emission records created.
*    Open files: average concentration file and Emission file. Files are unlinked.
* Average concentration file is selected.
USE npdes\nconcavg IN 1 ORDER facgaram ALIAS avq
                              -
USE emission IN 2 ORDER source yr ALIAS em   & & order               =   npdes+param-code+year
* Display static portions of emission conversion status report
@    1,0 CLEAR
@    4,26 SAY "NPDES DATA CONVERSION"
@    5,22 SAY "EMISSION UPDATE STATUS REPORT"
@    9,19 SAY "Number of records processed:      of"
@    9,48 SAY "   0"
@    9,56 SAY reccount ("avq") PICTURE "9999"
@    11,19 SAY "Number of EMISSION records created:"
(3   11,56 SAY "   0"

*    Process all average concentration file records.
SCAN
* See if an Emission record already exists for the current NPDES number and
* parameter.
     SELECT em
     SEEK avq->npdes   +   avg->param-code   +   str (avq->year,4)
* If no Emission record is found, create one and fill it in from the average
* concentration record.
     IF .NOT. found()
       APPEND BLANK
       REPLACE em->source WITH "N",;
               em->source id WITH avq->npdes + avq->param-code,;
               em->fac id-WITH avq->fac id,;
               em->che% id WITH avq->chGm-id,;
               em->year-WITH avq->year,;
               em->water amt WITH avq->emiss
                                    -
       added = added + 1-
       @ 11,56 SAY added PICTURE "9999"

*    If an Emission record is found, add the emission amount from the average
* concentration file to the quantity already in the water amount field in the
* Emission file.
     ELSE
       REPLACE em->water-amt WITH em->water-amt + avq->emiss
     ENDIF

* Reselect the average concentration file for correct functioning of SCAN loop.
  SELECT avq
  processed = processed + 1
  (3 9,48 SAY processed PICTURE "9999"
ENDSCAN
* All average concentration records have been processed. Update status variable

Page C-76                                                                              NEMISS.PRG
* to indicate emission conversion is complete.
1-emiss = .T.
CLOSE ALL
* Delete working files. Files containing bad concentration and flow data are
* not deleted, but saved for possible future use.
@ 1,0 CLEAR
@ 9,12 SAY "Deleting working files    ...   I,




DELETE   FILE   npdes\nconcext.dbf   &&   working Concentration file
DELETE   FILE   npdes\nconcext.mdx   &&   working Concentration file index
DELETE   FILE   npdes\nflowext.dbf   &&   working Flow file
DELETE   FILE   npdes\nflowext.mdx   &&   working Flow file index
DELETE   FILE   npdes\nconcavg.dbf   &&   average concentration file
DELETE   FILE   npdes\nconcavg.mdx   &&   average concentration file index
DELETE   FILE   npdes\nconcl9,dbf    &&   mg/l concentration file
DELETE   FILE   npdes\nconc19,mdx    &&   mg/l concentration file index
DELETE   FILE   npdes\nconc26,dbf    &&   lbs/day concentration file
DELETE   FILE   npdes\nconc26.mdx    &&   lbs/day concentration file index
DELETE   FILE   npdes\nstatus.mem    &&   Saved status variables
DELETE   FILE   npdes\nchmauto.txt   &&   Final chemical matching status report
@ 9,39 SAY "Done"

* Display message that data conversion is complete.
@ 1,0 CLEAR
@ 9,25 TO 13,53 DOUBLE
@ 11,27 SAY "Data conversion complete."
@ 22,50 SAY "Press any key to continue . . .11
WAIT ""
RETURN   &&   nemiss
*   EOF: nemiss.prg




NEMISS.PRG                                                                  Page C-I1
...............................................................................
*                                                                                                                     *
* Filename: PWORKING.PRG                                                                                              *
* Author: Anne E . Crook, Research T r i a n g l e I n s t i t u t e                                                  *
* C r e a t e d : 5/11/92 L a s t updated: 1/24/92                                                                    *
* C a l l e d by:CONVERT                                                                                              *
* Comments: Creates working P r e t r e a t m e n t f i l e s f o r c o n v e r s i o n program, w i t h              *
*                 s t r u c t u r e extended t o i n c l u d e f i e l d s used i n p r o c e s s i n g . Also        *
*                 c l e a n s up some f i e l d s .                                                                   *
*                                                                                                                     *
...............................................................................
*   Initialize status variables.
1 f a c done = . F .                      & & F a c i l i t y matching done
1-chm-done    = .F.                       & & Chemical matching done
l -m i s s = .F.
  e                                       & & Emissions c o n v e r s i o n done

*   I n i t i t a l i z e other variable.

myear = s p a c e ( 2 )                   & & Year t o b e c o n v e r t e d

*   Ask f o r year being converted.

@ 1 , 0 CLEAR
SET CONFIRM ON
@ 9 , 2 0 SAY " E n t e r y e a r of d a t a b e i n g c o n v e r t e d : 1 9 "
@ 9,58 GET myear PICTURE "99"
READ
SET CONFIRM OFF

*   C r e a t e working d a t a f i l e PREEXT.DBF from s a v e d s t r u c t u r e PRESTRU.DBF

@ 1,0 CLEAR
@ 8,11 SAY " C r e a t i n g working f i l e               . . . . . . . . . . . ' I



CREATE p r e t r e a t \ p r e e x t FROM p r e t r e a t \ p r e s t r u

*   C r e a t e i n d e x on c i t y a n d f a c i l i t y name.      T h i s i n d e x w i l l be u s e d manually
*   t o match p r e t r e a t m e n t f a c i l i t i e s t o T R I S f a c i l i t i e s .

I N D E X ON c i t y   +   f a c-name TAG c i t y-f a c

*   Add r e c o r d s f r o m t h e o r i g i n a l d a t a f i l e t o t h e working d a t a f i l e .

SET TALK ON
          RM
APPEND F O p r e t r e a t \ p r e t r e a t . d a t    TYPE SDF
SET TALK OFF
@ 9 , 0 CLEAR
CLOSE DATABASE

@ 8 , 4 5 SAY "Done"

*   E n t e r y e a r b e i n g c o n v e r t e d t o working f i l e .

@ 10,11 SAY " E n t e r i n g y e a r i n working f i l e                  . . ."
USE p r e t r e a t \ p r e e x t
REPLACE ALL y e a r W I T H v a l ( " 1 9 " + myear)
@ 10,45 SAY "Done"
CLOSE ALL
RETURN & & p w o r k i n g . p r g
* EOF: p w o r k i n g . p r g

Page C-78                                                                                                  PWORKING, PRG
...............................................................................
*                                                                                                                           *
* Filename: PFAC.PRG                                                                                                        *
* Author:         Anne E . C r o o k , Research T r i a n g l e I n s t i t u t e                                           *
* C r e a t e d : 5/11/92 L a s t updated: 7/24/92                                                                          *
* C a l l e d by:CONVERT                                                                                                    *
* Comments: P r e t r e a t m e n t d a t a f a c i l i t y matching r o u t i n e . P r e t r e a t m e n t                *
*                 f a c i l i t i e s a r e matched t o TRIS f a c i l i t i e s i n WRMS based on t h e                    *
*                 Pretreatment I D .                                                                                        *
*                                                                                                                           *
*                 ! ! ! IMPORTANT ! ! !                                                                                     *
*                 The p r e t r e a t m e n t I D i s n o t r e p o r t e d t o TRIS. T h e r e f o r e , t h e u s e r     *
*                 must match f a c i l i t i e s and e n t e r t h e p r e t r e a t m e n t I D t o t h e W M    R S       *
*                 F a c i l i t y f i l e manually b e f o r e r u n n i n g t h i s p a r t of t h e c o n v e r s i o n   *
*                 program!            O t h e r w i s e , n o t a l l f a c i l i t i e s w i l l be matched. T o match     *
*                 f a c i l i t i e s manually, t h e u s e r s h o u l d f o l l o w t h e s e s t e p s :                 *
*                                                                                                                           *
*                 P r i n t t h e f a c i l i t i e s i n t h e working p r e t r e a t m e n t data f i l e ,              *
*                     i n d e x e d on c i t y and f a c i l i t y name ( t a g name i s CITY-FAC).                         *
*                                                                                                                           *
*                 B r o w s e t h e WRMS F a c i l i t y f i l e i n d e x e d on c i t y a n d f a c i l i t y name        *
*                      ( t a g name i s CITY-NAME) .                                                                        *
*                                                                                                                           *
*                 E n t e r p r e t r e a t m e n t I D i n PRE I D f i e l d o f W M F a c i l i t y f i l e f o r
                                                                                             R S                            *
*                     matching f a c i l i t i e s .           The pretreatment I D c o n s i s t s o f t h e P T OW        *
*                     NPDES number p l u s t h e f a c i l i t y I U number. Only newly added T R I S                       *
*                     f a c i l i t i e s s h o u l d be matched; t h e s e c a n be i d e n t i f i e d by check-          *
*                     i n g t h e Y A -ADDED f i e l d f o r t h e c u r r e n t r e p o r t i n g y e a r .
                                       E R                                                                                  *
*                                                                                                                           *
.................................................................................
*   Open working f i l e and WRMS F a c i l i t y f i l e . F i l e s are l i n k e d on p r e t r e a t m e n t
*   I D (POTW NPDES number p l u s f a c i l i t y I U number).

USE p r e t r e a t \ p r e e x t I N 1 ALIAS pre
USE f a c i l i t y I N 2 ORDER pre i d ALIAS f a c
SET RELATION TO potw-npdes 7 i u-num I N T O f a c

*   Copy f a c i l i t y I D from F a c i l i t y t o working p r e t r e a t m e n t d a t a f i l e f o r matching
*   Pretreatment IDS.

@ 1,0 CLEAR
@ 9,16 S Y " A s s i g n i n g FAC I D S t o matched f a c i l i t i e s
        A
                                        -                                           ...   11



SET TALK ON
REPLACE p r e - > f a c i d W I T H f a c - > f a c i d FOR fac->fac i d <> s p a c e ( 1 0 ) ;
        .AND. f a c - > y e a r -added <= pre->year .AND. potw-npdes <> s p a c e ( 9 )
SET TALK OFF

@ 10,o CLEAR
         A
I? 9,60 S Y "Done"

*   C l o s e f i l e s and r e o p e n working P r e t r e a t m e n t f i l e .

CLOSE ALL
USE p r e t r e a t \ p r e e x t I N 1 A L I A S pre

*   Mark unmatched f a c i l i t i e s i n working p r e t r e a t m e n t f i l e f o r d e l e t i o n .

@ 1,0 CLEAR
@ 10,16 S Y "Marking unmatched f a c i l i t i e s
         A                                                         .............,
SET TALK ON



PFAC. PRG                                                                                                         Page C-79
                        -
DELETE FOR fac i d = s p a c e ( l 0 )
SET TALK OFF
@ 1 1 , O CLEAR
@ 1 0 , 6 0 SAY "Done"

*   Pack working p r e t r e a t m e n t f i l e t o delete u n m a t c h e d f a c i l i t i e s .

@ 1 1 , 1 6 SAY " D e l e t i n g u n m a t c h e d f a c i l i t i e s   . . . . . . . . . . . . . ' I
SET TALK ON
PACK
SET TALK OFF
@ 12,O CLEAR
@ 1 1 , 6 0 SAY " D o n e "

CLOSE ALL

*   Update s t a t u s v a r i a b l e t o i n d i c a t e f a c i l i t y m a t c h i n g i s c o m p l e t e .

1 f a c done = . T .
@-22,T4 SAY " F a c i l i t y Match C o m p l e t e .            Press a n y key t o c o n t i n u e         ..."
WAIT " "

RETURN & & p f a c . p r g

*   EOF: pfac.prg




Page C-80                                                                                                           PFAC. PRG
...............................................................................
*                                                                                                                  *
* Filename : PCHEM. PRG                                                                                            *
* Author: Anne E . Crook, Research T r i a n g l e I n s t i t u t e                                              *
* Created: 5/11/92 Last updated:                                                                                  *
* C a l l e d by:CONVERT                                                                                          *
*   Comments: Chemical matching i s n o t n e c e s s a r y w i t h t h e P r e t r e a t m e n t d a t a ;       *
*             e a c h of t h e chemicals i s r e p o r t e d i n a s e p a r a t e f i e l d .   Chemical         *
*             I D S are a s s i g n e d i n t h e e m i s s i o n c o n v e r s i o n program module.             *
*                                                                                                                 *
...............................................................................
*   D i s p l a y message i n d i c a t i n g t h a t c h e m i c a l matching i s u n n e c e s s a r y .

@ 1,0 CLEAR
@ 9,21 TO 14,52 DOUBLE
I 11,23 SAY "It i s n o t n e c e s s a r y t o Match"
?
@ 12,23 SAY "Chemicals w i t h t h e s e d a t a . "
@ 22,50 SAY "Press any key t o c o n t i n u e                   . . ."
WAIT     ""


*   Update s t a t u s v a r i a b l e t o i n d i c a t e c h e m i c a l m a t c h i n g i s d o n e .

 -
1 chm-done        = .T.

RETURN & & pchem.prg

*   EOF: pchem.prg




PCHEM. PRG                                                                                                   Page C-81
...............................................................................
*                                                                                                                           *
*   F i l e n a m e : PEMISS.PRG                                                                                            *
*   Author:           Anne E . Crook, Research T r i a n g l e I n s t i t u t e                                            *
*   Created:          5/11/92           L a s t u p d a t e d : 7/31/92                                                     *
*   C a l l e d by:CONVERT                                                                                                  *
*   Comments: C o n v e r t s e m i s s i o n s d a t a from P r e t r e a t m e n t t o W M f o r m a t . Assumes
                                                                                                 R S                        *
*                     a l l f a c i l i t i e s h a s e been c o r r e c t l y matched.        ( A l l unmatched            *
*                     f a c i l i t i e s w e r e d e l e t e d i n t h e F a c i l i t y Matching s t e p . ) Creates      *
*                     u p t o 1 4 E m i s s i o n r e c o r d s from 1 working p r e t r e a t m e n t r e c o r d (one     *
*                     p e r c h e m i c a l ) , and 1 S t a t u s r e c o r d from 1 working p r e t r e a t m e n t        *
*                     record.                                                                                               *
*                                                                                                                           *
...............................................................................
*   Open d a t a b a s e s : S t a t u s , Emission, working p r e t r e a t m e n t d a t a f i l e , and
*   POTW f i l e ( c o n t a i n s names of POTWs by POTW NPDES n u m b e r ) . Working
*   p r e t r e a t m e n t d a t a f i l e is s e l e c t e d . Working p r e t r e a t m e n t f i l e and POTW f i l e
*   a r e l i n k e d on POTW NPDES number.
USE s t a t u s I N 1 A L I A S s t a t ORDER f a c i d-y r
USE e m i s s i o n I N 2 A L I A S e m
USE p r e t r e a t \ p r e e x t IN 3 ALIAS p r e
USE p r e t r e a t \ p o t w I N 4 ALIAS potw O D R npdes
                                                   R E
SELECT p r e
SET RELATION TO potw-npdes I N T O potw

*   I n i t i a l i z e variables.

added e m = 0                      &&   Count Emission r e c o r d s added
upd-   scat
          = 0                      &&   Count S t a t u s r e c o r d s u p d a t e d

*   D i s p l a y s t a t i c p o r t i o n s of e m i s s i o n c o n v e r s i o n s t a t u s report

@ 1 , O CLEAR
I 4 , 2 1 SAY "PRETREATMENT DATA CONVERSION"
 ?
@ 5 , 2 1 SAY "EMISSION UPDATE STATUS REPORT"
@ 9,15 SAY "Number of r e c o r d s p r o c e s s e d :         of"
@ 9 , 4 7 SAY "0"
@ 9,52 SAY r e c c o u n t ( " p r e " ) PICTURE " 9 9 9 9 "
@ 11,15 SAY "Number of EMISSION records added:"
@ 11,52 SAY "0"
@ 1 2 , 1 5 SAY "Number of STATUS r e c o r d s u p d a t e d : "
@ 12,52 SAY " 0 "

*   Process each p r e t r e a t m e n t r e c o r d .

SCAN      &&   pre

*   If t h e POTW f i l e h a s a name f o r t h e c u r r e n t POTW NPDES number, and t h e S t a t u s
*   f i l e h a s no POTW name e n t e r e d for t h e c u r r e n t d a t a y e a r , u p d a t e t h e S t a t u s
*   r e c o r d w i t h t h e POTW name.

I F potw->name <> s p a c e ( 3 0 )
   SELECT s t a t
   SEEK p r e - > f a c i d + s t r ( p r e - > y e a r )
   I F s t a t - > p o t w = space (30)
      REPLACE s t a t - > p o t w WITH potw->name
      upd s t a t = upd-stat + 1
      @ 1T,49 SAY upd-s t a t PICTURE "9999"
  ENDIF
ENDIF


Page C-82                                                                                                      PEMISS.PRG
* Add records to Emission and fill in data from working pretreatment file,
*   using flow and concentration to calculate emissions in pounds per year.
    SELECT em
*   Create Emission records only if the working pretreatment file has a nonzero
*   flow value, and the calculated emission value is greater than 0.5 lb/yr
*   (i.e., a value that will round to 1 or greater.)
    IF pre->mflow > 0
*   Biological Oxygen Demand
      IF pre->mbod * pre->mflow * 3.05 >= 0 . 5
        APPEND BLANK
        REPLACE em->source WITH "P"r ;
                 em->source id WITH str(pre->yearI4)+pre->potw-npdes+pre->iu -num,;
                 em->fac id-WITH pre->fac-id,;
                 em->year WITH pre->year,;
                 em-%hem id WITH "SBOD 03190",;
                 em->potw-amt WITH pre-Tmflow * pre->mbod * 3.05
        added em = added-em + 1
                           -
        I3 11,a9 SAY adde'ii em PICTURE "9999"
      ENDIF
* Chemical Oxygen Demand
      IF pre->mcod * pre->mflow * 3.05 >= 0 . 5
        APPEND BLANK
        REPLACE em-% ource WITH " P'I r ;
                                                  4)
                em->source id WITH str (pre->year, +pre->potw-npdes+pre->iu-num,     ;
                em->fac id-WITH pre->fac-id,;
                em->yeaF WITH pre->year,;
                em->chem id WITH 'ISCOD 03191",;
                em->potw-amt WITH pre-Ymflow * pre->mcod * 3.05
        added em = added-em + 1
                         -
        @ 1l,z9 SAY addea em PICTURE "9999"
      ENDIF
* Total Suspended Solids
      IF pre->mtss * pre->mflow * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "P",;
                  em->source id WITH str (pre->year,4 ) +pre->potw-npdes+pre->iu-num, ;
                  em->fac id-WITH pre->fac-id,;
                  em->yeaF WITH pre->year,;
                  em->chert id WITH "STSS 03192",;
                  em->potw-amt WITH pre-%flow   * pre->mtss * 3.05
        added em = added-em + 1
                            -
        I3 11,iTg SAY addea em PICTURE "9999"
      ENDIF
*   Oil
      IF pre->moil * pre->mflow * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "P",;
                em->source id WITH str(pre->year,4)+pre->potw -npdes+pre->iu-num,;
                em->fac id-WITH pre->fac-id,;
                em->year WITH pre->year,;
                                      -
                em->chem-id WITH "SOIL 03193",;


PEMISS.PRG                                                                      Page C-83
                 em->potw-amt WITH pre->mflow   *   pre->moil   *   3.05
        added em = added-em + 1
        (3 11,a9 SAY added- em PICTURE "9999"
      ENDIF
* Total Kjeldahl Nitrogen
      IF pre->mtkn * pre->Inflow * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "P", ;
                em->source id WITH str(pre->year,4)+pre->potw -npdes+pre->iu-num,;
                em->fac id-WITH pre->fac-id,;
                em->yeaF WITH pre->year, ;
                em->chem id WITH "STKN 03195",;
                em->potwIamt WITH pre-%flow   * pre->mtkn * 3.05
        added em = added em + 1
                         -
        @ 11,a9 SAY addea em PICTURE "9999"
      ENDIF
*   NO3
      IF pre->mno3 * pre->mflow * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "P", ;
                em->source id WITH str (pre->ye r,4)+pre- potw-npdes+pre->iu-num,;
                em->fac-id-V?ITH pre->fac-id,;
                em->vear WITH Dre->vear,;
                em->chem-id WITH "SN03 03241",;
                em->potw-amt WITH pre-%flow    * pre->mno3 * 3.05
        added em = added-em + 1
        @ ll,a9 SAY added-em PICTURE "9999"
      ENDIF
*   Total Phosphorus
     IF pre->mtp * pre->mflow * 3.05 >= 0.5
       APPEND BLANK
       REPLACE em->source WITH "P"r ;
               em->source id WITH str(pre->year,4)+pre->potw -npdes+pre->iu-num,;
               em->fac id-WITH pre->fac -id,;
               em->year WITH pre->year,;
               em->chem id WITH "STOTA03197",;
               em->potw-amt WITH pre->mflow * pre->mtp * 3.05
       added em = added-em + 1
                        -
       @ 11,a9 SAY addez em PICTURE "9999"
     ENDIF
*   Chloride

     IF pre->mchlor * pre-"low    * 3.05 >= 0.5
       APPEND BLANK
       REPLACE em->source WITH "P"r ;
                em->source-id WITH str(pre->year,4)+pre->potw npdes+pre->iu num,;
                em->fac id WITH pre->fac -id,;
                                                             -             -
                em->year WITH pre->year,;
                em->chem id WITH "SCHL003198",;
                em->potwIamt WITH pre->mflow * pre->mchlor * 3.05
       added em = added em + 1
                         -
       (3 11,a9 SAY addea em PICTURE "9999"
     ENDIF
*   Tin


Page C-84                                                                  PEMISS.PRG
      IF pre->msn * pre->Inflow * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "P", ;
                em->source id WITH str(pre->year,4)+pre->potw -npdes+pre->iu-num,;
                em->fac id-WITH pre->fac-id,;
                em->yeaF WITH pre->year,;
                em-%hem id WITH "STIN 03242",;
                em->potw-amt WITH pre-%flow   * pre->msn * 3.05
        added em = added-em + 1
                         -
        @ 11,a9 SAY addex em PICTURE "9999"
      ENDIF
*   Ammonia
      IF pre->mnh3 * p e " o
                       r-lw      * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH ''P"I;
                 em->source id WITH str(pre->year,4)+pre->potw_npdes+pre->i~-num,;
                 em->fac id-WITH pre->fac-id,;
                 em->yeaF WITH pre->year,;
                 em->chem id WITH "SNH3 03243",;
                 em->potw-amt WITH pre-%flow   * pre->mnh3 * 3.05
        added e m = added-em + 1
        @ ll,a9 SAY addea-em PICTURE "9999"
      ENDIF
* MMBAS (surfactants)
      IF pre->"bas * pre->mflow * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "P",;
                em->source id WITH str(pre->year,4)+pre->pot~-npdes+pre->iu_num,;
                em->fac id-WITH pre->fac -id,;
                em->yeaF WITH pre->year,;
                em->chem id WITH "SMBAS03244",;
                em->potw-amt WITH pre->mflow * pre->"bas * 3.05
        added em = added-em + 1
                         -
        @ 11,a9 SAY adde2 em PICTURE "9999"
      ENDIF
*   Color (note no units conversion; cannot be expressed as lbs/yr)
      IF pre->mcolor >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "P" r ;
                em->source id WITH str(pre->year,4)+pre->potw -npdes+pre->iu-num,;
                em->fac id-WITH pre->fac-id,;
                em->year WITH pre->year,;
                em-%hem  id WITH "SCOL003245",;
                em->potwIamt WITH pre->mcolor
*   No conversion based on flow; color units can't be converted to l b s , so left
*   in color units.
        added em = added em + 1
                         -
        @ 11,79 SAY addea em PICTURE "9999"
      ENDIF
*   Sulfide
      IF pre->msulf * pre->mflow * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "Pal;
                em->source-id WITH str(pre->year,4)+pre->potw-npdes+pre->iu-num,;


PEMISS.PRG                                                                   Page C-85
                em->fac id WITH pre->fac-id,;
                em->year WITH pre->year,;
                em->chem id WITH "SSULF03246",;
                em->potw-amt WITH pre->mflow * pre->msulf             *   3.05
        added em = added-em + 1
                         -
        @ 11,a9 SAY addea em PICTURE "9999"
      ENDIF
*   Fluoride
      IF pce->mfl * pre->mflow * 3.05 >= 0.5
        APPEND BLANK
        REPLACE em->source WITH "P", ;
                em->source id WITH str(pre->year,4)+pre->potw -npdes+pre->iu-num,;
                em->fac id-WITH pre->fac-id,;
                em->yeaF WITH pre->year,;
                em->them id WITH "SFLUOO3199",;
                em-zpotwIamt WITH pre->mflow * pre->mfl * 3.05
        added em = added em + 1
        @ ll,x9 SAY addea-em PICTURE "9999"
      ENDIF
    ENDIF
*   Update status report.
    @ 9,44 SAY recno ("pre") PICTURE "9999"
    SELECT pre
ENDSCAN     &&   pre
* Update status variable to indicate emission conversion is done.
1 emiss
 -          =    .T.
CLOSE ALL
* Delete working files.
@ 1,0 CLEAR
@ 10,12 SAY "Deleting working files    ...
                                         11


DELETE FILE pretreat\preext.dbf                 &&       working data file
DELETE FILE pretreat\preext.mdx                 &&       working data file index
DELETE FILE pretreat\pstatus.mem                &&       saved status variables
@ 10,39 SAY "Done"

@ 1,O CLEAR
@ 9,25 TO 13,53 DOUBLE
@ 11,27 SAY "Data conversion complete."
@ 22,50 SAY "Press any key to continue       . . . ' I

WAIT " "
RETURN   &&     pemiss
*   EOF: pemiss.prg




Page C-86                                                                          PEMISS.PRG
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*                                                                                                                                                                     *
*   F i l e n a m e : AWORK1NG.PRG                                                                                                                                    *
*   Author:           Anne E . Crook, Research T r i a n g l e I n s t i t u t e                                                                                      *
*   Created:          7/22/91 L a s t updated: 7/15/92                                                                                                                *
*   C a l l e d by:CONVERT                                                                                                                                            *
*   Comments: C r e a t e s working AIRS/NEDS f i l e s f o r c o n v e r s i o n program, w i t h                                                                    *
*                     s t r u c t u r e extended t o i n c l u d e f i e l d s used i n p r o c e s s i n g .                                                         *
*                                                                                                                                                                     *
...............................................................................
*   I n i t i a l i z e status variables.

1 f a c done = .F.                                &&    F a c i l i t y matching done
l c h m d o n e =. F         .                    &&    Chemical m a t c h i n g done
  -
l e m i z s = .F.                                 &&    Emissions c o n v e r s i o n done

*   I n i t i a l i z e other variable.

myear = space(2)

*   Ask f o r y e a r being converted.

@ 1,0 CLEAR
SET CONFIRM ON
@ 9,20 SAY " E n t e r y e a r of d a t a b e i n g c o n v e r t e d : 1 9 "
@ 9,58 GET myear PICTURE "99"
READ
SET CONFIRM OFF

*   Create working d a t a f i l e AIRSEXT.DBF from s a v e d s t r u c t u r e AIRSSTRU.DBF

@ 1 , 0 CLEAR
@ 8 , 2 0 SAY " C r e a t i n g working f i l e                        ..."
                              RM
CREATE a i r \ a i r s e x t F O a i r \ a i r s s t r u

*   Append from s o u r c e f i l e , o m i t t i n g h e a d e r l i n e s ( i n which t h e p l a n t I D i s
*   b l a n k o r c o n t a i n s nonnumeric g a r b a g e ) .

SET TALK ON
APPEND F OR M air\airs.dat                          TYPE SDF F R "0"
                                                              O                         $ p l a n t -i d
SET TALK OFF
@ 9 , 0 CLEAR
CLOSE DATABASE

@ 8,46 SAY "Done"

*   E n t e r y e a r b e i n g c o n v e r t e d t o working f i l e .

USE a i r \ a i r s e x t
@ 1 1 , 2 0 SAY " E n t e r i n g y e a r i n working f i l e                             ..."
REPLACE ALL y e a r WITH v a l ( " 1 9 " + myear)
@ 11,54 SAY "Done"

CLOSE ALL
RETURN & & a w o r k i n g . p r g

*   EOF: a w o r k i n g . p r g




AW0PXING.PF.G                                                                                                                                           Page C-87
...............................................................................
*                                                                                                                              *
* F i l e n a m e : AFAC.PRG                                                                                                   *
* Author:           Anne E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                          *
* C r e a t e d : 7 / 2 2 / 9 1 L a s t u p d a t e d : 7/15/92                                                                *
* C a l l e d by:CONVERT                                                                                                       *
* Comments: A i r d a t a f a c i l i t y m a t c h i n g r o u t i n e . A i r f a c i l i t i e s are matched                *
*                   t o T R I S f a c i l i t i e s i n WRMS b a s e d on t h e AIRS/NEDS p l a n t I D .                      *
*                                                                                                                              *
*                    ! ! ! IMPORTANT ! ! !                                                                                     *
*                   The AIRS/NEDS p l a n t I D i s n o t r e p o r t e d t o T R I S .             Therefore,'the             *
*                   u s e r must match f a c i l i t i e s and e n t e r t h e p l a n t I D t o t h e WRMS                    *
*                   F a c i l i t y f i l e manually b e f o r e r u n n i n g t h i s p a r t o f t h e c o n v e r s i o n   *
*                   program! O t h e r w i s e , n o t a l l f a c i l i t i e s w i l l be matched.                To         *
*                   match f a c i l i t i e s manually, t h e u s e r s h o u l d f o l l o w t h e s e s t e p s :            *
*                                                                                                                              *
*                   P r i n t t h e f a c i l i t i e s i n t h e working A I R S d a t a f i l e . The f a c i l i t y        *
*                       name, a d d r e s s , and c i t y are c o n t a i n e d i n a s i n g l e f i e l d , so t h e         *
*                        f i l e c a n n o t r e a l l y b e i n d e x e d i n an o r d e r t o ease m a t c h i n g .         *
*                                                                                                                              *
*                   Browse t h e WRMS F a c i l i t y f i l e . D i f f e r e n t i n d e x o r d e r s may be                 *
*                       u s e f u l f o r d i f f e r e n t f a c i l i t i e s ; change i n d e x o r d e r as needed.        *
*                                                                                                                              *
*                   E n t e r t h e A I R S c o u n t y code and p l a n t I D i n t h e A I R-I D f i e l d of                *
*                       t h e WRMS F a c i l i t y f i l e f o r matching f a c i l i t i e s .         The A I R I D          *
*                       c o n s i s t s of t h e f o u r - d i g i t c o u n t y code p l u s t h e f o u r - d i g T t        *
*                       p l a n t I D . O n l y n e w l y added T R I S f a c i l i t i e s s h o u l d b e matched;           *
*                       t h e s e c a n b e i d e n t i f i e d by c h e c k i n g t h e YEAR-ADDED f i e l d f o r            *
*                       t h e current reporting year.                                                                          *
*                                                                                                                              *
...............................................................................
*   Open working f i l e and WRMS F a c i l i t y f i l e .              F i l e s are l i n k e d on AIR-ID        (county
*   code p l u s p l a n t I D ) .

USE a i r \ a i r s e x t I N 1 ALIAS a i r
USE f a c i l i t y I N 2 ORDER a i r i d A L I A S f a c
SET RELATION TO c o u n t y + p l a n t -i d I N T O f a c

*   Copy f a c i l i t y I D from F a c i l i t y f i l e t o working A I R S d a t a f i l e f o r matching
*   A I R-I D S .

@ 1,0 CLEAR
@ 9 , 1 6 SAY " A s s i g n i n g F C-IDS t o matched f a c i l i t i e s
                                   A                                                    ..."
SET TALK ON
REPLACE a i r - > f a c i d W I T H f a c - > f a c i d FOR f a c - > f a c -i d <> s p a c e ( l 0 ) ;
           , A N D . fac->year-added          <= air->year
SET TALK OFF
@ 10,O CLEAR
@ 9 , 6 0 SAY "Done"

*   Mark unmatched f a c i l i t i e s i n working A I R S d a t a f i l e f o r d e l e t i o n .

(3 10,16 SAY "Markinq unmatched f a c i l i t i e s                 . . . . . . . . . . . . . . ' I

SET TALK ON
DELETE FOR f a c-i d = s p a c e ( l 0 )
SET TALK OFF
@ 11,O CLEAR
@ 1 0 , 6 0 SAY "Done"

*   Pack working A I R S d a t a f i l e t o delete unmatched f a c i l i t i e s .



Page C-88                                                                                                             A A PRG
                                                                                                                       F C     .
@ 11,16 SAY “ D e l e t i n g unmatched f a c i l i t i e s             .............        11

SET TALK ON
PACK
SET TALK OFF
(3 12,O CLEAR
‘
3 11,60 SAY “Done”

*   Update s t a t u s v a r i a b l e s t o i n d i c a t e f a c i l i t y m a t c h i n g is c o m p l e t e .

 -
1 fac-done         =   .T.

@ 22,24         SAY “ F a c i l i t y Match Complete.            Press any key t o c o n t i n u e           . . . ‘ I
WAIT       ””


CLOSE ALL
RETURN 66 a f a c . p r g

*   EOF: a f a c . p r g




       .
AFAC PRG                                                                                                                 Page C-89
...............................................................................
*                                                                               *
*   Filename: ACHEM.PRG                                                                                             *
*   Author:         Anne E . Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                               *
*   Created:        1 / 2 2 / 9 1 L a s t updated:                                                                  *
*   C a l l e d by:CONVERT                                                                                          *
*   Comments: Chemical matching i s n o t n e c e s s a r y w i t h t h e AIRS/NEDS d a t a ; each                  *
*                   of t h e 5 p o l l u t a n t s i s r e p o r t e d i n a s e p a r a t e f i e l d . Chemical   *
*                   I D S are a s s i g n e d i n t h e e m i s s i o n c o n v e r s i o n program module.         *
*                                                                                                                   *
**X****************************************************************************



*   D i s p l a y message i n d i c a t i n g t h a t c h e m i c a l matching i s u n n e c e s s a r y .

@ 1,0 CLEAR
@ 9 , 2 1 TO 14,52 DOUBLE
@ 1 1 , 2 3 SAY "It i s n o t n e c e s s a r y t o Match"
@ 1 2 , 2 3 SAY " C h e m i c a l s w i t h t h e s e d a t a . "
@ 22,50 SAY "Press any key t o c o n t i n u e                 .. .I'
WAIT " "

*   Update s t a t u s v a r i a b l e t o i n d i c a t e c h e m i c a l m a t c h i n g i s done.

1-chm -done = . T .

RETURN & & achem.prg

*   EOF: achem.prg




Page C-90                                                                                                    ACHEM. PRG
...............................................................................
*                                                                                                                             *
* F i l e n a m e : AEMISS.PRG                                                                                                *
* Author:           Anne E. Crook, R e s e a r c h T r i a n g l e I n s t i t u t e                                          *
* C r e a t e d : 1 / 2 2 / 9 1 L a s t updated: 7 1 1 5 1 9 2                                                                *
*   C a l l e d by:CONVERT                                                                                                    *
*   C o m m e n t s : C o n v e r t s e m i s s i o n s data f r o m AIRS/NEDS t o WRMS format.          Assumes              *
*                     a l l f a c i l i t i e s have been c o r r e c t l y matched. ( A l l unmatched                        *
*                     f a c i l i t i e s w e r e deleted i n t h e F a c i l i t y Matching s t e p . )  Creates             *
*                     u p t o 5 E m i s s i o n records f r o m 1 w o r k i n g A I R S record.                               *
*                                                                                                                             *
...............................................................................
*   O p e n WRMS E m i s s i o n f i l e and w o r k i n g A I R S data f i l e .    Working A I R S f i l e i s
*   selected; t h e f i l e s a r e u n l i n k e d .
USE e m i s s i o n I N 1 A L I A S e m
USE a i r \ a i r s e x t I N 2 A L I A S a i r
SELECT a i r

*   I n i t i a l i z e variables

added = 0                            &&   C o u n t E m i s s i o n records added

*   Display s t a t i s p o r t i o n s o f E m i s s i o n conversion s t a t u s report.

@   1 , 0 CLEAR
@   4 , 2 9 SAY " A I R S DATA CONVERSION"
@   5,25 SAY "EMISSION UPDATE STATUS REPORT"
@   9 , 1 5 SAY "Number of records processed:              of"
@   9 , 4 7 SAY "0"
@   9 , 5 2 SAY reccount ( " a i r " ) PICTURE " 9 9 9 9 "
@   1 1 , 1 5 SAY "Number of EMISSION records added:"
@   1 1 , 5 2 SAY "0"

*   P r o c e s s each A I R S record.

SCAN

*   A d d records t o E m i s s i o n f i l e and f i l l i n d a t a f r o m w o r k i n g A I R S f i l e ,
*   c o n v e r t i n g f r o m t o n s per year t o pounds per y e a r .
    SELECT e m

*   Particulates

    I F air->part > 0
       APPEND BLANK
       REPLACE e m - > s o u r c e   WITH "A"     r ;
                   em->source i d WITH s t r ( a i r - > y e a r , 4 )    +   air->county      +   a i r - > p l a n t -i d , ;
                  e m - > f a c id'WITH  air->fat-id,;
                  e m - > y e a F WITH air->year,;
                  em->chem i d WITH "APART03200", ;
                  em->stacE a m t WITH 2 0 0 0 * a i r - > p a r t
      added = added + 1           -
      @ 1 1 , 4 9 SAY added PICTURE " 9 9 9 9 "
    ENDIF

*   SO2

    I F air->so2 > 0
       APPEND BLANK


AEMISS.PRG                                                                                                          P a g e C-91
      REPLACE em->source WITH "A"r i
              em->source id WITH str(air->year,4) + air->county       +   air->plant-id,;
              em->fac id-WITH air->fac-id,;
              em->yeaF WITH air->year,;
              em->chem id WITH "AS02 03201",;
              em->stacF amt WITH 20073 * air->so2
      added = added + 1-
      @ 11,49 SAY added PICTURE "9999"
    ENDIF
NO2
    IF air->no2 > 0
      APPEND BLANK
      REPLACE em->source WITH "A"r ;
              em->source id WITH str(air->year,4)   + air->county + air->plant-id,;
              em->fac-id-WITH air->fac-id,;
              em->year WITH air->year,;
              em->chem id WITH "AN02 03202",;
              em->stacF amt WITH 2008 * air->no2
      added = added + 1-
      @ 11,49 SAY added PICTURE "9999"
    ENDIF
*   Volatile Organic Compounds (VOCs)
    IF air->voc > 0
      APPEND BLANK
      REPLACE em->source WITH "A", ;
              em->source id WITH str(air->year,4)   +   air->county   +   air->plant-id,;
              em->fac id-WITH air->fac-id,;
              em->year WITH air->year,;
              em->chem id WITH "AVOC 03203",;
              em->stacF amt WITH 20073 * air->voc
      added = added + 1-
      @ 11,49 SAY added PICTURE "9999"
    ENDIF
*   Carbon monoxide (CO)
    IF air->co > 0
      APPEND BLANK
      REPLACE em->source WITH "A",;
              em->source id WITH str(air->year,l)   + air->county + air->plant-id,;
              em->fac id-WITH air->fac-id,;
              em->yeaT WITH air->year,;
              em->chem id WITH "ACO 03204",;
              em->stacK amt WITH 2055 * air->co
      added = added + 1-
      @ 11,49 SAY added PICTURE "9999"
    ENDIF
* Update status report.
    @ 9,44 SAY recno("air") PICTURE "9999"
    SELECT air
ENDSCAN
* Update status variables to indicate emission conversion is done.
1-emiss   -   .T.


Page C-92                                                                        AEMISS.PRG
CLOSE ALL
*   Delete working files.
(3 1,0 CLEAR
I 10,12 SAY
 3              "Deleting working files   . , ."
DELETE FILE     air\airsext,dbf             &L     working data file
DELETE FILE     air\airsext.mdx             &&     working data file index
DELETE FILE     air\astatus.mem             &&     saved status variables
@ 10'39    SAY "Done"
@ 1,0 CLEAR
@ 9,25 TO 1 3 , 5 3 DOUBLE
@ 11,27 SAY "Data conversion complete."
@ 22,50 SAY "Press any key to continue        ...   11


WAIT " "
RETURN    &&   aemiss
* EOF: aemiss.prg




AEMISS.PRG                                                                   Page C-93
                    APPENDIX D

TOXICITY AND FATE DATA FOR RELATIVE INDEXING SCHEME
                                                LIST OF TABLES

                                                                                                              m
Table D-1. Toxicity Benchmarks for TRI Constituents                ..........................                  D-1

Table D-2. Toxicity Ratios for TRI Constituents             ..............................                     D-9
Table D-3. Toxicity Indices for TRI Constituents            .............................                     D-17

Table D-4. Surrogate Parameters of Mobility and Persistence for TRI Constituents                   ......     D-25

         Mobility and Persistence Quantifiers for TRI Constituents
Table D-5.                                                                          ...............           D-34




Note that the tables here may look somewhat different than new printouts of the toxicity data from dBase; the values were
originally developed i Excel and converted to dBase for compatibilitywith NCPPP software and ease i updating: however,
                      n                                                                              n
these tables were printed from the Excel spreadsheet.
,
Table D-1. Toxicity Benchmarks for TRI Constituents




formaldehyde
dinitrophenol, 2,4-


trichlorfon                                  52686
acetylaminofluorene,2-                       53963
nilrosodiethylamine, N-                      55185
benzamide                                    55210
nitroglycerin                                55630
carbon tetrachloride
              ~-                             56235
parathion                                    56382
dimethyl-hydrazine, 1,1-        ~___         57147
propiolactone. beta-                         57578
chlordane                                    57749
lindane                                 ~- 58899
                                           -~
nitros-tphol!ne,n-             . . . . -.
                               .      .    . 59892
aminoazobenzene, 4-                          60093
dimethylaminoazobenzene,4-                   60117
methyl hydrazine                             60344
acetamide     ~                    ~         60355
aniline                                      62533
thioacetamiclc-~                  ...~       62555
thiwrea           ~~        ~
                                             62566
dichlorvos                                   62737
methanamine. n-methyl-n-nitroso-             62759
carbaryl                                     63252
diethyl sulfate                        ~-. . 64675
methanol                                     67561
isopropyl alcohol(mfg strong acid process)   67530
acetone                                      67641
chloroform                                   67663
hexachloroethane                             67721
triaziquone            ~                     68768
butyl alcohol, n-                            71363
benzene                                      71432
trichloroethane, 1,1,1-                      71556
methoxychlor                       -~        72435
browmethane                                  74839
ethylene                                     74851
chloromethane
methyl iodide
                           - ~..           11   74873
                                                74884


                                                        WRMSTOX.XLS
Table D-1. Toxicity Benchmarks for TRI Constituents




                                                              WRMS TOX.XLS


                                                      l"l I
Table D-1. Toxicity Benchmarks for TRI Constituents




I '
saccharin (mfg)
C.I. F d Red 15

I
aminp-Z:?elhylanmraq~.none
pentachloronitrobenzene
                                      ,       82280
                                              82688




Initrophenol,2-
trinitrophenol, 2.46
methoxybenzenamine, 2-
phenylphenol, 2: .~
michleh ketone-_                              9094E
toluene-Z,6:dJSocyanate
naphthalene                      .-           9120:
quinoline


biphenyl, t ,l'-
aminobiphenyl, 4-
benzidine
nitr0biphenyi.b-                              9293:
benzoyl peroxide
safrole
acid, 2.4-D-
dimethylbenzene, 1,2-
methyiphenol, 2-
dichlorobenzene. 0-                           9550'
methylbenzena_m_ine,2L
trimethylbenzene, 1,2,4-
diaminotoluene, 2,4-
trichlorophenol. 2.4.5-
styrene oxide                                 9609:
 DBCP                        -            1   96121
 methyl acrylate                          I   9633:

                                                      WRMSTOX.XLS
    Table D-1. Toxicity Benchmarks for TRI Constituents
5
5
e
b




                                 I
       1     ._I


    lchloromethvl methvl ether       107302




                                                          WRMSTOX.XLS
Table D-1. Toxicity Benchmarks for TRI Constituents




lcvclohexane                                    1        110827




                                                         115071
                                                         115322

di (2-ethylhexyl)phthalate   .-   ~~~       -            117817

hexachlorobenzene

tolidine, o-                                             1 19937
anthracene
isosafrole                                            120581
cresidine. p-_ ~ . ~ -
_ _                                     ~
                                                      120718
benzenediol. 1.2-                                     I20809
tnchlorobenzene, 1,2.4- ____                        . 120821
                                                     ~




dichlorophenol, 2,4-                                  120832
dinitrotoluene, 2,4-                                  121142
dimethylaniline, n.n-                                 121697
diphenylhydrazine, 1,2-                               122667
benzenediol, 1,4-                                     123319
propwnaldehyde                                       123386
butyraldehyde                                        123728
 ?xn.,-~
!9ae14.                                              123911
dibromoletrafluoroethane[Halon 24021                 124732
tris (2,9dibromopropyl) phosphate                      ___
                                                     126727
chloro-1.3-butadiene, 1,3-                           126998,
perchloroethylene                                    127184
C.I. Vat
- Yellow 4                                           128665
dimethyl phthalate                                   131113


                                                                           WRMS_TOX.XLS




                                                                   l'! 1
Table D-1. Toxicity Benchmarks for TRI Constituents

                                                        -
I                                                       _______
                                                            CAS
                                                        -
                                                        132649
                                                         133062
                                                        -- -
                                                         133904
                                                         -~   ~




                                                         I34292
                                                         134327
                                                        _______
    cuplerron                                            135206
    nitrilotriaceticacid                                 139139
    thicdimiline. 4,4-     ~                        ~
                                                        ~
                                                         139651
    ethyl acrylate             .,.
                                ..   ~
                                                         140885
                                                        _______
    butylacrylate -~                                     141322
                                                        _______
    EEyleneimine                                         151564
    nitrosodiphenylam&p--~- .            ~
                                                         156105
                                                        _______
    & G m cyanacde                    .                  156627
                                                        _______
    hydrazine                        .                   302012
                                                        _______




I
                 ~               ~           ~~~~




    aigrin                                               309002
                                                        _______
     !?tae
    ?= eh n                    . ~~.-~                   334883
                                                        _______
    bromochlorodifluoromethane [~+iion~l211]             353593
                                                        _______
\carbonyl sulfide               -.                       463581
                                                        _______
                                                        ~
                                                         492808
                                                         505602
                                                        _______
                                                         510156
                                                        _______
    dinitrobenzene, o-                                   528290
    chloroacetophenone                              -   ~
                                                         532274
    dmitro-ocresol.4,6                                   534521
    dichloroethvlene. 1.2-                               540590


    I
    ethyl chlorolonnate
    dichlorobenzene. 1 3-
    dchioropropene. 1.    I       .
                                                         541413
                                                        _______
                                                         541731
                                                        _______
                                                          542756
                                                        _______




    I
    dichloromethyl ether        _                         542881
                                                        _______
    C.I. Base Green 4                                     569642
    loluene-2,4diisocyanate                               584849
    vinyl bromide                                       ~
                                                          593602
    dinitrotoluene, 2,6-                                  606202
    diaminoanisole, 2.4-                                  615054

    I
    nisoscd.-n-propylamine. .
    methyl isocyanate
                             0


    toluidine hydrochloride, o
                              ;
                              .     .                   ~
                                                          621647
                                                          624839
                                                        _______
                                                          636215
     hexamethylphosphoramide                              680319
     nilrosoN-methylurea.N-                               684935
     nitroso-N-ethylurea, N-                              759739
                                                          842079


                                                                           WRMSTOX.XLS


                                                                   l"l I
Table D-1. Toxicity Benchmarks for TRI Constituents



Name
nitrosodi-n-butylamine, n-
             ~




tetrachlowinphos
C.I. Basic Red 1                          989388

I
propane sultone
decabromwiphenyloxide
                       _.                1120714
                                         _______
                                         1163195
                                         _______


I
molybdenum trioxide
thorium dioxide
                                          3
                                         1 13275
                                         1314201

I
cresol (mixed isomers)
xylene [m*ed isomers)
                                         1319773
                                         _______
                                         I330207
                                         1332214
                                         _______

I
h~xachloronapnthalene
polychlorinated b:phenyls .-  .
al"m1num oxide (fibrods forms) .
                                .

                                     ,
                                         1335871
                                         _______
                                         1336363
                                         _______
                                         1344281
                                         _______
                                         1464535
                                         _______


I
trifluralin
  melhyl tefl-butyl ether
                                -        I582098
                                         _______
                                             1634044



I
  nitrofen                                   1836755
chlorothalonc                            ~
                                             1897456
I.:    Direct Black 38                       I
                                          937377
                                         _______
  Auometuron ~ _            _            2164172
                                         ~




  octachloronaphthalene                  2234131
                                         ~




                                         2303164
                                         _______
                                         2602462
                                         _______
                                         2832408
                                         _______
                                         3118976
                                         37615s
n~i0somelhylvinylamjne.N:                45494oc
                                         ~




C.I. Acid Green 3,                       __
                                         4680788
ammon'um nitrate I s o l u l ~ ~ q       6484522
                                         ~




                                         7429905
                                         ~




                                         7439921
                                         ~.
                                         ____
                                         7439965
                                         7439976
                                         ~-
                                         744002C
                                         _______
                                         7440224
                                         ~




                                         744028C
                                         _______
                                         744036C
                                         _______
                                         7440382
                                         _______
                                         744039:
                                         _______
beryllium                                7440417
                                         _______
                                         7440435

                                                             WRMS-TOX.XLS




                                                       l"l
Table D-1. Toxicity Benchmarks for TRI Constituents




I
vanadium-
zinc
                .

titanium tetrachloride
hydrocnlonc acid      .
Ipho*nc        ac,d              - . .
lhydrogen fluoride
 a"mia      ~                        ~~




 sulfuric acid             ~~~




 nitric acid
                            or
 p h o s p h o r u ~ l l o w white)
 selenium
 chlorine
 ammonium sulfate (solution)          -
                                    .~ -
 toxaphene


Iy?osote
 hydrazine sunate
 chlorine dioxide
                    __




osmium oxide Os04 fl-4)
dinitmtoluene (mixed isomers)
dichlorobenzene
toluenediamine
toluenediisacyanate




                                                      WRMSTOX.XLS


                    I            I
Table D-2. Toxicity Ratios for TRI Constituents


                                     -                           I
                                                                      CAS
Name                                                                 Number
formaldehyde .~~
~~~~~~~~~~~                          ~           ~~




dinitrophenol. 2.4-                                                   51285
mechlorethamine                                                       51752
ethyl carbamate                                                       51796
trichlorfon                                                           52686
acetylaminofluorene, Z - ~
    . .~
      ~
                                             ~                        53963
nitrosdiethylamine. N-                                                55185
benzamide                                                             55210
nitroglycerin
carbon tetrachloride
earamion          ~~~~~~~~




dimethyl-hydrazine, 1 ,I-
propiolacione, beta-                                  ~~   ~~




chlordane
       ~.                     ~~~




                                                                ~-

aminoazobenzene. 4-    .-
                      ~.
d&?thy'aminoazobenZene.   4-                                          60117
r r r h y l hydrazine        ~~~~~




acetamide                                . ---
                                                                      62533
thioacetamide            ~ . _ _                                      62555


I
thiourea
djChlONOs
~ChlONOs
methanamme,
methanamine, n-methyl-n-nitroso-
carbaryl
diethyl sulfate
                                                                 1
                                                                 1
                                                                 1
                                                                      62566
                                                                      62737
                                                                      62759
                                                                      63252
                          .-
methanol                                                              67561
isopropyl alcohol(mfgstrong add process)                              67630
"?tO_?_e                                                              67641
chloroform                           -                                67663
hexachloroethane                                                      67721
Lri-azLquone                                                          68768
butylaloohol,-                           ~
                                                                       1
                                                                      7 363
benzene       ~
                                                                      71432
                                                                       . -
trichloroethane, l,l,l-                                               71556
methoxychlor                                                          72435
bromomethane                                                          74839
ethylene                                                              74851
chloromethane                                                         74873
methyl iodide                                                         74884

                                                                                      WRMS_TOX.XLS



                                                                              I   I
Table D-2. Toxicity Ratios for TRI Constituents



                                                       Number
hyarogen cyanide                     ..-                74908
metnylene bromide                                       74953
                                                        75003
    -   ~                                      1        75014




I
!~

  -
~!!
?!?
 !b
  r
  dichlorobromomethaJ5~
  dichloroethylene, 1.1-
lcarbonic dichloride                           ! ~-
                                                  75445


I methyl aziridine. 2.
  propylene oxide
  oromotnfluoromethane
lbutyl alcohol, tert-
                               . . . ..
                                   .
                                 . . ..

                                      -A
                                          __        75558
                                                     .
                                               _ _ _75569
                                                     __
                                                    75638
                                                    75650

 dichlorodifluoromethane

                                                         76142
                                                         76153
 heptachlor
 hexachlorocycfopentadiene                               77474
 dimethyl sulfate
 eutyraldehyde
 propane 1,2-dichloro
 dichloropropene, 2.3-


Ibulyl alcohol. sec-
 methyl ethyl ketone
 trichioroethane, 1.1.2.
 trichloroethylene
                                          ..       .
                                                   1
                                                   1
                                                         78922
                                                       . . 78933
                                                         79005
                                                         79016
                                                         79061




 tetrachloroethane. 1,1.2,2-

 "'tropropane           ~




lcumene hydroperoxide                              1     80159

                                                                   WRMS-TOX.XLS
Table D-2. Toxicity Ratios for TRI Constituents




                                                  WRMSTOX.XLS
Table D-2. Toxicity Ratios for TRI Constituents




                                                  WRMSTOX.XLS
Table D-2. Toxicity Ratios for TRI Constituents




                                                  WRMSTOX.XLS
Table D-2. Toxicity Ratios for TRI Constituents




toluene-2.4diis~anate
Table D-2. Toxicity Ratios for TRI Constituents


                         .                      :hronic Toxicity !                                      Acute Toxicity           Ecological Toxicity
                                       -. .-
                                       PAC.        oral        oral ..               inhal    inhal         oral       inhai
                                                                                                                                                F/F~
                                                                     ~~




Name                                  Number     gdRfD      CSF/gm gmJNOAEL         gdRC     CSF/gm      grnAD5O gdLC5:          g d a q LC50
                                                                                             8.94E+00     6.99E-01                              1.99E+00
 1etrachloNinDhos                                                                                         2.10E-01 -6.88E-02         3.%E+01    1.CQEZ
1C.i. Basic Red 1                 1   989388                         8.05E+02


 molybdenum tnoxide
!thorium dioxide
                                      1313275
                                      1314201                        4.01E+CQ
                                                                                                          3.12E-01
                                                                                                                     -
                                                                                                                                 I
                                                                                                                         1.31E-011
                                                                                                                                                           I
                                                 3.46E-01                       !                        5.77E+O2
                                                 8.65E-03        I                                        19SF-01




                                      1464535

                                      1634044
lnitrofen                         I   1836755
chiorothaionil           ~




C.I. Direct Black 38
fluometuron          -~.              2164172
mlachloronaphthhakne         ~~




diallate                              23031€4
C.I. Direct Blue 6
    ~
                                      2602462
                                      2832408
 C.I. Solvent Oranae 7                3118976
1C.l. Food Red 5                  1   3761533




                                                                                                                                                WRMSTOX.XLS
Table D-2.Toxicity Ratios for TRI Constituents

                                                                Chronic Toxicity           I                                   Acute Toxicity       Ecological Toxicity
                                                   CAS             oral   -     -
                                                                               Oral                       inhal        inhal      oral        inhal
                                                                                                                                               --                   I
    Name                                          Number         gdRfD      CSFlgm gdNOAEL               gdi3fC       CSF/gm    gmlLD50 gdLC50 g d a q LC5ol BCF/gm
chromium
~                                    -            7440473       . 3.46E+00                               5.39E+03 4.47E+01         3.05E+01
cobalt----~-~                                     7440484                                                .
                                                                                                         -                          1.36E-01
copper                        ~~~~                7440508   ~                     -                                                2.40E+O2
vanadium
    .        ~~~~         ~                       7440622        2.47E+W                                                           1.42E+01
zinc                                              7440666        8.65E-02




                                                                                                                                                                    -
    diniirotoluene (mixed isomers)               25321146                                 5.67E+02                                                     ___               9.37E-01
    dichlorobenzene
    toluenediamine
                                                 25321226
                                                 25376458
                                                                                     I    8.23E-04
                                                                                                     I
                                                                                                                  -                3.11E+W
                                                                                                                                                              1.97E+W~

    toluenediisocyanate                          26471625                                 3.WEt02                                  2.03E-01        1.49E-02
    diaminoanisoie sulfate, 2 , 4                39156417                                 2.76E-02
                                                                                      I              I
                                                                                                i                                              I          I         I
                                                                                                                                                                                I
                                               I          I            I            I                           1              I
    Note: Constituents are shaded to indicate that the NOAEL is the driving factor in the chronic toxicity indices.
Table D-3. Toxicity Indices for TRI Constituents




                                                   ______~


                                                   ~     ~




                                                               ~
                                                             ~~p




                                                                   WRMS_TOX.XLS
          Table D-3. Toxicity Indices for TRI Constituents

                                                                                                          ~   ~-CAS.~             Air Toxicity Indices
                                                                                                                                             .~
    Name                                                                                                       Number             Chronic [ Acute
hydrogen cyanide                                                                 ~   ~~        ~~   ..~           74908
methylene bromide             ~~~~~~~                                                                         ~   74953
chloroelhane                                         ~~~~                                                         75003
vinyl chloride.                                             ~                                                     75014
%
!!
 S
al!!              .                                                                       ~~                      75058
acetaldehyde~

                       ~~~~             ~~~~~~~~~~
                                                                                                                  75070
dichloromethane ~~~~                                                                                              75092
carbon disulfide
    ~~~           ,..                                           ~~
                                                                                                                  75150
oxirane-.      ..  _~                                           ~~   ~~~                                          75218
    bromoform._.                                                                                                  75252
    dichlorobronwmethane            ~~~~~
                                                                                                                  75274
                                                                                                                   __
    dichloroethylene, 1, I -                                                                                      75354
    carbonic dichloride                                                                                           75445
    methyl aziridine, 2-                                                   ~~~                                    75558
    propylene oxide                                                                                               75569
    bromotrifluoromethane                                                                                         75638                       2.71E-04
    butyl alcohol, lert-                                                                                          75650
    trichloroRuorome$ane~-                                                                                        75694
    dichlorodifiuoromethane                                                                                       75718
    frwn 113                                                                                                      76131
    CFC-114            ~~
                                                                                                                  76142
    chloropentafluoroezane(CFC-115)                                                                               76153
    heptachlor                                                                                                    76444
    hexachlorocyclopentadiene                                                                                     77474
    dimethyl sulfate                                                                                              7777
    isobutyraldehyde                                                                                              78842                       2.61E-03
    propane 1.2-~~hdy~--,                                                                                         78875
    dichloropropene, 2.3-                                                                                         78886                       3.33E-02
~
    butyl alcohol, sec-                                                                                           78922
    methyl ethyl kelone
                  -.                                                                                              78933
    trichbroelhane,J L Z -                                                                                        79005
    lrichlormthylene                                                                                              79016                       5.47E-03
    acrylamide                                                                                                    7903
    acrylic acid
    - .                                                                                                           79107           ~-
                                                                                                                                  3.59E+01    1.95E-02
    chioroacetic acid                                                                                             79118
~

                                                                                                                                             .
    peracetic acg_-~~~_.-._                                                                                       79210
    tetrachloroethane, 1,1,2.2-                                                                                   79345
    dimethylcarbamyl chloride                                                                                     79447
    nilropropane. 2-                                                                                              79469
    isopropylidenediphenol,4.4-                                                                                   80057
    cumene hydroperoxide                                                                                          80159                       5.58E-01



                                                                                                                                                             WRMS_TOX.XLS


                                                                                                                          l"l 1                          I
                                                                                                                                                         I
                                                                                                                                                              '
                                                                                                                                                              1
    Table D-3. Toxicity Indices for TRI Constituents

I                                I           _.._
                                             CAS      ___ Water Toxicity Indices               Soil Toxicity Indices         Air Toxicity indices
    Name                         I          Number     Chronic   1    Acute     I Ecological   Chronic    1  Acute           Chronic   1    Acute
    methyi methacrylate                       80626                                            2.16E-01 N E + 0 0
    saccharin (mfg)                   81072
    C.I. Food Red 15                  81889                                                    1.64E-02       9.46E-01                     -
                                                                                                          I
                                                                                                                                            ~~




    amino-2-me!hyEEraquinone          82280
    pentachloronitrobeEez       __~~
                                      82688
    diethyl phthalate                 84662
                                   .___
    butyl phthalate, n-               84742
    phthalic anhydride-. . .
                         .            85449
    butyl benzyl phmalate             85687
                                       ~~




    nitrosodiphenylamine, n-       ~~
                                      86306
    xyiidine, 2.6-                    87627
    hexachlorobutadiene               87683
    pentachlorophenol                 87865
    tnchlomphenol, 2.4,6-             88062
    nitrophenol, 2-                   88755
    trinitrophenol, 2.4,6-            88891                                                                                                      -
    methoxybenzenamine,2-             9oo4a                                                    4.03E-M        4.19E-01                 I
    phenylphenolc                     90437                                                    4.48E-03   1   4.19E-01   I
    michler's ketone                  90948                                                               I              I             I
    tguzne-Z,&diisocyanate            91087
    naphthalene                       91203
    quinoline                         91225
    naphthylamine, beta-              91598
    dichlorobenzidine.Q    -          91941
    biphenyl, 1,l'-        ,.         92524
    amirwbiphenyl, 4-             -~  92671
    benzidine                         92875
    nitrobiphenyl, 4-                 92933
    benzoyl peroxide                  943%                           1.09E-01
    safrole                        ~- 94597
    acid, 2.4-D-                      94757
    dimethylbenzene, 1.2-                ~
                                   ~ 95476                _           _
    methylphenol, 2-                  95487
    dichlorobenzene,e                 gssoi
    methylbenzenamine, 2-             95534
    trimethylbenzene. 1,2,4-          95636
    diaminotoluene, 2,4-              95807
    trichlorophenol. 2,4,5-           95954
    styrene oxide                     96093
    DBCP                              96128
    methyi acrylate                   963s



                                                                                                                                                     WRMSTOX.XLS
Table D-3. Toxicity Indices for TRI Constituents

                                                                         _
                                                       Air Toxicity Indices   _ ~
                                                       Chronic    I  Acute
                                                                  I
                                                   -----t
                                                   1.20E+O0           8.50E-01

                                                                      4.09E-01
                                                                      ~ _ _ _




                                                       1.08E-02
                                                                      7.47E+00
                                                                      3.78E+M


                                                   = 1=1.66E-01

                                                   5.39E+02           4.29E+W




                                                                  t-

                                                       5.39E-01

                                                       8.94E-01



                                                   __
                                                       1.34E-01        ~~-
                                                   ~




                                                                                     WRMS_TOX.XLS
                                                                                      I

                                                                                 I    1
 Table D-3. Toxicity Indices for TRI Constituents

                                    .        CAS           Water Toxicity Indices         Soil Toxicity Indices     Air Toxicity Indices
Name                                        Number     Chronic 1 Acute     1 Ecological   Chronic    1   Acute      Chronic 1 Acute
                                                                                                                               I
benzene, m-dLmethyli       ~~~




(2-chlom-IImethy!e~hy!)eme!._bis-
                                              108383

                                              108601
                                                        ..
                                                       ..
                                                                                                                      : 1
                                                                                                                    3.59E-02



toluene                                       108883
chlorobenzene                                                                                                       5.39E-01
PhenOL                 ~                      108952
methoxyetha?L?-~~~~
 ethoxyethanol, 2-
lcvclohexane                            I     110827                                      3.73E-02       6.60E-02




                                                       1.86E-02                1.OBE+OO   1.86E-02
                                                                                          8.05E-01
                                                                                                     I
                                                                                                         1.46E+00   a=             1.53E-01




                                                                                                                     -=
                                                                                                                    =d
                                                                                                                    2.23E+00       1.82E+01




                                                                                          4.83E-02
                                                                                                         7




                                                                                                                    8.94E-01        _______


                                                                                          1.50E+00       5.95E-01




                                                                                                                                              WRMSTOX.XLS
       Table D-3. Toxicity Indices for TRI Constituents

                                  I    CAS             __   Water Toxicity Indices              Soil Toxicity Indices     Air Toxicity Indices
                                  I                              1               1                         1
  ~~                                           ~




      Name                            Number            Chronic    Acute      Ecologica         Chronic       Acute       Chronic   1   Acute
                                                                                                           I



  C --
   En~                        .
                                                                                                                          --~
                                                                                                                                  +
                                                                                                                             2.06E-02


                                                                                                                                    L
       ~




  cupferron                             135206                                                             1 4.22E+00
  nitrilotriacetic acid                                                                         2.01E+00       7.63E-01
  thiodianiline. 4,4-
                                                                                                                                        8.56E-02
      butyl acrylate                                                                                           9.32E-01                 5.34E-02
                                                                                                                                        7.64E+M




  %?!!??e                               492808                                       I.55E+01
  mustard gas                           505602                                3.00E-01
  chlorobenzilate                       510156 8.65E-01              1.20E+W 6.90E+01
  dinitrobenzene. o-                    528290 4.32T+01                       3.29E+Ol
  chloroacetophenone                    532274                       1.68E+01 1.33E+OC
  dinitroocresol, 4,6                   534521 4.32E+01              t.20E+02 9.09E+01
                                                                                                               ,ll;;~;;
  I
  dichlomethylene, t,2-

      dichiombenzene, 1 , s       I     541731
                                               8.09E-02

                                                   I
                                                                 1
                                                                 I
                                                                                 1
                                                                     1.09E+W 3.86E-01
                                                                     3.11E+W     1
                                                                                 1
                                                                              1.64E+01
                                                                                                8.09E-02   ~




                                  1                I
                                        542756 5.nE+01           1               1
                                                                     1.79E+W 5.87E+OC
                                                                 1               I
  C.I. Base Green 4
  toluene-2,4-diisocyanate        I
                                        542881 I4.72E+02
                                        5696421 .
                                        584849 900E+02
                                                                 I     ,
                                                                     145E01
                                                                               ---4.79E+Oi
                                                                     4.WE+00 1.64E-01

                                                                                     1.20E-01   9.00E+02       7.666
  vinyl bromide
  dinitrotoluene. 2,6-
  diaminoanisole. 2.4-                                                         l.OlE+OI 1.82E+00
                                                   I
i '
  nitrosodi-n-propylamine. n-
  methytgEpaate.
  toluidine hydrochloride, 0-
  hexameihylphosphoramide
  nitroso-N-methylurea, N-
                                        621647 1.65E+01 1.75E+00 z . ~ ~ E - E
                                        624839
                                        636215
                                                   I
                                                   I
                                                         1.63E+01
                                                         2.84E-Xp
                                        680319 8.75E-04 3.32E:Ol
                                                                 I
                                                                 1
                                                                 1
                                                                                 j
                                                                                 1
                                                                                        2.84E-01
                                                                     3.54E-00 8.75E-04 3.32E-01
                                        684935 2.36E+01 17.63E+00 1 . 7 1 E ?.36E+01                       j7.63E+oo
  nitroso-Kethylurea, N-                759739 2.01E+01 2 . 8 0 k E- 4.48E-02 ?.01E+01 2.80E+W
  C.I. Solvent Yellow 14                642079                   r   6.90E+01          7-


                                                                                                                                                    WRMS_TOX.XLS


                                                                 [I!       I                                                                         I
                                                                                                                                                   ; I
  Table D-3. Toxicity Indices for TRI Constituents


                     -~.                               Water Toxicity Indices- -        Soil Toxicity indices   1_   Air Toxicity indices
                                                   Chronic    1
                                                              Acute 1 Ecological        Chronic I Acute         I    Chronic 1 Acute

tetrachloNinphoS                        961115                                                                                 ~~~
                                                                                                                                     6.88E-0;
C.I. Basic Red 1                        989388     8.05E+02




                                                   c
                                ~




                                        1313275
bmrium dioxide                      I   1314201    4.01E+00
 !resol (mixed isomers)                 1319773
 xylene (mix&xdLc!mers)                 133020_!
asbestos(fri?ble_)- __
hexachloronaph-ca!ene
polychlorinated biphenyls
aluminum oxide (fibrousforms)
            ..
            2
            ~
            -
            ,-
bioxirane, 2:
                      . __
                                        1332214
                                        1335871
                                        1336363
                                        1344281
                                        1464535
                                                   I-1-
                                                   1.89E+01       5.97E-02

                                                            1.OBE+Ol 8.72E-04
                                                                             1.45E+04   1.89E+01

                                                                                        1.08E+01
                                                                                                    5.97E-02

                                                                                                                                     2.41E+OI
trifluralin                             1582098    2.31E+00 8.39E-02 2.80E+02 2.31 E+OO 2.73E-01                                     2.73E-0


chiorothalonil _ _ _ ~
_____
                                    I   1634044
                                        1836755
                                        1897456
                                                            2.10E-01
                                                   4.03E+01 1.13E+00
                                                   1.15E+00 8.39E-02
                                                                     1.67E-01
                                                                     5.79E+02 4.03E+01 1.13E+00
                                                                     1.62E+03 1.15E+00 2.46E+00                                      2.46E+Ol
C.I. Direct Black 3 8                   1937377    2.03E+01 l.lOE-01 l.lOE-01 2.03E+01 1.10E-01
tluometuro!__-~ -                       2164172    1.33E+W 5.54E-01  1.57E+00 1.33E+00 5.ylE-01
octachloronaphthalene                   2234131                      3.31E+05
                                        2303164    1.42E-01 2.12E+00 1.52E+01
C.I. Direct Blue 6                      2602462    1.91E+01 9.58E-02 1.lOE-01
                                        28324W                       4.42E+00
                                        3118976                      7.34E+02
1C.l. F w d Red 5
 ~~~    ~~~   ~~~                   I   37615%     1.61E-01 1.7ZE-01
                                                            3.50E+Ol 2.46E-02
                                                            4 . 1 a
                                                            3.78E-01 2.58E-01

llead                                   7439921
                                        7 4 E


                                                                                        3.46E+W
pallium                                 744028C
antimony                                744036C
arsenic                                 7440382
barium                                  744039:    2.47E-01                  3.99E-02
beryllium                               744041i
cadmium                                 7440436



                                                                                                                                                WRMSTOX.XLS
      Table D-3. Toxicity Indices for TRI Constituents

                                                                                        Soil Toxicity indices     Air Toxicity Indices
                                                                                        Chronic    I   Acute




zinc
titanium tetrachloride                                                                  3.21E+01 1.91E+00
hydrochloric a c x                                                                                                I .54E+00   1.64E-01
 h s ! ?i a%. ~.~
p o P? rc ! ! .                   ~




hydrogen fluoride
~~~~~~                  ~~            -
ammonia
s A f c c acid


I
nitric acid
phosphorus (yellow or white)
selenium
chlorine
ammonium sulfate (solution)
                                                                                        4.03E42        8.99E-01

toxaphene                             -
creosote                          __
 hydrazine s u l f a t e           __
 chlorine dioxide
 zineb            ~~~




               ~-
 C.I. Direct Brown 95
 nitrosonomiwtine, N-
  ~




 osmium oxide Os04 (T-4)                                                                           L
 dinitrotoluene (mixed isomers)                                                         5.67E+02
 dichbmbenzene                                                                                     I
 toluenediamine                                                                         8.23E-04 3.1 1 E+OO
 toluenediisocyanate                                                                    3.WE+02 2.03E-01                      1.49E-02
                                                                                        2.76E-02
                                          __
                                          ,ndicate a NOAEL as mesouice of me indices.
Table 0-4. Surrogate Parameters of Mobility and Persistence for TRI Constituents




                                                                                   FATEDATA.XLS
FATEDATA.XLS
FATEDATA.XLS
Table D-4. Surrogate Parameters of Mobility and Persistence for TRI Constituents




 ~                    ~~~   -
initrotoluene. 2,4-




nitrosdiphenylamine.p-




                                                                                   F rTEDA1TA.XLS
Table D-4. Surrogate Parameters of Mobility and Persistence for TRI Constituents

                                    Vapor              Adsorp. Biodeg.
                                              Solubility       .~
                                                                ~
                                                                            BOD        Adjusted BOD .             Res.    Air
                          CAS      Pressure   in Water   Coef.    cat. .   Half-life      Half-life~~            Times Half-times
                 Name    Number (mm of Hg)   (mg/L)    (log Koc)           (days)         (days)        log P -(days)    (days)
dinitro-0-cresol,4,6      534521   1.05E-06 2.95E+02        2.73            3-17            1             2.56          6.90E+07
~-
dichloroethylene, 1,2-
      .                   540590  6.12Ei01 8.21E+03         2.16            >I5             1             1.51          2.10E+00
emvl chloroformate        541413  5.27E+Ol       insol                       >5             1                           6.90€+07




                                                                                                                                    FATEDATA.XLS
Table D-4. Surrogate Parameters of Mobility and Persistence for TRI Constituents




                                                                                       FATEDATA XLS


                                              1'1 I                                I
                                 ~~~~
                                                                                           Mobility                  !          Persistence

_~                                                                       __~      ~
                                                                                                 Vapor      Solubility ___ _______
                                                                                                                  -~   Adsorp. Biodeg.  BOD             Adjusted BOD -
                                                                                                                                                        ~_____
                                                                                                                                                                                   Res.    Air ~




      ~~~

                                    ~~           ~~~
                                                                          CAS                   Pressure    in Water    Coef.    cat.  Half-fife           Half-life_ _ ~ ~ _ _ _ ~ ~
                                                                                                                                                        ~---___                   Times -~
                                                                                                                                                                                  ~
                                                                                                                                                                                         Half-times
                   Name                                                  Number                (mm ofHg)-    (mg/L) (log Koc)          (days)               (days)        log P   (days)  (days)
creosote    ~~~~                         ~                                8001589                    -~     insol                                                             1           ..   ~.
                                                                                                                                                                                                   6.90E+07
hydrazine sulfate                                                        10034932                     3.42E+@4                                                                                     6.90E+07
~~~
                                                                                                                                                                                      .
chlorine dioxide _~                                                      10049044                     3.01E+03                  -                                                                  6.90€+07
 ~~                                          _                       ~                                                                                              -
zineb                                                                    12122677                7.63E-08   1.06E+01     3.09                 23       ..
                                                                                                                                                        .                       6.90E;G
maneb                                                                    12427382                7.63E-08     m o d 2_                                                          6.90E+07
                                                                                                                                                            ~ _ ~ _ _ ~ - . ~ ~ _ _ ~
                                                                                                                                                            _   _
                                                                                      ~


                         ~~~~~                         ~        ~~                        ~~                               _       _     _         _
ELDirect Brown 95                                                        16071866
                                                                                                                                              c15               1
                                                                                                                          -                   2-16              1   .
                                                                                                                                                                    ..
                                                                                                                         2.39


                   ~~~~~~~                                 ~~
                                                                         25376458




                                                                                                                                                                                                              FATEDATA.XLS
       Table D-5. Mobility and Persistence Quantifiers for TRI Constituents




                                                               i   0.75   I   0.75




Page D-34
Table D-5. Mobility and Persistence Quantifiers for TRI Constituents




                                                                       Page D-35
Page D-36
Table D-5. Mobility and Persistence Quantifiers for TRI Constituents




                                                                       Page D-37
Page D-38
Page D-39
       Table D-5. Mobility and Persistence Quantifiers for TRI Constituents




Page D-40
                       APPENDIX E

RELATIVE INDEXING SCHEME PROGRAM CODE AND FILE ST'RUCTURES
                                            LIST OF PROGRAM FILES

                                                                                                                    &g
Tox-upd.prg       ........................................................                                          E-1'
Fate-upd.prg      ........................................................                                          E-6



                                                   LIST OF TABLES

                                                                                                                    &g
Table E-1. File Structure for Benchmur.dbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       E-9
Table E-2. File Structure for Rutios.dbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     E-9
Table E-3. File Structure for Indices.dbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    E-9
Table E-4. File Structure for Geomeuns.dbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          E-IO
Table E-5.File Structure for Fute.dbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       E-10
Table E-6. File Structure for Mobper.dbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          E-10
* Main Program TOX-UPD.PRG
* Author: Patrick Graham, Research Triangle Institute
*   Calculates the relative toxicity indices from the toxicity benchmark data
SET TALK OFF
CLEAR ALL
TEXT
      ......................................................
                  Toxicity Indices Calculator
      .....................................................
            Please wait while the ratios are calculated
ENDTEXT
* Calculation of toxicity ratios
USE \wrms\toxfiles\benchmar IN 3 ORDER cas ALIAS bench
USE \wrms\toxfiles\geomeans IN 2 ALIAS geo
USE \wrms\toxfiles\ratios IN 1 ALIAS ratios
SET RELATION TO cas INTO bench
SCAN WHILE .NOT. EOFO
   REPLACE rfd r WITH rfd(bench->rfd)
   REPLACE oraicsf r WITH ocsf(bench->oralcsf)
   REPLACE noael r-WITH noael(bench->noael)
   REPLACE rfc r-WITH rfc(bench->rfc)
   REPLACE inhFsf r WITH icsf(bench->inhalcsf)
   REPLACE ld50 r-WITH ld50(bench->oralld50)
   REPLACE lc50-r WITH lc50(bench->inhallc50)
   REPLACE aqlcF0 r WITH aqlc50(bench->aqlc50 -f,bench->aqlc50-w)
   REPLACE bcf-r WITH bcf(bench->bcf)
ENDSCAN
BLANK FIELDS rfd r FOR rfd r=O
BLANK FIELDS oraicsf r FOR-oralcsf-r=O
BLANK FIELDS noael r-FOR noael r = O
BLANK FIELDS rfc r-FOR rfc r=O-
BLANK FIELDS inhcsf r FOR rnhcsf r=O
BLANK FIELDS ld50 r-FOR ld50 r=O-
BLANK FIELDS lc50-r FOR lc50-r=0
                                 -
BLANK FIELDS aqlc50 r FOR aqic50 r=O
BLANK FIELDS bcf-r FOR bcf-r=O
* Calculation of Toxicity Indices
TEXT
            Please wait while the indices are calculated.
ENDTEXT
CLEAR ALL
USE \wrms\toxfiles\ratios IN 2 ORDER cas ALIAS ratios
USE \wrms\toxfiles\indices IN 1 ALIAS indices
SET RELATION TO cas INTO ratios
SCAN WHILE .NOT. EOFO
   REPLACE wat chr WITH water-chr(ratios->rfd-r, ratios->oralcsf r,;
                                              -                   -
           ratTos->noael r)
   REPLACE wat acute WITH water acute (ratios->ld50 r)
                  ~   ~   ~~




   REPLACE wateco WITH water eco (ratios->aqlc5O-rTratios->bcf-r)
   REPLACE soii chr WITH s-chr(ratios->rfd-r,ratios->oralcsf  r,;
           ratios->noael-r, ratios->rfc-r, ratios->inhesf r)-
   REPLACE soil acute WITH s acute(ratios->ld5O-r,ratios-~lc5O-r)
   REPLACE air-chr WITH a-chy(ratios->rfc-r,ratios->inhcsf-r)

.~     ~~




TOX-UPD .PRG                                                           Page E-1
   REPLACE a i r-acute WITH a-a c u t e ( r a t i o s - > l c 5 0-r)
ENDSCAN
BLANK F I E L D S w a t c h r FOR w a t c h r = 0
BLANK FIELDS w a t - a c u t e FOR w;i;t acute=O
BLANK FIELDS wat-eco FOR wat eCo-0
BLANK F I E L D S s o i i c h r FOR soT1 c h r = 0
BLANK FIELDS s o i l - a c u t e FOR s o y 1 a c u t e s o
BLANK F I E L D S a i r zhr FOR a i r chrzO
                            -
BLANK F I E L D S air-acute FOR aTr-acute=O

*   C o p y i n d i c e s t o CHEMICAL.DBF

TEXT
           Please w a i t w h i l e t h e i n d i c e s are copied         ...
ENDTEXT

CLEAR ALL
USE \ w r m s \ t o x f i l e s \ i n d i c e s I N 2 ORDER cas A L I A S i n d i c e s
USE \ w r m s \ c h e m i c a l I N 1 ORDER chem i d A L I A S chem
SET RELATION TO cas n u m INTO indices
S E T KEY TO RANGE l l C ~ * r . ' ' C Z ' '
                   ~   ~~        .     ~




REPLACE ALL w a t c h r WiTH i n d i c e s - > w a t - c h r , ;
                    w a t - a c u t e WITH i n d i c e s - > w a t a c u t e , ;
                    w a t e c o WITH i n d i c e s - > w a t - e c o , ;
                    s o l i c h r WITH indices->soil-chr,;
                    s o i l - a c u t e WITH indices->soil a c u t e , ;
                    a i r Zhr WITH indices->air chr,;
                    a i r I a c u t e WITH indices->aTr-acute
BLANK F I E L D S w a t c h r FOR w a t c h r = 0
BLANK F I E L D S w a t - a c u t e FOR w a t acute=O
BLANK F I E L D S w a t e c o FOR w a t eco=0
BLANK F I E L D S s o i i chr FOR sozl c h r = 0
BLANK F I E L D S s o i l - a c u t e FOR soT1 acute=O
BLANK F I E L D S a i r     chr        FOR a i r chrg0
                            -
BLANK F I E L D S air-acute FOR aTr-acute=O
CLOSE ALL
S E T TALK ON
RETURN
* E n d of m a i n p r o g r a m : TOX-UPD.PRG
*   Function definitions
FUNCTION r f d
 PARAMETERS r f d
 I F rfd > 0
    ratio = geo->rfdgm              / rfd
 ELSE
    ratio = 0
 ENDIF
RETURN r a t i o

FUNCTION o c s f
 PARAMETERS csf
 I F csf > 0
    r a t i o = csf / g e o - > o r a l c s f g m
 ELSE
     ratio    =   0
 ENDIF
RETURN r a t i o




Page E-2                                                                                     -
                                                                                          TOX UPD .PRG
FUNCTION noael
 PARAMETERS noael
 IF noael > 0
   ratio = geo->noaelqm / noael
 ELSE
   ratio = 0
 ENDIF
RETURN ratio
FUNCTION icsf
 PARAMETERS csf
 IF csf > 0
   ratio = csf / geo->inhalcsfgm
 ELSE
   ratio = 0
 ENDIF
RETURN ratio
FUNCTION rfc
 PARAMETERS rfc
 IF rfc > 0
      ~-
   ratio = geo->rfcqm / rfc
 ELSE
   ratio = 0
 ENDIF
RETURN ratio

FUNCTION ld50
 PARAMETERS ld50
 IF ld50 > 0
   ratio = geo->oralld50gm / ld50
 ELSE
   ratio = 0
 ENDIF
RETURN ratio
FUNCTION lc50
 PARAMETERS lc50
 IF lc50 > 0
   ratio = geo->inhlc50gm / lc50
 ELSE
   ratio = 0
 ENDIF
RETURN ratio
FUNCTION aqlc50
 PARAMETERS fish,wflea
           ~~




 IF fish > 0
   IF wflea > 0
       ratio = (geo->fishgm / fish) + (geo->wfleagm / wflea)
   ELSE
       ratio = geo->fishgm 1 fish
   ENDIF
 ELSE
   IF wflea > 0
       ratio = geo->wfleagm / wflea
   ELSE
       ratio = 0
   ENDIF
 ENDIF
RETURN ratio



TOX-UPD .PRG                                                   Page E-3
FUNCTION bcf
 PARAMETERS bcf
 I F bcf > 0
   ratio       =   bcf / geo->bcfgm
 ELSE
   ratio = 0
 ENDIF
RETURN ratio

FUNCTION water chr
 PARAMETERS rfX, csf, noael
 first = MAX(rfd,csf)
 maxval = MAX (first,noael)
 I F maxval > 0
    indx = maxval
 ELSE
   indx = 0
 ENDIF
RETURN indx

FUNCTION water acute
 PARAMETERS ld50
 I F ld50 > 0
    indx = ld50
 ELSE
   indx    =   0
 ENDIF
RETURN indx

FUNCTION water-eco
 PARAMETERS aqlc50, bcf
 maxval = MAX(aqlc50,bcf)
 I F maxval > 0
    indx = maxval
 ELSE
    indx = 0
 ENDIF
RETURN indx

FUNCTION s chr
 PARAMETERS rfd, oralcsf, noael, rfc, inhcsf
 first = MAX(rfd,oralcsf)
 second = MAX (noael,rfc)
 third = MAX(first,second)
 maxval = MAX (third,inhcsf)
 I F maxval > 0
    indx = maxval
 ELSE
   indx = 0
 ENDIF
RETURN indx

FUNCTION s acute
 PARAMETER3 ld50,lc50
 maxval = MAX (ld50,lc50)
 I F maxval > 0
    indx = maxval
 ELSE
   indx = 0
 ENDIF
RETURN indx



Page E-4                                       TOX-UPD.PRG
FUNCTION a chr
    PARAMETERS , csf
               rfc
    maxval = MAX(rfc,csf)
    IF maxval z 0
      i n d x = maxval
    ELSE
   indx = 0
 ENDIF
RETURN i n d x

FUNCTION a a c u t e
 PARAMETER? i c 5 0
 IF l c 5 0 > 0
   i n d x = lc50
 ELSE
   indx = 0
 ENDIF
RETURN i n d x

*   End of f u n c t i o n d e f i n i t i o n s




TOX-UPD.PRG                                        Page E-5
*   Main P r o g r a m FATE UPD.PRG
*   A u t h o r : P a t r i c k Graham, R e s e a r c h T r i a n g l e I n s t i t u t e
*   C a l c u l a t e s m o b i l i t y & persistence m o d i f i e r s from t h e f a t e L t r a n s p o r t d a t a

SET TALK OFF

*   Calculate modifiers

CLEAR ALL
TEXT
        ..............................................
            F a t e and T r a n s p o r t D a t a U p d a t e Program
        ..............................................
          Please w a i t w h i l e t h e m o d i f i e r s are c a l c u l a t e d   ...
ENDTEXT
USE \ w r m s \ t o x f i l e s \ f a t e I N 2 ORDER cas A L I A S f a t e
USE \ w r m s \ t o x f i l e s \ m o b g e r I N 1 A L I A S mp
S E T RELATION TO cas INTO f a t e
SCAN WHILE .NOT. E O F O
     REPLACE wm WITH w a t m o b ( f a t e - > s o l )
     REPLACE w p WITH watger(fate->adjbod,fate->biodeg,fate->logp)
     REPLACE s m WITH s o i l mob ( f a t e - > l o g k o c )
     REPLACE sp WITH soilger(fate->adjbod,fate->biodeg,fate->logp)
     REPLACE am W I T H a i r m o b ( f a t e - > v p )
     REPLACE ap WITH a i r g e r (fate->rkstime, f a t e - > a i r h a l f t )
ENDSCAN
BLANK   FIELDS wm FOR wm=o
BLANK F I E L D S w p FOR wp=O
BLANK F I E L D S sm FOR sm=O
BLANK F I E L D S sp FOR sp=O
BLANK F I E L D S am FOR am=O
BLANK F I E L D S ap FOR ap=O

*   C o p y m o d i f i e r s t o CHEMICAL.DBF

TEXT
         P l e a s e w a i t w h i l e t h e modifiers are copied            . ..
ENDTEXT

CLEAR ALL
USE \ w r m s \ t o x f i l e s \ m o b g e r I N 2 ORDER cas A L I A S mp
USE \ w r m s \ c h e m i c a l I N 1 ORDER c h e m-i d A L I A S c h e m
SET RELATION TO cas n u m INTO mp
S E T KEY TO RANGE vmC*,''CZ''
REPLACE ALL w a t m o b WITH mp->wm,;
                    w a t g e r WITH mp->wp,;
                    s o i l m o b WITH mp->sm,;
                    s o i l g e r WITH m p - > s p , ;
                    a i r m o b WITH mp->am,;
                    a i r g e r WITH @->ap
BLANK F I E L D S w a t m o b FOR w a t m o b = 0
BLANK F I E L D S w a t g e r FOR w a t > e r = O
BLANK F I E L D S s o i l mob FOR s o i l mob=0
BLANK F I E L D S s o i l g e r FOR soil>er=O
BLANK F I E L D S a i r m o b FOR a i r mob=O
BLANK F I E L D S a i r g e r FOR air>er=O
CLOSE ALL
SET TALK ON
RETURN
* E n d of main program: FATE-UPD.PRG

Page E-6                                                                                           FATE-UPD.PRG
 *   Function definitions

FUNCTION w a t mob
 PARAMETERS sol
 DO CASE
   CASE sol = 0
      watmob = 0
   CASE s o l > 4 0 0 0
      watmob = 0 . 7 5
   CASE s o l >= 1 0 0
      watmob = 0.5
   CASE s o l < 1 0 0
      watmob = 0 . 2 5
 ENDCASE
RETURN w a t m o b

FUNCTION w a t g e r
 PARAMETERS BOD, biodeg, l o g P
 DO CASE
   CASE BOD
      watper = 0
                -0 .AND. biodeg =           ""    .AND.   logP = 0

   CASE biodeg = "High"
      watper = 0 . 7 5
   CASE biodeg = "Moderate"
      watper = 0 . 5
   CASE biodeg = "Low"
      watper = 0 . 2 5
   CASE BOD = 3

                -
      watper = 0 . 7 5
   CASE BOD      2
      watper = 0 . 5
   CASE BOD      1
      watper = 0 . 2 5
   CASE l o g P > 5
      watper = 0 . 7 5
   CASE l o g P >= 3
      watper = 0 . 5
   CASE l o g P < 3
      watper = 0 . 2 5
 ENDCASE
RETURN watper

FUNCTION s o i l m o b
 PARAMETERS koc
 DO CASE
   CASE k o c = 0
      soilmob = 0
   CASE k o c < 1 . 9
      soilmob = 0.75
   CASE k o c > 2 . 8
      soilmob = 0.25
   CASE koc <= 2 . 8
      soilmob = 0.5
 ENDCASE
RETURN s o i l m o b

FUNCTION s o i l g e r
 PARAMETERS B O D , b i o d e g , l o g P
 DO CASE
   CASE BOD = 0 .AND. biodeg =              "I'   .AND.   logP = 0
      soilper = 0
   CASE biodeg = "High"
      soilper = 0 . 7 5


FATE-UPD.PRG                                                         P a g e E-I
   CASE b i o d e g = "Moderate"
      s o i l p e r = 0.5
   CASE b i o d e g = "Low"
      s o i l p e r = 0.25
   CASE BOD = 3
      s o i l p e r = 0.75
   CASE BOD = 2
      soilper = 0.5
   CASE BOD = 1
      s o i l p e r = 0.25
   CASE l o g P > 5
      soilper = 0.75
   CASE l o g P >= 3
      soilper = 0.5
   CASE l o g P 4 3
      s o i l p e r = 0.25
 ENDCASE
RETURN s o i l p e r
                                                        J
FUNCTION a i r mob
    PARAMETERS vp
 DO CASE
   CASE vp = 0
      airmob = 0
   CASE v p > 9 . 9 8
      airmob = 0.75
   CASE v p >= 0 . 0 0 0 9 9 8
      airmob = 0 . 5

                      -
   CASE vp < 0 . 0 0 0 9 9 8
      airmob
 ENDCASE
                  0.25

RETURN airmob

FUNCTION a i r g e r
 PARAMETERS r e s , h a l f
 DO CASE
   CASE res = 0 ,AND. h a l f = 0
      airper = 0
   CASE h a l f = 6 9 0 0 0 0 0 0 . 0 0 0 0
      DO CASE
            CASE res > 3 6 5
                 airper = 0.75
            CASE res >= 1
                 airper = 0.5
            CASE res = 0
                 airper = 0.75
            CASE res < 1
                 airper = 0.25
      ENDCASE
   CASE res > 365
      airper = 0 . 1 5
   CASE h a l f > 4 0
      a i r p e r = 0.75
   CASE r e s >= 1
      a i r p e r = 0.5
   CASE h a l f >= 3 . 1
          airper      =   0.5
   OTHERWISE
      a i r p e r = 0.25
 ENDCASE
RETURN a i r p e r

*   End of f u n c t i o n d e f i n i t i o n s


Page E-8                                           FATE-UPD.PRG
Table E-1. File Structure for Benchmar.dbf
Field Field Name             Type           Width   D ec   Index
    1 NAME                   Character         45              N
    2 CAS                    Character         11              N
      3    RFD               Numeric           15     6        N
      4    ORALCSF           Numeric           15     6        N
      5    NOAEL             Numeric           15              N
      6     RFC              Numeric           15              N
      7     INHALCSF         Numeric           15              N
      8     ORALLD50         Numeric           15              N
      9     INHALLCSO        Numeric           15              N
     10     AQLCSO F         Numeric           15              N
     11            -
            AQLC50-W         Numeric           15              N
     12     BCF              Numeric           15              N
**   T o t a l **                             207




Table E-2. File Structure for Ratios.dbf
Field       Field Name       Type           Width   Dec    Index
      1     NAME             Character         45             N
      2     CAS              Character         11             N
      3     W D R            N u m e I ic
                                     :         12     5       N
      4     ORA?kSF      R   Numeric          12      5       N
      5     NOAEL R-         Numeric          12      5       N
      6     R F C R-         Numeric          12      5       N
      7     INHFSF     R     Numeric          12      5       N
      8     L D 5 0 R-       Numeric          12      5       N
       9 LC50-R              Numeric          12      5       N
     i o AQLCSO-R            Numeric          12      5       N
     1 1 B C F-R             Numeric          12      5       N
**   T o t a l **                            165




Table E-3. File Structure for Indicesdbf
Field     Field Name         Type           Width   Dec    Index
    1     NAME               Character         45             N
    2     CAS                Character         11             N
    3     WAT CHR            Numeric          12      5       N
    4     WAT-ACUTE          Numeric          12      5       N
      5     WAT-ECO          Numeric          12      5       N
      6     S O I Z CHR      Numeric          12      5       N
      7     SOIL-ACUTE       Numeric          12      5       N
       8 AIR FHR             Numeric          12      5       N
       9 AIRACUTE            Numeric          12      5       N
**   T o t a l *z                            141




                                                                   Page E-9
Table E-4. File Structure for Geomeawdbf
F i e l d F i e l d Name   Type          Width   Dec   Index
        1 RFDGM            Numeric          19     4       N
        2 ORALCSFGM        Numeric          19     4       N
        3 NOAELGM          Numeric          19     4       N
        4 RFCGM            Nume r i c       19     4       N
        5 INHALCSFGM       Numeric          19     4       N
        6 ORALLDSOGM       Numeric          19     4       N
        7 INHLC50GM        Numeric          19     4       N
        8 FISHGM           Numeric          19     4       N
        9 WFLEAGM          Nume r i c       19     4       N
     1 0 BCFGM             Numeric          19     4       N
** T o t a l **                            191




Table E-5. File Structure for Fate.dbf
F i e l d F i e l d Name   Type          Width   Dec   Index
        1 NAME             Character        45             N
        2 CAS              Character        11             N
        3Mw                Numeric          14     4       N
        4 v P              Numeric          20    10       N
        5 SOL              Numeric          16     6       N
        6 LOGP             Numeric          14     4       N
        7 LOGKOC           Numeric          14     4       N
        8 BOD              Character        15             N
        9 ADJBOD           Numeric          14     4       N
     1 0 BIODEG            Character        10             N
     1  1 RESTIME          Numeric          14     4       N
     1 2 AIRHALFT          Numeric          14     4       N
** T o t a l **                            202




Table E-6. File Structure for Mobger.dbf
Field   Field Name         Type          Width   Dec   Index
      1 NAME               Character        45             N
      2 CAS                Character        11             N
      3wM                  Numeric           5     2      N
      4 w p                Numeric           5     2      N
      5 SM                 Numeric           5     2      N
      6 SP                 Numeric           5     2      N
      7 A M                Numeric           5     2      N
      8 A p                Numeric           5     2      N
**   T o t a l **                           87




Page E-10
  APPENDIX F

SAMPLE OUTPUTS
,
                                                 LIST OF TABLES


Table F-1. Example of Facility List Report (Facfim) . . . . . . . . . . . . . . . . . . . . . . . . . . . .   F-1

Table F-2. Example of Chemical List Report (Chem.frm)                .........................                F-2

Table F-3. Example of All Facility Data Report (Alldata.$"                 ......................             F-3

Table F-4. Example of Emissions By Year Report (Byyeurfim)                    ....................            F-4

Table F-5. Example of Emissions By County Report (Counry.frm) . . . . . . . . . . . . . . . . . . . F-5

Table F-6. Example of Emissions By SIC Report (Sic.$"                  ........................               F-6

Table F-7. Example of Facility Trend Report (Trendfmfrm)                 .......................              F-7

Table F-8. Example of Summary Toxicity and Hazard Scores by Facility Report (Wut-chrfim)F-8

Table F-9. Example of Waste Minimization Summary Report (Wustemin.frm) . . . . . . . . . . . F-9
Table F-I. Example of Facility List Report (Fuc.frm)

10/30/92                                                                                           PAGE    1
                                                   WRMS FACILITIES

FACILITY NAME                        CITY              COUNTY        ZIP     CONTACT               PHONE

CAROLINA GALVANIZING CORP.           ABERDEEN          MOORE         28315   MARK FLEMING          9199442171
COLONIAL ABRASIVE PRODUCTS CO.       ABERDEEN          MOORE         28315   JOSEPH V. MEACCI      9199447631
W. C. RICHARDS CO. OF CAROLINA       ABERDEEN          MOORE         28315   WILLIAM F. ABEL SR.   9199447647
EASCO ALUMINUM                       AHOSKIE           HERTFORD      27910
AMERICAN CIRCUIT BREAKER CORP.       ALBEMARLE         STANLY        28002   DARWIN COMPTON        7044637361
COLLINS 6 AIKMAN CORPORATION         ALBEMARLE         STANLY        28001   CATHERINE A. CRITZ    7049835166
/ALBEMARLE
E.J. SNYDER 6 CO. INC.               ALBEMARLE         STANLY        28002
THE SELMER COMPANY                   ALBEMARLE         STANLY        28001
WISCASSETT MILLS CO. PLANT 162       ALBEMARLE         STANLY        28002   ROBERT V. BOOZER      7049821181
GLEN RAVEN MILLS INC. GLEN           ALTAMAHAW         ALAMANCE      27202   BENNY PILANO
TOUCH DIVISIO
BAKER KNAPP AND TUBBS                ANDREWS           CHEROKEE      28901   JERRY CARROLL         7043214251
LEE CO.                              ANDREWS           CHEROKEE      28901   B. KEVIN NEAL         9133844000
OUTBOARD MARINE CORP.                ANDREWS           CHEROKEE      28901   RICK WELCH            7048375311
DATA GENERAL CORP.                   APEX              WAKE          27520
LUFKIN                               APEX              WAKE          27502   MATT CATON            9193872345
R.P.R. INDUSTRIES, INC.              APEX              WAKE          27502
TIPPER TIE, INC.                     APEX              WAKE          27502
STANLY FIXTURES CO., INC.            AQUADALE          STANLY        28128   JERRY ALMOND SR.      7044743184
ASSOCIATED SPRING                    ARDEN             BUNCOMBE      28704   MICHAEL BARBER        2035829581
CROWN CORK 6 SEAL CO., INC.          ARDEN             BUNCOMBE      28704   JAMES GRIFFEE         7046842311
DAY INTERNATIONAL                    ARDEN             BUNCOMBE      28704   BILL MINCEY           7046874329
EATON CORP.                          ARDEN             BUNCOMBE      28704   C. T. BOETTCHER       7046849861
G 6 H INDUSTRIES                     ARDEN             BUNCOMBE      28704   RUSSELL A. DUFFNER    7046843926
NORTON COMPANY                       ARDEN             BUNCOMBE      28704   HARSU VACHHANI        7046842500
PHILIPS CONSUMER ELECTRONICS         ARDEN             BUNCOMBE      28704   DAN F. PELTIER        7046874144
co .
TYCOS INSTRUMENT INC.                ARDEN              BUNCOMBE     28704   EDWARD WRIGHT         7046844895
WESTINGHOUSE ELECTRIC                ARDEN              BUNCOMBE     28704   DAVE WRIGHT           7046873058
CORPORATION
B. B. WALKER CO.                     ASHEBORO           RANDOLPH     27203   ERIC BECK             9196251380
BLACK 6 DECKER CORPORATION           ASHEBORO           RANDOLPH     27203   RAY E. POPE           9196261653
CENTRAL CHAIR COMPANY                ASHEBORO           RANDOLPH     27204   HAROLD L. CRAVEN      9196293161
CLEVELAND TWIST DRILL                ASHEBORO           RANDOLPH     27204   CLIFFORD A. PRAHST    2164313120
DIXIE FURNITURE COMPANY INC.         ASHEBORO           RANDOLPH     27203   ROSALIE A. WATTS      7042495329
EVEREADY BATTERY COMPANY. INC.
~                                    ASHEBORO           RANDOLPH     27203   DARIO A. SENA         9196723524
PLANT 1
EVEREADY BATTERY COMPANY. INC.       ASHEBORO           RANDOLPH     27203   ROMULO B. DEZA        9196724543
PLANT 2
KAYSER ROTH HOSIERY INC.             ASHEBORO           RANDOLPH     27203   ROBERT MAY            9198522030
Table F-2. Example of Chemical List Report (Chem.frm)


Page No.                 1                                                                                                       10/30/92

                                                                   HRHS   DATA BASE CHEMICAL FILE

                                                                                                                        FORW   SRCE STORBT
CNEM ID                  COMMON NA&43                                                       CAS NWMEER     WASTE CODE   CODE   CODE NUIIBER

ACO-03204                CAREON MONOXIDE (CO)
ALUn00034                ALUMINUM (FDME OR DUST)                                               7429-90-5
AN02 03202               NITRCGEN DIOXIDE (N02)
APARF03200               PARTICULATES
AS02 03201               SULFUR DIOXIDE (502)
AVO2103203               VOLATILE ORGANIC COMPOUNDS (VOC)
CACEN00001               ACENAPETBBNE                                                            83-32-9
CACEN00002               ACENAPETHYLENE                                                         208-96-8
CACET00003               ACETALDEKYDE                                                            75-07-0
CACET00006               l-ACE'NL-2-THIOVREA                                                    591-08-2
CACET00008               2-ACElYLAMINOFLUORENE                                                   53-96-3
CACET00009               ACETIC ACID                                                             64-19-7
CACET00013               ACETIC ANHYDRIDE                                                       108-24-7
CACET00014               ACETONE                                                                 .. . -
                                                                                                 67-64-1
                                                                                                      .
CACET00015               ACETONE CYANOHYDRIN                                                     75-86-5
CACET00016               ACETONE THIOSEHI-IDE                                                  1752-30-3
CACET00017               ACETONITXILE                                                            75-05-8
CACET00018               ACETOP BBNONE                                                           98-86-2
CACET00019               ACETYL BROMIDE                                                         506-96-7
CACET00020               ACETYL CHLORIDE                                                         75-36-5
CACET00939               ACETOXYTRIPBBNYL STANNANE                                              900-95-8
CACR000021               ACROLEIN                                                               107-02-8
CACRY00022               A C R W D E                                                             79-06-1
CACRY00023               ACRYLIC ACID                                                            79-10-7
CACRY00024               ACRYLONITRILE                                                          107-13-1
CACRYOOO25               ACRYLYL CRLORIDE                                                       814-68-6
CADIP00026               ADIPIC ACID                                                            124-04-9
CADIP00027               ADIPONITRILE                                                           111-69-3
CALD100029               ALDICARB                                                               116-06-3
CALDR00030
         ~   ~   ~   ~   ALDRIN                                                                 309-00-2
CALLYO0031               ALLYL ALCOHOL                                                          107-18-6
CALLYO0032               ALLYL CHLORTDE                                                         107-05-1
CALLYO0033               ALLYLANTNE                                                             107-11-9
CALVM00035               ALUMINUM OXIDE                                                        1344-28-1
CALUn00036               ALUMINUM PHOSPEIDE                                                   20859-73-8
&&lM00037                ALUMINWM SULFATE                                                     10043-01-3
CAMIN00039 l - A U I N O - 2 - E I B T F l Y U N T B U I N O N B                                 82-28-0
CAMIN00040 2-AIUNOANTBRAaUINONB                                                                 117-79-3
CAMIN00041 I-AIUNOA7.OBENZKNE                                                                    60-09-3
CAlUN00042                                                                                       92-67-1
CAlUN00043 AIUNOPTERIN                                                                           54-62-6
-NO0873      '
           4 -AMINOPROFIOPBBNONE                                                                 70-69-9
CAMIN00886 4-AUINOPYRIDINE                                                                      504-24-5
CAMIN00902 4-AMINOBUTYWIETEOXTMET!3YLSILANE                                                    3037-72-7
CANT100044 AUITON                                                                                78-53-5
CAMIT00045 =TON          OXALFLTE                                                              3734-97-2
Table F-3. Example of AU Faclllty Data Report (MZdufu.$m)


10/30/92 FACILITY REPORT

FACILITY A.B.000694
A.B. CARTER, INC.
EWY. 321 S .
GASTONIA, NC 28053 (GASTON COUNTY)
CONTACT: S    ~ F. ANGEL, 104/e65-1201
                   L

SICS: 3552..               IAT~LONG: 035 15 oo/oei 15 00
EPA ID: NCD003154010       AIRS ID:
=DES ID: NCOO63835         TRI ID: ~ S O ~ ~ B C R W I G E W
STATUS AND EMISSIONS DATA FOR 1987

     R E C E M N G WATEP5ODY:
     FOTW:

     CBEHIcAL/WBsTE                               FUGITIVE     STACK    WArER     LAND         POTW   OET SITE       ON SITE

     SODIUM BYDROXIIDE                                  91s       0     33,163        0           0     57,359             0
     SULFURIC ACID                                    2,403       0     45,409        0           0        253             0
     l,l,l-~C€LLOROETEUE                              3,210       0          0        0           0         22,950         0
     OIL AND -
             E                                             0      0         35        0           0              0         0
                                   TOTAL              6,531       0     78,607        0           0         80,562         0


STATUS AND EMISSIONS DATA FOR 1988

     R E C E M N G WATERBODY:
     FOTW:
     CHEMIcAL/WASTE                               FUGITIVE     STACK    WATER      LAND        POTW   om     SITE    ON SITE
     ______________________I_________________-----------------------------------------------




     OIL AND GRSaSE                                        0      0         22        0           0              0         0
     F001STILL BOTTOM                                      0      0          0        0           0         14,201          0
     F001STILL BOTTOM                                      0      0          0        0           0          9,590          0
     F006ELECTRO SLUDGE                                    0      0          0        0           0         98,940    9s. 940

                                   TOTAL                   0      0         22        0           0     122,731       98.940


STATUS AND EMISSIONS DATA FOR 1989

     R E C E M N G RILIXREODY:
     Pow:
     caenrcAL/wnsTE                               FUGITIVE     STACK    WATER      LAND        POTW   OFF    SITE    ON SITS
     1.1,l-TRICHLOROETHANE                           28,800        0         0        0           0          2,400         0
     OIL AND GREASE                                       0        0        48        0           0              0         0
     FOOlEAXGEN. /NONMALCGEN. SOLVENT                      0       0         0        0           0         14,426         0

All quantities in lbs.




                                                                  1A1
Table F-4.Example of Emissions By Year Report (Byyear.$m)


10/30/92                       CONPARISON OF TOTAL BNISSIONS BY FACILITY ACROSS YEaRS                                   PAGE    1

CBEHICAL                             YEAR   FUGITIVE   STACK     WATER       LAND       PORl   OFF SITE       ON SITE      TOTAL
8.8.CARTER, INC. (FAC-ID A.B. 000694)

   SODIUM HYDROXIDE                  1987        918       0     33,163         0         0      57,359             0     91,440
   SULFURIC acID                     1987     2,403        0     45,409         0         0         253             0    48,065
   SOISURIC ACID                     1990       750        0          0         0         0               0         0       750
   l,l, 1-TRICELOROETHANE            1987     3,210        0          0         0         0      22,950             0    26,160
   l,l, 1-TRICBLOROETBANB            1989    28,800        0          0         0         0       2,400             0    31,200
   1,1,1-TRICELOROETHANE             1990     9,200        0          0         0         0      21,700             0    30.900
   OIL   AND   GREASE                1987         0        0         35        0          0           0             0          35
   OIL   AND   GREASE                1988         0        0         22        0          0           0             0          22
   OIL   AND   GREASE                1989         0        0         46        0          0           0             0          48
   OIL   AND   GREASE                1990         0        0          4        0          0               0         0           4
   FOOlSTILL BOTTOM                  1988         0        0          0        0          0      14,201             0    14,201
   FOOlSTILL BOTTOM                  1988         0        0          0        0          0       9.590             0     9.590
   F O O l e R U W N ./NONBRLOGEN.   1989         0        0          0        0          0      14,426             0    14.426
         SOLVENT M I X FROM
         SOLVENTS RECOVERY
   FOOlARLoGEN./ O - . NNN           1989         0        0          0        0          0        6,314            0      6,314
         SOLVENT M I X FROM
         SOLVENTS RBCOYBRY

   FOOlanrxx3eN./NONanrxx3eN.        1990         0        0          0        0          0      18,341             0    18,341
       SOLVENT MIX FROM
       VAPOR DEGRFASING

   FOO6ELECTRO SLUDGE                1988         0        0          0        0          0      98,940        98,940     98,940
   FOO6DRY LIME, METAL OB            1989         0       0           0        0          0      24,213             0    24,213
       SOLIDS,NOT FIXBD
       FROM WASTEWATER
        RB
       TE"
   F006DRY LIME, METAL 08            1989         0        0          0        0          0      75,732             0    15,732
       SOLIDS,NOT FIXED
       FROM WASTEWATER
       TREB'PMCN

   FOO6DRY LIME, METAL 0 8           1990         0       0           0        0          0     152,360             0   152,360
       SOLIDS,NOT FIXED
       FROM ELECTROPIJLTING


A l l quantities in lbs.
Table F-5. Example of Emissions By County Report (Countyfrm)


10/30/92         EUISSIONS BY YEAR AND CHBHICAL

EHISSIONS FOR DAVIDSON COUNTY
CHEHICAL                            # OF FACS     FUGITIVE        STACK    WATER    LAND    ON SITB



   ACETONE                                  0            0            0        0       0          0
   AHMONIA                                 12       21,171      100,678      750       0          0
   AFSBNIC COWOUNDS                         3       52,400            1        0       0          0
   BIS (Z-ETHYLEFXW F" A
                       T                    1          166        5,387        0       0          0
   n-BUTrL ALCOBOL                          3          824       51,951        4       0          0
   CRLOFJNB                                 6        1,510       90,830      768       0          0
   CHROMIGW CONPOUNDS                       1            0            1        0       0          0
   COPPER                                   1            0            0        0       0          0
   COPPER COHPOUNDS                         1            0             1       0       0          0
   FOF34ALDEHYDE                            1        1.426       10,196         0      0          0
   FREON113~~~
                                            2          520        8; 983        0      0          0
   GLYCOL ET-                               1            0       31,371         0      0          0
   ISOPROPYL ALCOBOL                        2          8 18      62,924       17       0          0
   LEaDcoHPoUNDs                            1          250           250     250     750          0
   MET=    ETHYL KETONE (HEK)               1          316       12,169         0      0          0
                                           13       23,902      463,936        0       0          0
                                            2       33,059       78,160        0       0          0
                                           16       94,923    1.365.865        0       0          0
                                            2             0          250       0       0          0


                                            1          818       88,528        0        0         0
   NITRIC ACID                              1            0          170        0       0          0
   PBOSPHORIC ACID                          1            0            0    3,746        0         0
                                            1            n
                                                         "            n         0       0         0
   SODIUM EYDROXIDE                                                   I


   SULFURIC ACID                             2         350          684         0       0         0
   TOLUENE                                   1         562       18,187         0       0         0
   1,1,l-TRICBLOROET€IANE                   18     166,340      729,808        30       0         0
   XYLENE                                    1         849       27,446         0       0         0
                                            14      16,459      371,619        13       0         0
   0-XYLENE
   ZINC
   ZINCCOHPOUNDS
                                             1
                                             1
                                                         -
                                                         0
                                                       250
                                                                      0
                                                                    250
                                                                                0
                                                                              250
                                                                                        0
                                                                                    7.500
                                                                                                  0
                                                                                                  0
   BOD 5                                     1           0            0       411       0         0
   COD                                       6           0            0     2,728       0         0
   TOTALSOLIDS                               6           0            0    66,618       0         0
   T O T A L I W E L D m NITRGGEN            1           0            0       123       0         0
   TOTALFKOSPEORUS                           1           0            0        51       0         0

   TOTAL 1987 EHISSIONS:                   126     416,973    3,520,251    75,759   8,250         0



All quantities i n lbs
Table F-6. Example o Emissions By SIC Report (Sicfnn)
                    f




   W O N MONOXIDE (CO)         33          0      776,000    0        0         0   0
   NITRXEN DIOXIDE IN021       34          0      448.000    0        0         0   0
   PARTICULATES                36          0    4.884;OOO    0        0         0   0
   SULFUR DIOXIDE ( 5 0 2 )    25          0    796,000      0        0         0   0
   V0LATII.E ORGANIC            39         0 22,666,000      0        0         0   0
        COneOIlNDS (VCC)
   ACETONE                     41     32,108    1,255,701    0        0   195,635   0
   BIS (2-ETBYLIIEXIL)         13      1,565      247,862    4        0    38,425   0
                               30     23,901      978,428   18        0    26,913   0
                                5        270       29,470    0        0         n
                                                                                1
                                                                                    n
                                                                                    "
   GLYCOL ETBBRS                7           0     237,171   17        0     1,502   0
   MET=   ETan KETONE f m 1    49     68.674    1,782,235    0        0   107,142   0
   MeTnaNOL                    59    112,454    4,092,959    0        0   123,260   0
   KETEYL ISOBUTYL KETONE       4        990      147,020    0        0    22,706   0
   STYRENE                      2      3,686       28,294    0        0         0   0
   TOLUENE                     60     87,243    3,628,405   30        0   297,180   0
   WASHOFF                      2      4,044            0    0        0    49,475   0
   "E                          45     38,815    1,221,551   13        0    66,789   0
   0-XYLENE                     1        401       12,982    0        0         0   0
   BOD 5                        9           0           0    0        0         0   0
   COD                          8          0            0    0        0         0   0
   TOTAL FOR 1987:             502   434,151 43,178,078     82        0   929.027   0
YEAR:   1988

   W O N MONOXIDE (CO)         45          0    950.000      0        0         0   0
   NITRXEN DIOXIDE (NO2)       45          0    502.000     0         0         0   0
   PARTICUWLTES                49          0  5,728,000     0         0         0   0
   SULFUR DIOXIDE ( 5 0 2 )    30          0    822,000     0         0         0   0
   VOLATILE ORGANIC            52          0 31,304,000      0        0         0   0
        COneOWNDS (Voq
   ACETONE                     54     45,344    1,799,828    0    2,187
   BIS (2-ETBnBEWI)             1      3,010       96,000    0        0
         PnTBaWLTB
   n-BUTYL ALCOHOL             35     29,436  1.110.637     0    14,570    48,201   0
           T
   GLYCOL E -                  10           0  ' 330;544    0         0         0   0
   ISOPROPYL ALconoL            2      3.534      41,152    0        14
   MET=   ETEYL KETONE lHeKl   58     75,431 1,836,230      0     5,221
   METBLNOL                    11    193,287 4,515,651       0    4.351
   MeTEYL ISOBVTXL KETONE       5          26     63.420     0        0
   T
   "
   S                            3      1,597      29,091     0    1.500
   roLmNE                      73    126,258 4.672.414       0   13,782
   l,l,l-TRICBLOROETEANE        1      5,056       5,056     0        0         0   0
   XYLENE                      54     37.391  1,432,947      0    3,136   29.443    0
   BOD 5                        8           0           0    0        0        0    0

All quantities in lbs
    Table F-7.Example of Facility Trend Report (Trendfac.frm)




      A.B. CARTER, INC.
        SODIUM HYDROXIDE                     91,440             0         0          0
        SULFURIC ACID                        48,065             0         0        750
        ~,~,~-TRICHLOROETHANE                26,160             "    31,200     30,900
        OIL AND GREASE                           35                      48          4
        FOOl STILL BOTTOM                         0                       0          0
        FOOl HALOGEN./NONHALOGEN.                 0                  20,740*         0
             SOLVENT MIX FROM SOLVENTS
             RECOVERY
        FOOI HALOGEN./NONHALOGEN.                 0             0         0     18.341
             SOLVENT MIX FROM VAPOR
             DECREASING
        F006 ELECTRO SLUDGE                       0     197,880           0          0
        PO06 DRY LIME, METAL OH                   0           0      99,945*         0
             SOLIDS,NOT FIXED FROM
             WASTEWATER TREATMEN
        BO06 DRY LIME, METAL OH                   0             0         0    152,360
             S0LIDS.NOT FIXED FROM
             ELECTROPLATING
                 FACILITY TOTAL:            165,700     221,693     151,933    202,355
      A. 0. SMITH ELECTRICAL PRODUCTS CO.
        VOLATILE ORGANIC COMPOUNDS                0     224,000     148,000          0
              (VOC)
        GLYCOL ETHERS                            0       15,000      14,783    12,883
        METHYL ETHYL KETONE (WEK)                0        5,300           0          0
        TOLUENE                                  0        7,000           0          0
        XYLENE                                    0             0    26,126          0
        BOD 5                                    0            0           0          6
        COD                                      0            1          36         19
        TOTALPHOSPHORUS                          0            0           0          0
        DO01 WST FLAM                            0       20,875           0          0
                         ~~-
        D001F003F005 ORGANIC
                     ~      -.                   0              0    23,340          0
             PAINT, INK,LACQUER,VAIaISH
             FROM OTHER S U R F .
             COATING/P
        D001D035F003F005 ORWUIIC                 0              0         0    30, 604
             PAINT,INK,LACQUER,VARNISH
             FROM CLEAN OUT PROCESS
             EQU
        D001D035F003F005 ORWUIIC                 0              0         0       913
             FAINT, INK, LACQVER,VAIa1SH
             FROM PAINTING
        F005 F   W LIQ                           0        6,947           0          0
                 FACILITY TOTAL:                 0      279,123     212,285    44,425

*   N m E R REPRESENTS MULTIPLE RECORDS
A l l quantities in lbo.




                                                                                         Page F-7
Table F-8. Example of Summary Toxicity and Hazard Scores by Facility Report (War-chr.frm)


02/05/93            CEANGES IN S
                               Y
                               -      CHRONIC TOXICITY AND 6AZAP.Z SCORES OVER TIME FOR
                    CRAKPION 1Nl"ATIONAL C O W . , CANTON

                                                  QUANTITY         CHRONIC       CHRONIC                               CHRONIC
                                                  RELEASED        TOXICITY      TOXICITY    IKIBILITY   PERSISTENCE     BBZARD
YEAR CHEMICAL                                      TO WATER          INDEX         SCORE*   IIODIFIER      MODIFIER         SCORE**

                                                                                                . .
      CBLOROFORH                                    28; 000        1.72000         48,160       0.50          0.15      60,200

                               1987 TOTAL           526,100                        49,833                               61.873

1988 ACETONE                                         7,500         0.11200          1,290       0.75          0.25       1,290
     AMMONIA                                         8.300         0.00057              5       0.75          0.25           5
     CALOROFORH                                     28,000         1.72000         48,160       0.50          0.15      60,200

                               1988 TOTAL            43,800                        49.455                               61,495

1989 ACETONE                                         7,600         0.17200         1,307        0.15          0.25       1,307
     AMMONIA                                         8.100         0.00057             5        0.75          0.25           5
     CIUOROFORH                                     31,000         1.72000        53,320        0.50          0.75      66,650
     PBeNOL                                         15,000         0.02867           430        0.75          0.25         430
                                1989 TOTAL           61,100                       55,062                                68,392

1990 ACETONE                                         7,300        0.17200          1.256        0.75          0.25       1.256
                                                   340,000        0.00057            194        0.75          0.25         194
                                                    19,000        1,72000         32,680        0.50          0.75      40,850
                                                   100'000        0.03440          3,440        0.75          0.25       3,440
      PnNOL                                         15,000        0.02867             430       0.75          0.25         430
                                1990 TOTAL          481,300                        31,999                               46,169




All quantities released are in lbs.   Only chemicals with water releases and available chronic toxicity indices are shom.
 *   Chronic toxicity score = quantity released x chronic toxicity index
**   chronic hazard score = chronic toxicity score x (1 I persistence modifier + 1 x mobility modifier)
     Eere, persistence and mobility are weighted equally, but they need not be.
Table F-9.Example of Waste Minimization Summary Report (Wusremhpm)


10/30/92                       WASTE MINIMIZATION ACTIVITY SUMMRRY REPORT
WASTE MTNIMT7ATTON ACTIVITY: Recycling/rewe on-site

CHEMICAL NAW3
                                           BUM. OF
                                        FACILITIES
                                                      -- WASTE QUANTITY
                                                         CURRENT
                                                                          (=/YEAR)
                                                                    PREVIOUS
                                                                                        ---
                                                                                     CHANGE
ACETONE                                           6       36,701        42,156         -13%
AMMONIA                                           1       69,590        75,710          -8%
ARSENIC                                           1              0           0           NA
ARSENIC COMPOUNDS                                 1            143          55
                                                                            ~~         -...
                                                                                       160%
__.
BIPHeNYI.                                         1              0               0       NA
CHROMIUM                                          1        6,111        32,300         -81%
CHROMIUM COMPOUNDS                                1          113            45         151%
COPPER                                            1            0             0           NA
COPPER COMPOUNDS                                  1           83             0           NA
        . .
CRESOL /sI                                        1            0                 0       NA
ETHYLENE GLYCOL                                   3            0             0           NA
FREON113                                          2       94,789        83,851          13%
GLYCOL ETHERS                                     1       16,000        16,000           0%
MANCJLNESE AND COMPOUNDS                          2            0             0           NA
METHYL ETHYL KETONE (HER)                         1       13,221           954        1286%
METHYLENE CHLORIDE                                3       26,986        12,151         122%
METHYL ISOBUTYL KETONE                            1        7,408         3,583         107%
PBOSPMORIC ACID                                   1             0            0           NA
SELENIUM                                          1             0                0       NA
SULFURIC ACID                                     1            685         721          -5%
TEREPHTHALIC ACID                                 1             0                0       NA
TETRACHLOROETHYLENE
TOLUENE
                                                  1           0                  0       NA
                                                  5   1,977,463      2,670,777         -26%
1,1, I-TRICHLOROETHANE                            3      36,393         38,613          -6%
TRICHLOROETHYLENE                                 1             0                0       NA
XYLENE                                            2        7,952         5,374          48%

                            TOTAL:               44   2,293,638      2,982,290         -23%
WASTE MINIMIZATION ACTIVITY: Recycling/rauee o f f - s i t e

                                           NUM. OF -- WASTE QUmTITY (LE/=)          ---
CHEMICAL NAME
ACETONE
                               ....................................................
                                       FACILITIES       CURRENT     PREVIOUS    CHANGE
                                                  4      23,904         18,504          29%
FREON113                                          3      23,388              0           NA
METHYL ETHYL KETONE (MEK)                         3       6,442          5,438          18%
METHYLENE CHLORIDE                                1      74,466       112,319          -34%
METHANOL                                          9      86,402        73,223           18%
TOLUENE                                           8      35,131        29,735           18%
~,~,~-TRTCHL~ROETHANE                             3     132,563       122,744            8%
TRICHLOROETHYLENE                                 1       4,631         3,250           42%
XYLENE                                            6       7,020         5,640           24%
ZINCCOMPOUNDS                                     1      45.583        27,305           67%
                            TOTAL:              39      439,530       398,158           10%




                                                                                              Page F-9

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:4/11/2013
language:Unknown
pages:310