DETAILED SYSTEM DESIGN AND SPECIFICATION FEDERAL WATER SUPPLY DATA SYSTEM Prepared for THE OFFICE OF WATER SUPPLY U.S. ENVIRONMENTAL PROTECTION AGENCY Contract No. 68-01 -3308 Task Order 68-01-3910 Prepared by Index Systems, Inc. One Broadway Cambridge, Mass. September 1976 VOLUME ------- DETAILED SYSTEM DESIGN AND SPECIFICATION FEDERAL WATER SUPPLY DATA SYSTEM Prepared For THE OFFICE OF WATER SUPPLY U.S. ENVIRONMENTAL PROTECTION AGENCY Contract No. 68-01-3308 Task Order 68-01-3910 Prepared By INDEX SYSTEMS, INC, One Broadway Cambridge, Mass. September, 1976 VOLUME III ------- VII. PROGRAM SPECIFICATIONS index systems inc ------- VII. PROGRAM SPECIFICATIONS This chapter contains the program specifications, organ- ized numerically within subsystem. Each specification contains several sections, as follows: General description Input/output chart Data file and table usage Report reference Control or report totals Logic chart Processing step descriptions The detailed file and report layouts from chapters in and IV of this report should be used in conjunction with the pro- gram specifications. A separate table of contents is included for this chapter. The programs are designed to be written in COBOL. The internal date retrieval function is to be used in all cases where the current processing date is required. The Periodic Reporting Subsystem is designed to utilize the string function of COBOL to access fields by means of offset and length values and thus facilitate the report selection programming. In addition -296- index systems Ine ------- this subsystem is designed to use the internal sort facility. Reference is made in the specifications to two functional subroutines which should be coded separately for incor- poration in many of the programs. The STANDARD-ERROR routine is used to print error messages on reports. The JULIAN-DATE routine is used to convert Gregorian input dates to Julian for processing and back to Gregorian for reporting purposes. PROGRAM SPECIFICATION TABLE OF CONTENTS PAGE PROGRAM NUMBER 1. Input Subsystem 299 EDIT010 - Edit PWS Inventory Card Transactions 299 EDIT015 - Sort PWS Inventory Card Transactions 305 EDIT020 - Edit Enforcement Card Transactions 307 EDIT025 - Sort Enforcement Action Records 313 EDITOjO - Edit Variance and Exemption Card 315 Transactions EDIT035 - Sort Variance and Exemption Card 321 Transactions EDIT040 - Edit Summary Violation Card 323 Transactions EDIT050 - Summarize MSIS Detail Violations 329 EDIT055 - Sort Summary Violation Transactions 334 EDIT060 - Sort MSIS PWS Inventory Transactions 336 EDIT070 - Sort MSIS Variance and Exemption 338 Transactions EDIT080 - Merge MSIS Detail Violations 340 2. Update Subsystem 342 UPDT010 - Update PWS Inventory File 342 UPDT020 - MSIS Update PWS Inventory File 351 UPDT030 - Update PWS Inventory Violations 356 UPDT040 - Year End PWS Inventory File Update 361 UPDT045 - Merge Purged PWS Inventory Records 366 - 2 9 7 - index systems inc ------- PAGE PROGRAM NUMBER 3. Update Subsystem Cont. UPDT050 - Update Variance and Exemption File 368 UPDT060 - MSIS Update Variance and Exemption 377 File UPDT065 - Merge Purged Variance and Exemption ....... 382 Records UPDT070 - Update Processing Tables 384 Periodic Reporting Subsystem „... 386 PRRP010 - Edit PWS Inventory Report Selection 386 Cards PRRP020 - Generate PWS Inventory Reports ... 391 PRRP030 - Edit Variance and Exemption Report 396 Selection Cards PRRP040 - Generate Variance and Exemption 401 Review List 5. Annual Reporting Subsystem 406 ANRP020 - Generate Compliance Profiles 406 ANRP031 - Generate Inventory Reports by Ownership .,. 413 ANRP032 - Generate Inventory Reports by Type of ..... 418 Water Source ANRP033 - Generate Inventory Reports by Treatment ... 423 ANRP034 - Generate Inventory Reports by Lab Control . 429 ANRP035 - Generate Inventory Reports by Treatment ... 433 Process ANRP036 - Generate Inventory Reports by Analyzing ... 438 Services ANRP037 - Generate Inventory Reports of Capacity .... 442 and Production ANRP038 - Generate Inventory Report of Per Capita .., 447 Water Use ANRP040 - Generate Enforcement Action Summary 451 ANRP050 - Generate Violation Summary 457 ANRP060 - Generate Variance and Exemption Summary ... 463 •298- index systems Sine ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: EDIT010 - Edit PWS Inventory Card Transactions INPUT This program edits the PWS -'inventory card input transactions. It produces an edited tape for input to the PWS Inventory Update program UPDT010, a detailed Transaction Report EDIT010R2 and a Batch Control and Error Report EDIT010R1. PINCT EPICT ^ J?- — PWS INVENTORY CARD TRANSACTIONS • v J EDTT010 EDIT PWS INVEN- TORY CARD TRANSACTIONS /EDITED / PWS J INVENTORY *1 CARD \ TRANSACT! V TIONS EDITOTOR1 DATA ENTRY BATCH CONTROL & ERROR REPORT:! PWS INVEN- TORY EDIT010R2 PWS INVENTORY TRANSACTION LIST -299- index systems one ------- 1. INTRODUCTION; Function; This program reads PWS inventory transactions, batched by state. It checks data values on each transaction and balances to batch control totals. Transaction Source; Card input, keypunched from input forms, Input Sort Sequence; Batch number Reports; EDIT010R1 - Data Entry Batch Control and Error Reports PWS Inventory lists transactions in error, error messages, batch and run totals. EDIT010R2 - PWS Inventory Transaction Listing - lists transactions accepted and the sequence numbers assigned by the program. 2. DATA USAGE: Input File; Output File; Tables: File Name - PWS Inventory Card Trans- actions File I.D. - PINCT File Layout Reference - See PWS Inven- tory Entry Form Record Name - Not applicable File Name - Edited PWS Inventory Card Transactions File I.Do - EPICT File Layout Reference - PWSUT Record Name - PWS Trans (00/01)-(13) Table Name Table I.D. Table Name Table I.D. Error Messages ERRMSG State Table STATAB -300- iradex systems ------- 3. REPORT OUTPUT; EDIT010R1 - Data Entry Batch Control and Error Report: PWS Inventory EDIT010R2 - PWS Inventory Transaction Listing 4. CONTROL ACCUMULATORS; Number of batches processed Number of batches accepted Number of batches rejected Number of batches in balance Number of batches out-of-balance Number of transactions - per batch Number of transactions accepted - per batch Number of transactions rejected - per batch 5. GENERAL PROCESSING NOTES; A common subroutine, STANDARD-ERROR, is used to print error messaaes on EDIT010R1. A common subroutine, JULIAN-DATE, is used to convert dates on the input cards to Julian dates. -301- index systems inc ------- 6. LOGIC CHARTt (Numbers reference PROCESSING STEPS, Section 7) (6) INITIALIZE READ TABLES SUM BATCH TOTAL (RUN) a READ TRANSACTION CARD WRITE PRIOR BATCH TOTALS SUM TRANSACTION TOTAL HEADER: TRAN: END: WRITE' / RUN / TOTALS SUM TRANSACTION VALID TRANSACTION VALID BATCH ERROR COUNTER (RUN) WRITE BATC ERROR SUM BATCH TOTAL ACCEPTED (RUN) SUM TRANSACTION ACCEPTED COUNTER / WRITE TRAN / SACTION LIST! REPORT STORE BATCH VALUES READ NEXT TRANSACTIO CARD / EDIT010R2 INITIALIZE TRANSACTION COUNTERS AjRITE VALID/ /TRANSACTION/ / TAPE / BATCH HEADER WRITE REPORT HEADERS -302- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize counters. (2) Read and store tables. (3) Read a record from the transaction file. (4) Increment batch counters for batch header. If not first batch write prior batch totals as indicated on EDIT010R1. Print the out of balance message if the transactions per batch accumulator does hot equal the transaction count from the batch header. (5) Validate batch header: Tran code must be "BP", if not, perform step (6), using error message 001. Check state code: If 0-10, use as the region number and set state code to blank. If not 0-10, match to State Table. Use cor- responding region number from State Table as the region. If no match to table, perform step (6), using error message 002. (6) For an invalid batch, increment batch rejected counter, write error message as indicated on EDIT010R1 layout and read to next batch header. (7) For a valid batch, increment batch accepted counter, store header values for balancing and initialize transaction counters. Write report headers to a new page for both EDIT010R1 and EDIT010R2. Read next transaction record. (8) Process transactions by incrementing the transaction counter. (9) Validate data values as described in the Edit Require- ments section of the Data Element Description. The tran code on each transaction will indicate which of the 13 transaction types the record represents. The -303- index systems inc ------- appropriate error checks should be made to the data elements of each specific record type. It is valid to have blanks in any field beyond the key. It is also valid to have an asterisk (*) in the right-most position of any field and the remainder of the field blank. If a value is in error, perform step 10 using appropriate error message. If record is valid, per- form step 11. (10) For a transaction error, increment transaction re- jected counter and write record to EDIT010R1 (as indicated on the report layout). Read next trans- action. (11) For a valid transaction, increment transaction ac- cepted counter. Write transaction to EDIT010R2 (as indicated on the report layout) using the PWSID and tran code for the first two fields respectively for the output record. The report should show a card image unformatted. All date fields should be converted to Julian dates using the subroutine JULIAN-DATE. Write transaction to file EPIOT Edited PWS Inventory Transactions File. Read the next transaction. (12) At end of run, write run totals to EDIT010R1 as indi- cated on the report layout. -304- . . m index systems me ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: EDIT015 - Sort Edited PWS Inventory Card Transactions SUBSYSTEM: INPUT DESCRIPTION: Utility Sort/Merge Program EPICT ^—'- EDITED PWS [INVENTORY CARD ^TRANSACTION SPICT EDIT015 SORT -305- index systems inc ------- SORT SEQUENCE; Data Element REGION STATE PWS-ID TRAN-CODE SOURCE-ID-NUM Offset Length Data Type 1 3 5 12 20 2 2 7 2 2 character character character character character Ascending/ Descending ascending ascending ascending ascending ascending DATA USAGE Input File; Output File; File Name - Edited PWS Inventory Card Transactions File I.D. - EPICT File Layout Reference - PWSUT Record Name - PWS Trans (00/01) - (13) File Name - Sorted PWS Inventory Card Transactions File I.D. - SPICT File Layout Reference - PWSUT Record Name - PWS Trans (00/01) - (13) -306- index systems ids ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: EDIT020 - Edit Enforcement Card Transactions INPUT This program edits the enforcement card input transactions. It produces an edited tape to be merged with MSIS Transactions, a detailed Transaction Report EDIT020R2 and a Batch Control and Error Report EDIT020R1. ENACT EENAC ENFORCE- MENT ACTION CARD PRANSACTIONS EDIT020 EDIT ENFORCE MENT CARD TRANSACTIONS EDITED ENFORCEMENT ACTION RECORDS DATA ENTRY BATCH CONTROL & ERROR REPORT 1NFORCEMENT ACTIONS ENFORCEMENT TRANSACTION LIST -307- index systems me ------- INTRODUCTION; Function; This program reads enforcement transactions, batched by state. It checks data values on each transaction and balances to batch control totals. Transaction Source; Card input, keypunched from input forms, Input Sort Sequence; Batch number Reports; EDIT020R1 - Data Entry Batch Control and Error Report: Enforcement Transactions list transac- tions in error, error messages, batch and run totals. EDIT020R2 - Enforcement Transaction Listing lists transactions accepted and the sequence numbers assigned by the program. 2. DATA USAGE: Input File; Output File; Tables: File Name - Enforcement Action Card Trans- actions File I.D. - ENACT File Layout Reference - See Enforcement Actions Entry Form Record Name - Not applicable File Name - Edited Enforcement Action Records File I.D. - EENAC File Layout Reference - ENACF Record Name - Enforcement Table Name Table I.D. Table Name Table I.D. Error Messages ERRMSG State Table STATAB -308- index systems inc ------- 3. REPORT OUTPUT; EDIT020R1 - Data Entry Batch Control and Error Report: Enforcement Actions EDIT020R2 - Enforcement Transaction Listing 4. CONTROL ACCUMULATORS; Number of batches processed Number of batches accepted Number of batches rejected Number of batches in balance Number of batches out-of-balance Number of transactions - per batch Number of transactions accepted - per batch Number of transactions rejected - per batch 5. GENERAL PROCESSING NOTES; A common subroutine, STANDARD-ERROR, is used to print error messages on EDIT020R1. A common subroutine, JULIAN-DATE, is used to convert dates on the input cards to Julian dates. -309- §rodex systems Birae ------- &OQIC CHART; (Numbers reference PROCESSING STEPS, Section 7) (6) INITIALIZE READ TABLES SUM BATCH TOTAL (RUN) READ TRANSACTION CARD WRITE PRIOR BATCH TOTALS SUM TRANSACTION TOTAL HEADER: TRAN: END: WRITE RUN TOTALS SUM RANSACTION VALID TRANSACTION VALID BATCH ERROR COUNTER (RUN) ERROR COUMTKB WRITE BATC ERROR WRITE TRAN ERROR SUM BATCH TOTAL ACCEPTED (RUN) SUM TRANSACTION ACCEPTED COUNTER / WRITE TRAN / SACTION /LIST REPORT STORE BATCH VALUES 1READ NEXT ^RANSACTIO CARD / EDIT020R2 INITIALIZE TRANSACTION COUNTERS TE VALID/ TRANSACTION/ TAPE / WRITE REPORT HEADERS -310- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize counters. (2) Head and store tables. (3) Read a record from the transaction file. (4) Increment batch counters for batch header. If not first batch write prior batch totals as indicated on EDIT020R1. Print the out of balance message if the transactions per batch accumulator does not equal the transaction count from the batch header. (5) Validate batch header: Tran code must be "BE", if not, perform step (6), using error message 001. Check state code: If 0-10, use as the region number and set state code to blank. If not 0-10, match to State Table. Use cor- responding region number from State Table as the region. If no match to table, perform step (6), using error message 002. (6) For an invalid batch, increment batch rejected counter, write error message as indicated on EDITO-20R1 layout and read to next batch header. (7) For a valid batch, increment batch accepted counter, store header values for balancing and initialize transaction counters. Write report headers to a new page for both EDIT 020R1 and EDIT020R2. Read next transaction record. (8) Process transactions by incrementing the transaction counter. /o\ XJ/ Validate data values as described in the Edit Require- ments section of the Data Element Description. It is valid to have blanks in any field beyond the key. If a value is in error, perform step 10 using appropriate error message. If record is valid, perform step 11. -311- index systems inc ------- (10) For a transaction error, increment transaction re- jected counter and write record to EDIT020R1 (as indicated on the report layout). Read next trans- action. (11) For a valid transacton, increment transaction ac- cepted counter. Write transaction to EDIT020R2 (as indicated on the report layout) using the current value of the transaction counter as the TRAN number. Write transaction to file EENAC Edited Enforcement Action Records. Read the next transaction. (12) At end of run, write run totals to EDIT020R1 as indi- cated on the report layout. -312- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM; EDIT025 - Sort Enforcement Actions Records SUBSYSTEM: INPUT DESCRIPTION: Utility Sort/Merge Program MSISE MS IS ENFORCEMENT ACTIONS EDITED ENFORCEMENT ACTION RECORDS ENFORCEMEN ACTIONS FILE -313- index systems ine ------- SORT SEQUENCE; Data Element REGION STATE PWS-ID CASE-ID Offset Length Data Type 1 3 5 12 2 2 7 5 character character character character Ascending/ Descending ascending ascending ascending ascending DATA USAGE: Input Files: Output File; File Name - Edited Enforcement Action Records File I.D. - EENAC File Layout Reference - ENACF Record Name - Enforcement File Name - MSIS Enforcement Actions File I.D. - MSISE File Layout Reference - ENACF Record Name - Enforcement File Name - Enforcement Actions File File I.D. - ENACF File Layout Reference - ENACF Record Name - Enforcement -314- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: EDIT030 - Edit Variance and Exemption Card Transactions INPUT This program edits the variance and exemption card input transactions. It produces an edited tape for input to the Variance and Exemption Update program UPDT050, a detailed Transaction Report EDIT030R2 and a Batch Control and Error Report EDIT030R1. VEXCT EVECT ^ ^"VARIANCE & EXEMPTION CARD TRANSACTIONS « EDTT030 EDIT VARIANCE & EXEMPTION CARD TRANSACTIONS v_ EDITED VARIANCE & EXEMPTION CARD RANSACTION EDIT030R1 DATA ENTRY BATCH CONTROL &| ERROR REPORT: VARIANCES & EXEMPTIONS. EDIT030R2 VARIANCE & EXEMPTION TRANSACTION LIST -315- index systems inc ------- 1. INTRODUCTION; Function: This program reads variance and exemption transactions, batched by state. It checks data values on each transaction and balances to batch control totals. Transaction Source; Card input, keypunched from input forms, Input Sort Sequence; Batch number Reports; EDIT030R1 - Data Entry Batch Control and Error Report: Variances and Exemptions lists trans- actions in error, error messages, batch and run totals. EDIT030R2 - Variance and Exemption Transaction Listing lists transactions accepted and the sequence numbers assigned by the program. 2. DATA USAGE: Input File; Output File: Tables: File Name - Variance and Exemption Card Transactions File I.D. - VEXCT File Layout Reference - See Variance and Exemption Entry Form Record Name - Not applicable File Name - Edited Variance and Exemption • Card Transactions File I.D. - EVECT File Layout Reference - VAEXT Record Name - V&E Trans (00/01) Table Name - Error Messages Table I.D. - ERRMSG Table Name - State Table Table I.D. - STATAB -316- index systems inc ------- 3. REPORT OUTPUT; EDIT030R1 - Data Entry Batch Control and Error Report: Variances and Exemptions EDIT030R2 - Variance and Exemption Transaction Listing 4. CONTROL ACCUMULATORS; Number of batches processed Number of batches accepted Number of batches rejected Number of batches in balance Number of batches out-of-balance Number of transactions - per batch Number of transactions accepted - per batch Number of transactions rejected - per batch 5. GENERAL PROCESSING NOTES; A comiri~n subroutine, STANDARD ERROR, is used to print error messages on EDIT030R1. A common subroutine, JULIAN-DATE, is used to convert dates on the input cards to Julian dates. - 317 - index systems inc ------- 6. LOGIC CHART; (Numbers reference PROCESSING STEPS, Section 7) READ /TRANSACTION, CARD (10) SUM BATCH TOTAL (RUN) SUM TRANSACTION TOTAL WRITE PRIOR BATCH TOTALS (6) SUM TRANSACTION ACCEPTED COUNTER /WRITE TRANi / SACTION LlST REPORT, /EDIT030R2 ITE VALID7 TRANSACTION/ TAPE / / SUM BATCH TOTAL ACCEPTED (RUN) i STORE BATCH VALUES INITIALIZE TRANSACTION COUNTERS WRITE REPORT HEADERS SUM BATCH ERROR COUNTER (RUN) JL 'WRITE BATCIi ERROR fEDIT030Rl READ NEXT / 1 TRANSACTION/ CARD / -318- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize counters. . (2) Read and store tables. (3) Read a record from the transaction file. (4) Increment batch counters for batch header. If not first batch write prior batch totals as indicated on EDIT030R1 Print the out of balance message if the transactions per batch accumulator does hot equal the transaction count from the batch header. (5) Validate batch header: Tran code must be "BV" , if not, perform step (6) , . • using error message 001. Check state code: If 0-10, use as the region number and set state code to blank. If not 0-10, match to State Table. Use cor- responding region number from State Table as the region. If no match to table, perform step (6), using error message 002. (6) For an invalid batch, increment batch rejected counter, write error message as indicated on -EDIT030R1 layout and read to next batch header. (7) For a valid batch; increment batch accepted counter, store header values for balancing and initialize transaction counters. Write report headers to a new page for both EDIT030R1 and ,EDIT03QR2, Read next transaction record. (8) Process transactions by incrementing the transaction counter. Validate data values as described in the Edit Require- ments section of the Data Element Description. It is valid to have blanks in any field beyond the key. It is also valid to have an asterisk (*) in the right-most position of any field and the remainder of the field blank. If a -319- index systems inc ------- value is in error, perform step 10 using appropriate error message. If record is valid, perform step 11. (10) For a transaction error, increment transaction re- jected counter and write record to EDIT030R1 (as indicated on the report layout). Read next trans- action. (11) For a valid transaction, increment transaction ac- cepted counter. Write transaction to EDIT030R2 (as indicated on the report layout) using the current value of the trans- action counter as TRAN number. All date fields should be converted to Julian dates using the subroutine JULIAN-DATE. Write transaction to file EVECT Edited Variance and Exemption Card Transactions File. Read the next transaction. (12) At end of run, write run totals to EDIT030R1 as indi- cated on the report layout. _ 3 2 o - index systems °mc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: EDIT035 - Sort Edited Variance and Exemption Card Transactions INPUT Utility Sort/Merge Program EVECT EDITED VARIANCE & EXEMPTION CARD kTRANSACTION TIONS EDIT035 SORT SVECT SORTED VARIANCE & [EXEMPTION CARD ^TRANSAC- TIONS -321- index systems inc ------- 1. SORT SEQUENCE; Data Element REGION STATE PWS-ID VE-ID TRAN-CODE Offset Length 1 3 5 12 17 2 2 7 5 2 Data Type character character character character character Ascending/ Descending ascending ascending ascending ascending ascending 2. DATA USAGE: Input File; File Name - Edited Variance and Exemption Card Transactions File I.D. - EVECT File Layout Reference - VAEXT Record Name - V & E Trans (00/01) Output File; File Name - Sorted Variance and Exemption Card Transactions File I.D. - SVECT File Layout Reference - VAEXT Record Name - V & E Trans (00/01) -322- index systems ins ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: EDIT040 - Edit Summary Violation Card Trans- actions SUBSYSTEM: DESCRIPTION: INPUT This program edits the violations summary input transactions. It produces an edited tape for input to the Violations PWS Update Program UPDT030, a detailed Transaction Report EDIT040R2 and a Batch Control and Error Listing EDIT040R1. SPVCT ^SUMMARY PWS INVENTORY VIOLATION CARD TRANSACTIONS m *. * EDIT040 EDIT SUMMARY PWS INVENTORY VIOLATION CARD TRANSACTIONS ESPVT ^ > EDITED" SUMMARY ?WS INVENTORY VIOLATION ?RANSACTIONS EDIT040R1 DATA ENTRY BATCH CONTROL ERROR REPORT: SUMMARY VIOLATIONS EDIT040R2 SUMMARY VIOLA- TIONS TRANSAC- TION LIST -323- index systems Sine ------- 1. INTRODUCTION; Function: This program reads violation summary transac- tions, batched by state. It checks data values on each transaction and balances to batch control totals. Transaction Source; Card input, keypunched from input forms, Input Sort Sequence; Batch Number Reports; EDIT040R1 - Data Entry Batch Control and Error *tep°rt: Summary Violations lists transactions in error, error messages, hatch and run totals. EDIT04X)R2 - Summary Violations Transaction Listing lists transactions accepted and the sequence numbers assigned by the program. 2» DATA USAGE: Input File; Output File; File Name - Summary Violation Card Transactions File I.D. - SPVCT File Layout Reference - See Violation Summary Entry Form Record Name - Not applicable File Name - Edited Summary Violation Transactions File I.D. - ESPVT File Layout Reference - VIOST Record Name - Violation Trans (01) Tables: Table Name Table I.D. Table Name Table I.D. Error Messages ERRMSG State Table STATAB -324- index systems me ------- 3. REPORT OUTPUT; EDIT040R1 - Data Entry Batch Control and Error Report; Summary Violations EDIT040R2 - Summary Violations Transaction Listing 4. CONTROL ACCUMULATORS; Number of batches processed Number of batches accepted Number of batches rejected Number of batches in balance Number of batches out-of-balance Number of transactions - per batch Number of transactions accepted - per batch Number of transactions rejected - per batch 5. GENERAL PROCESSING NOTES; A common subroutine, STANDARD-ERROR, is used to print error inessages on EDIT040R1. ~325~ index systems inc ------- i. &QSIC CHARTS (Numbers reference PROCESSING STEPS, Section 7) READ /TRANSACTION, CARD (8) SUM ' .TRANSACTION TOTAL SUM BATCH TOTAL (RUN) (10) SUM TRANSACTION ACCEPTED COUNTER /WRITE TRANi / SACTION &.IST REPORT i /EDIT040R2 *ITE VALIDj 'TRANSACTIOli TAPE SUM BATCH TOTAL ACCEPTED (RUN) STORE BATCH VALUES INITIALIZE TRANSACTION COUNTERS WRITE REPORT HEADERS WRITE PRIOR BATCH TOTALS (6) SUM BATCH ERROR COUNTER (RUN) ' READ NEXT / FTRANSACTION/ CARD / -326- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize counters. (2) Read and store tables. (3) Read a record from the transaction file. (4) Increment batch counters for batch header. If not first batch write prior batch totals as indicated on EDIT040R1.. Print the out of balance message,.if the transactions per batch accumulator does not equal the transaction count from the batch header. (5) Validate batch header: Tran code must be "B$" , if not, perform step (6), using error message 001. Check state code: If 0-10, use as the region number and set state code to blank. If not 0-10, match to State Table. Use cor- responding region number from State Table as the region. If no match to table, perform step (6), using error message 002. (6) For an invalid batch, increment batch rejected counter, write error message as indicated on EDIT040R1 layout and read to next batch header. (7) For a valid.batch, increment batch accepted counter, store header values for balancing and initialize transaction counters. Write report headers to a new page for both EDIT040R1 and EDIT040R2 . Read next transaction record. (8) Process transactions by incrementing the transaction counter. (9) Validate data values as described in the Edit Require- ments section of the Data Element Description. It is valid to have blanks in any field beyond the key. It is also valid to have an asterisk (*) in the right-most position of any field and the remainder of the field blank. If a -327- index systems inc ------- value is in error, perform step 10 using appropriate error message. If record is valid, perform step 11. (10) For a transaction error, increment transaction rejected counter and write record to EDIT040R1 (as indicated on the report layout). Read next transaction. (11) For a valid transaction, increment trans- action accepted counter. Write transaction to EDIT040R2 (as indicated on the report layout) using the current value of the transaction counter as the TRAN number. Write transaction to file ESPVT Edited Summary Violation Transactions File. Read the next transaction. (12) At end of run, write run totals to EDIT040R1 as indicated on the report layout. -328- ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: EDIT050 - Summarize MSIS Detail Violations INPUT This program edits and summarizes the MSIS Detail Violations tape. It produces a sum- marized violation tape and a control listing EDIT050R1. MPDVT *• " - MSIS PWS INVEN- TORY DETAIL VIOLATION ^TRANSACTIONS EDIT050 SUMMARIZE MSIS DETAIL VIOLATIONS SMPVT 'SUMMARIZED MSIS PWS [INVENTORY VIOLATION TRANSAC- TIONS EDIT050R1 MSIS VIOLATIONS TRANSACTION LIST -329- M@x systems Sue ------- 1. 2. INTRODUCTION: Function: This program reads violations detail reco.rds, It summarizes violations by region, state> PWS-ID, contaminant identification and vio- lation type. Transaction Source: Tape input, from the mechanized state processing system, MSIS. Input Sort Sequence; Region, state, PWS-ID, contaminant identification and violation type. Report; EDIT050R1 - MSIS Violations Transaction List - lists the summarized transactions and the sequence number assigned by the program. DATA USAGE: Input File; Output File; Tables: File Name - MSIS Detail Violation Transactions File I.D. - MPDVT File Layout Reference - VIODT Record Names - Violation Control Record File Name - Summarized MSIS Violation Transactions File I.D. - SMPVT File Layout Reference - VIOST Record Name - Violation Trans (01) Table Name - Contaminant Table Table I.D. - CONTAB Table Name - Violation Type Table Table I.D. - VIOTAB 3, REPORT OUTPUT: EDIT050R1 - MSIS Violations Transaction List -330- index systems irce ------- 4. CONTROL ACCUMULATORS; Total transactions read by state Total transactions summarized by state Total violations by state Total transactions read by run Total transactions summarized by run Total violations by run 5. GENERAL PROCESSING NOTES: Error messages will be written by a common subroutine, STANDARD-ERROR, to EDIT050R1. One summary output transaction is created for each unique PWS-ID within a state. -331- index systems inc ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) SUM PWS CONTAMINANTS SUM PWS VIOLATIONS (1) (2) INITIALIZE COUNTERS STORE # OF RECORDS PRINT FIN- fAL STATE & RUN TOTALS WRITE PRE- VIOUS STATE COUNTERS INITIALIZE STATE COUNTERS TO '0' WRITE PRE- VIOUS PWS SUMMARY TO SMPVT ,"' ^ t SET CONTAMINANT i VIOLATION COUNTERS TO 'O1 c STOP -332- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize counters. (2) Read a transaction record. (3) Compare to see if a control record and store control totals. (4) If new state, write the prior state totals to the Summarized MSIS Violation Transaction Report EDIT050R1, after matching total violations to control totals. If no match, write error message 06 . Set all PWS contaminant/violation counters to zero. Increment new states transactions counter. (5) Write previous PWS summed record to the SMPVT file and the EDIT050R1 report. Set all PWS contaminant and violation counters to 0. (6) Sum contaminant/violations for each corresponding PWS. (7) At the end of the run, print the run totals. -333- index systems one ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: EDIT055 - Sort Summary Violation Transactions SUBSYSTEM: INPUT DESCRIPTION: Utility Sort/Merge Program ESPVT EDITED SUMMARY PWS INVENTORY VIOLATION: TRANSACT TIONS SORTED SUMMARY PWS INVENTORY VIOLATION RANSACTIONS SUMMARIZE MSIS PWS INVENTORY VIOLATION RANSACTIONS -334- index systems inc ------- 1. SORT SEQUENCE; Data Element REGION STATE PWS-ID Offset Length 1 3 5 2 2 7 Data Type character character character Ascending/ Descending ascending ascending ascending 2. DATA USAGE: Input Files; File Name - Summarized MSIS PWS Inventory Violation Transactions File I.D. - SMPVT File Layout Reference - VIOST Record Name - Violation Trans (01) File Name - Edited Summary PWS Inventory Violation Transactions File I.D. - ESPVT File Layout Reference - VIOST Record Name - Violation Trans (01) Output File; File Name - Sorted Summary PWS Inventory Violation Transactions File I.D. - SSPVT File Layout Reference - VIOST Record Name - Violation Trans (01) -335- snd@K systems me ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: EDIT060 - Sort MSIS PWS Inventory Transactions SUBSYSTEM: INPUT DESCRIPTION: Utility Sort/Merge Program MSISP MSIS PWS INVENTORY TRANSACTIONS EDIT060 SORT SMPUT ^ . SORTED PWS _»J INVENTORY UPDATE ^TRANSACTIONS -336- index systems inc ------- SORT SEQUENCE; Data Element REGION STATE PWS-ID Offset Length Data Type Ascending/ Descending 1 3 5 2 2 7 character character character ascending ascending ascending DATA USAGE: Input File; Output File; File Name - MSIS PWS Inventory Transactions File I.D. - MSISP File Layout Reference - PWSIF Record Names - Inventory PWS Control File Name - Sorted MSIS PWS Inventory Update Trans File I.D. - SMPUT File Layout Reference - PWSIF Record Names - Inventory PWS Control -337- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: EDIT070 - Sort MSIS Variance and Exemption Transactions SUBSYSTEM: INPUT DESCRIPTION; Utility Sort/Merge Program MSISV p**-••"•*. MS Id VARIANCE & EXEMPTION ^TRANSACTIONS, SMVET EDIT070 SORT SORTED MSIS VARI- WANCE & EXEMP TION TRANS- ACTIONS -338- iindex ------- SORT SEQUENCE; Data Element REGION STATE PWS-ID VE-ID Offset 1 3 5 12 Length 2 2 7 5 Data Type character character character character Ascending/ Descending ascending ascending ascending ascending DATA USAGE: Input File; Pile Name - MSIS Variance and Exemption Transactions File I.D. - MSISV File Layout Reference - VAEXF Record Name - V/E Control Output File; File Name - Sorted MSIS Variance and Exemption Transactions File I.D. - SMVET File Layout Reference - VAEXT Record Name - V/E Control -339- index systems inc ------- PROGRAM: SUBSYSTEM: DESCRIPTION: EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION EDIT080 - Merge MSIS Detail Violation Transactions INPUT Utility Sort/Merge Program MPDVT MSIS DETAIL VIOLATION TRANSACTIONS EDITG8G MERGE MMDVT MERGED MSIS DETAIL VIOLATION .TRANSACTIONS -340- index systems inc ------- 1. SORT SEQUENCE; Data Element REGION STATE PWS-ID VIOATION-ID Offset Length Data Type 1 3 5 12 2 2 7 5 character character character character Ascending/ Descending ascending ascending ascending ascending 2. DATA USAGE Input File; File Name - MSIS Detail Violation Transactions File I.D. - MPDVT File Layout Reference - VIODT Record Name - Control Record Output File; File Name - Merged MSIS Detail Violation Transactions File I.D. - MMDVT File Layout Reference - VIODT Record Name - Control Record -341- ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: UPDT010 - Update PSW Inventory File UPDATE This program updates the PWS Inventory File with sorted transactions produced by EDIT010. Two out- put reports are produced also by this program. SPICT PWS 10 PWS IN OLD PWS INVENTORY FILE ' . . . i <&. r A y UPDTOl'O i ' '•;"'-'•. .- ' •' UPDATE PWS INVENTORY FILE "to i f] ,1 NEW PWS INVENTORY • FILE J •UPPTOIORI UPDATE CON- P'ROL & ERROR REPORT: P ENVTRY UPDT010R2 UPDATE RE- PORT: PWS INVENTORY- FILE -342- ------- 1. INTRODUCTION; Function; This program processes add, change and delete transactions against the PWS Inventory File. Transaction Source; Card input as edited by EDIT010 Input Sort Sequence; EPA region, state, PWS identification and transaction code Reports; UPDT010R1 - Update Control and Error Report; PWS Inventory File-lists rejected transactions and update control messages UPDT010R2 - Update Report:PWS Inventory File- lists all posted transactions 2. DATA USAGE; Input Files; File Name - Old PWS Inventory File File I.D. - PSWIO File Layout Reference - PWSIF Record Name - Inventory File Name - Sorted PWS Inventory Card Transactions File I.D. - SPICT File Layout Reference - PWSUT Record Name - PWS Trans (00/01)-(13) Output File; File Name - New PWS Inventory File File I.D. - PWSIN File Layout Reference - PWSIF Record Name - Inventory Table; Table Name - Error Messages Table I.D. - ERRMSG 3. REPORT OUTPUT; UPDT010R1 - Update Control and Error Report: PWS Inventory UPDT010R2 - Update Report: PWS Inventory File -343- ------- 4. CONTROL ACCUMULATORS; Number of SPICT transactions posted per state Number of SPICT transactions rejected per state Number of SPICT transactions posted for the run' Number of SPICT transactions rejected for the run 5.. GENERAL PROCESSING NOTES; The transaction file, SPICT, contains three types of trans- actions, as follows: Transaction code 00 - used to add a new record- All fields beyond record identification fields will be blank (positions 20 - 85). Transaction codes 01-13 - used to change fields on an existing PWS Inventory record or one being added by transaction 00. Transaction code 99 - used to mark for deletion a record which is to be removed from the PWS Inventory File. The PWS Inventory File is organized as a partitioned data set with or° partition for each EPA region. Each region must therefore be accessed as a separate file. The PWS Inventory File is updated sequentially so that each record is read and written to the new master file. A common subroutine, STANDARD-ERROR, is used to print reject messages on UPDT010R1. -344- index systems inc ------- 6. LOGIC CHART; (Numbers Reference PROCESSING STEPS, Section 7) \^ START J (1) INITIALIZE PROCESSING I READ OLD MASTER / t->W.S 1 f ll "h > y t ^READ TRANS- 7 END OF FILE ACTION / SPICT / O END OF STATE PROCESSING 01-13 or 99/TRAN \ 00 CODE? TO PAGE ERROR PROCESSING -345- ------- TRAN CODE 00 FROM PAGE 345 ERROR PROCESSING (6.1 TRANS « MASTER TRANS > MASTER NEW MASTER PROCESSING WRITE NEW MASTER PWSTTJ .*_ READ OLD MASTER PWSIO -346- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all control accumulators to zero and open files. (2) Print the state totals as shown on UPDT010R1. Skip to a new page on both reports. Add the state accumula- tors to the run accumulators and zero out the state accumulators. (3) If TRAN-CODE is not equal to 00, 01-13 or 99 call STANDARD-ERROR to print reject message 015 on UPDT050R1. (4) Compare on REGION, STATE and PWS-ID. (5) Call STANDARD-ERROR to print reject message 016 on UPDT050R1. (6) Create a new PWSIN record in core with all blank fields except REGION, STATE and PWS-ID. Print the transaction on UPDT010R2 but in the data element field print 'NEW RECORD'. Leave old value and new value blank. -347- index systems ------- TRAN CODE 01-13 or 99 ERROR PROCESSING CHANGE MASTER PROCESSING 7 WRITE NEW MASTER PWSIN READ OLD MASTER PWSIQ_ 7 7 -348- ------- END OF FILE PROCESSING (2) END OF STATE PROCESSING WRITE NEW MASTER PWSIN I READ OLD MASTER PWSIO 0 (9) /END OF FILE OF RUN PROCESSING I STOP ) -349- ------- (7) Call STANDARD-ERROR to print reject message 017 -on UPDT050R1. (8) For TRAN-CODE 99, set DEACT-REASON to D and post today's date to LAST-UPDATE and DEACT-DATE. For TRAN-CODE 01 through 12, for each non-blank field, proceed as follows: Replace the corresponding field on the master with the field from the transaction Print a line on UPDT010R2 showing the data element name and the old and new values Post today's date to LAST-UPDATE For the SERVICE-AREA field on transaction 04 and the LAB-CONTROL field on transaction 08, treat each indi- vidual byte as a separate field to be checked for changes. Report any changes, however, for the data element as a whole on UPDT010R2. Transaction 13 contains changes to a particular source within the PWS Inventory record. SOURCES-NUM indicates the number of sources on the PWS Inventory record, up to a maximum of 15. For each TRAN-CODE 13 proceed as follows % If SOURCE-ID-NUM is less than or equal to SOURCES-NUM then make the changes as indicated to the corresponding source fields on the PWS Inventory record If SOURCE-ID-NUM is greater than SOURCES-NUM then add the space necessary for another entire source, process each field change as for TRAN- CODE 01 through 12 and update SOURCES-NUM to indicate the new number of sources. For all transactions, 01 through 13, if any field on the input transaction has an asterisk (*) in the right- most position, set the corresponding master file field equal to blanks and print on the report the same as any other change. (9) Print the run totals as shown on UPDT050R1, close files and end job. - 3 5 o - index systems 'me ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM; SUBSYSTEM: DESCRIPTION; UPDT020 - MSIS Update PWS Inventory File UPDATE This program updates the PWS Inventory File with sorted transactions from the mechanized state processing system MSIS. An update report is pro- duced also by this program. SMPUT PWSIO OLD PWS INVENTORY FILE SORTED MSIS PwS UPDATE TRANSAC- TIONS UPDT020 MSIS UPDATE PWS INVENTORY FILE PWS IN NEW PWS INVENTORY FILE UPDT020R1 MSIS UPDATE REPORT: PWS INVENRO FILE -351 Index systems toe ------- 1. INTRODUCTION; Function; This program processes change transactions against the PWS Inventory File. Transaction Source; Created by the mechanized state pro- cessing systems, MSIS Input Sort Sequence; EPA region, state and PWS identification Report; UPDT020R1 - MSIS Update Report: PWS Inventory File - a listing of all records which were changed and the processing control totals 2. DATA USAGE; Input Files; File Name - Old PWS Inventory File File I.D. - PWSIO File Layout Reference - PWSIF Record Name - Inventory File Name - Sorted MSIS PWS Update Transactions File I.D. - SMPUT File Layout Reference - PWSIF Record Names - Inventory PWS Control Output File; File Name - New PWS Inventory File File I.D. - PWSIN File Layout Reference - PWSIF Record Name - Inventory 3. REPORT OUTPUT; UPDT020R1 - MSIS Update Report: PWS Inventory File 4. CONTROL ACCUMULATORS; Number of records added to PWS Inventory File per state Number of records replaced on PWS Inventory File per state Number of records added to PWS Inventory File for the entire run Number of records replaced on PWS Inventory File for the entire run ~352~ index systems inc ------- 5. GENERAL PROCESSING NOTE; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. This up- date run operates in a sequential fashion, reading each record on the entire data set. -353- index systems inc ------- 6. LOGIC CHART (Numbers Reference PROCESSING STEPS, Section 7) 51. REPLACE MASTER RECORD PROCESSING READ OLD MASTER pwsrn READ TRANSACTION SMPUT SET TRANS KEY TO INDI- CATE END OF FILE ^ No ON OLD MASTE END OF STATE PROCESSING TRANS> MASTER ADD MASTER RECORD PROCESSING WRITE NEW MASTER PWSIN READ OLD MASTER PWSIO END OF FILE .-- SET MASTER KEY END OF FILE ON TRANS TO INDICATE EOF END OF JOB PROCESSING -354- ------- 7. PROCESSING STEPS; (Numbers refer to LOGIC CHART, Section 6) (1) Initialize all control accumulators to zero and open files. (2) A control record is recognized by having hexadecimal F's in PWS-ID. (3) Compare on REGION, STATE and PWS-ID. (4) Print a line as indicated on UPDT020R1 with an action taken message 'NEW RECORD ADDED1. Create a new PWS Inventory record in core and post today's date to LAST-UPDATE. (5) Print a line as indicated on UPDT020R1 with an action taken message 'EXISTING RECORD REPLACED1. Replace the existing record in core with the transaction record and post today's date to LAST-UPDATE. (6) Print the state totals as indicated on UPDT020R1. The 'TOTAL INPUT' figure is TOTAL-INPUT from the control record. If TOTAL-INPUT does not equal the sum of ac- cumulators for the number of records added and the number of records replaced, then print the out of balance message as indicated. Add the state accumulators to the run accumulators and zero out the state accumulators. (7) Store hexadecimal F's in the comparison key of the trans- action file to permit processing the remainder of the PWS inventory File. (8) Store hexadecimal F's in the comparison key of the PWS Inventory File to permit processing the remainder of the transactions. (9) Print run totals on UPDT020R1, close files and end job. -355- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: UPDT030 - Update PWS Inventory Violations UPDATE This program updates the PWS Inventory File with sorted summary violation transactions originating from the merged output of EDIT040 and EDIT050. An update report and an error report are produced also by this program. SSPVT 'SORTED 'SUMMARY PW£ INVENTORY VIOLATION TRANS. PWS 10 PWS IN OLD PWS INVENTORY FILE V A V UPDT030 TT-nr-i TV m-p T3TA7C UPDA1.D FWo INVENTORY VIOLATIONS i NEW PWS INVENTORY FILE _j UPDT030R1 UPDATE CON- TROL & ERROJ RPT. SUMMAR VIOLA- UPDT030R2 UPDATE RPT: PWS INVTRY/ VIOLATION! -356- index systems inc ------- 1. INTRODUCTION'. Function; This program processes summary violation trans- actions against the PWS Inventory File. Transaction Source; Summarized from detail transactions created by the mechanized state pro- cessing system, MSIS, and from card input edited by EDIT040 Input Sort Sequence; EPA region, state and PWS identifica- tion Reports; UPDT030R1 - Update Control and Error Report: Summary Violations - lists control messages and all rejected transac- tions UPDT030R2 - Update Report: PWS Inventory/ Violations - lists each field change which was posted 2. DATA USAGE Input Files; File Name - Old PWS Inventory File File I.D. - PWSIO File Layout Reference - PWSIF Record Name - Inventory File Name - Sorted Summary PWS Inventory Violation Transactions File I.D. - SSPVT File Layout Reference - VIOST Record Name - Violation Trans (01) Output Files Table: File Name - New PWS Inventory File File I.D. - PWSIN File Layout Reference - PWSIF Record Name - Inventory Table Name - Error Messages Table I.D. - ERRMSG -357- index systems irac ------- 3. REPORT OUTPUT UPDT030R1 - Update Control and Error Report: Summary Violations UPDT030R2 - Update Report: PWS Inventory/Violations 4. CONTROL ACCUMULATORS; Number of SSPVT transaction records posted per state Number of SSPVT transaction records rejected per state Number of SSPVT transaction records posted for the run Number of SSPVT transaction records rejected for the run Number of SSPVT violations posted per state Number of SSPVT violations rejected per state Number of SSPVT violations posted for the run Number of SSPVT violations rejected for the run 5. GENERAL PROCESSING NOTES; The input transaction file, SSPVT, is a merged file con- taining records originating from MSIS and records originating from card input. The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. This up- date run operates in a sequential fashion, reading each record on the entire data set. A common subroutine, STANDARD-ERROR, is used to print reject messages on UPDT030R1. -358- index systems Sue ------- 6. LOGIC CHART; (Numbers Reference PROCESSING STEPS, Section 7) START (1) INITIALIZE PROCESSING READ OLD MASTER PWSIO END OF FILE READ TRANSACTION SSPVT TJ t 9 1 t 1 8 END & OF STATE PROCESSING 8 (6) (4) ERROR PROCESSING ^MASTER SET TRANS KEY TO INDICATE NEW STATE RANS = ASTER END OF STATE PROCESSING TRANS:MASTER TRANS > MASTER WRITE NEW MASTER TRANSACTION PROCESSING READ OLD MASTER PWSIO END OF FILE END OF FILE ON TRANS SET MASTER KEY TO INDICATE EOF END OF RUN PROCESSING -359- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all control accumulators to zero and open files. (2) Compare on REGION, STATE and PWS-ID. (3) The VIOLATIONS ACCUMULATORS occur six times on the transaction record corresponding to the six occurrances on the master file. For each non-zero field on the transaction, proceed as follows: Add the transaction amount to the master file corresponding year to date accumulator. Add the transaction amount to the master file corresponding total accumulator. If any field has an asterisk (*) in the right-most position, re-initialize the corresponding master file field to zero. Print a line on UPDT030R2 showing the old and new values of the year to date accumulator only. In the data element column, append the following four-position designators to the data element name to distinguish which accumulator is being updated: PHYS - physical INOR - inorganic chemicals PSOR - pesticides and organic chemicals MICE - microbiological RADI - radioactive TREA - treatment Post today's date to LAST-UPDATE. (4) Call STANDARD-ERROR to print reject message 017 on UPDT030R1. (5) Print the state totals as shown on UPDT030R1. Skip to a new page on both reports. Add the state accumu- lators to the run accumulators and zero out the state accumulators. (6) Store hexadecimal F's in the comparison key of the transaction file to permit processing the remainder of the PWS Inventory File. : (7) Store hexadecimal F's in the comparison key of the PWS Inventory File to permit processing the remainder of the transactions. (8) Print run totals as indicated on UPDT030R1 and close files. -360- index systems irae ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: UPDT040 . - Year End PWS Inventory File Update UPDATE This program updates the PWS Inventory File by zeroing out all the year-to-date violation ac- cumulators. An output report and a tape file of purged records are also created. PWS 10 ' J OLD PWS INVENTORY FILE UPDT040 YEAR END PWS INVENTORY FILE UPDATE UPDT040R1 YR. END PWS INVTY. CON- TROL & DE- LETION LIST NEW PWS INVENTORY FILE PWS IN PURGED PWS INVENTORY FILE PWS IP -361- index systems inc ------- 1. INTRODUCTION Function; This program clears the year-to-date violation accumulators on the PWS Inventory File and purges all records which have been deactivated for more than one year. Report; UPDT040R1 - Year End PWS Inventory Control and Deletion List - lists records being purged from the file. DATA USAGE: Input File; Output Files; File Name - Old PWS Inventory File File I.D. - PWSIO File Layout Reference - PWSIF Record Name - Inventory File Name - New PWS Inventory File File I.D. - PWSIN File Layout Reference - PWSIF Record Name - Inventory File Name - Purged PWS Inventory File File I.D. - PWSIP File Layout Reference - PWSIF Record Name - Inventory REPORT OUTPUT: UPDT040R1 - Year End PWS Inventory Control and Deletion List CONTROL ACCUMULATORS; Number of records read from PWSIO per state Number of records written to PWSIN per state Number of records deleted and written to PWSIP per state Number of records read from PWSIO for the run Number of records written to PWSIN for the run Number of records deleted and written to PWSIP for the run -362- index systems one ------- 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. This up- date run operates in a sequential fashion, reading each record on the data set. -363- index systems inc ------- 6. LOGIC CHART: (Numbers Reference PROCESSING STEPS, Section 7) r > ^ START J <» , , INITIALIZE PROCESSING \ 9 _j t /READ OLD MASTER PWSIO / .1 1 VEND . OF FILI 6^ r 4f ~w QTDP END OF RUN \^ *LUV ^ PROCESSING END OF STATE PROCESSING WRITE NEW MASTER PWSIN PURGED RECORD PROCESSING -*© -364- ------- PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (I) Initialize all control accumulators to zero and open files. (2) Print the state totals as shown on UPDT040R1. Add the state accumulators to the run accumulators and zero out the state accumulators. (3) Purge the record if DEACT-DATE is more than one year prior to the current date. (4) Write a line on UPDT040R1. See the Deactivation Reason Table for the descriptions to be printed for each DEACT-REASON. (5) Zero out the following fields before writing each record to the output file: VIO-CONTAM-YTD VIO-SAMP-YTD VIO-OTHER-YTD (Each field occurs six times.) (6) Perform the end of state processing as in step (2). Print the run totals as shown on UPDT040R1 , close files and end job. index systems 'me ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: UPDT045 - Merge PWS Inventory Purged Records SUBSYSTEM: UPDATE DESCRIPTION: Utility Sort/Merge Program PIPFO OLD PURGED PWS INVENTORY FILE MERGED PWS INVENTORY URGED RECORD FILE PURGED PWS INVENTORY FILE SORT/MERGE -366- index systems inc ------- 1. SORT SEQUENCE; Ascending/ Data Element Offset Length Data Type Descending REGION 1 2 character ascending STATE 3 2 character ascending PWS-ID 5 7 character ascending DATA USAGE; Input File; File Name - Purged PWS Inventory File File I.D. - PWSIP File Layout Reference - PWSIF Record Name - Inventory File Name - Old Purged PWS Inventory File File I.D. - PIPFO File Layout Reference - PWSIF Record Name - Inventory Output File; File Name - Merged PWS Inventory Purged Records File File I.D, - PIPFN File Layout Reference - PWSIF Record Name - Inventory -367- ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: UPDT050 - Update Variance and Exemption File UPDATE This program updates the Variance and Exemption file with sorted transactions produced by EDIT030, Two reports and an output tape of purged variance and exemption records are produced also. SVECT <* N SORTED rVARIANCE & EXEMPTION i CARD . N^ TRANS. VAEXO OLD VARIANCE EXEMPTION FILE VAEXN fPDTQSO UPDATE VARI- ANCE AND EXEMPTION FILE UPDT050R1 UPDATE TROL & RPT:VARIAN- CES & EXEMPj TIONS VARIANCE EXEMPTION UPDT050R2 UPDATE RPT: VARIANCES & EXEMPTIONS VARIANCE EXEMPTION PURGED RECORDS -368- index systems Srse ------- INTRODUCTION; Function: This program processes add, change and delete transactions against the Variance and Exemption File. Records meeting the criteria for purging are written to a Variance and Exemption Purged Records tape. Transaction Source; Card input as edited by EDIT030 Sort Sequence; EPA region, state, PWS identification, variance/exemption identification and trans- action code Reports; UPDT050R1 - Update Control and Error Report Variances and Exemptions - lists rejected trans- actions and update control messages UPDT050R2 - Update Report Variances and Exemp- tions - lists all posted transactions DATA USAGE: Input Files; Output Files; File Name - Variance and Exemption File File I.D. - VAEXO File Layout Reference: VAEXF Record Name - Variance/Exemption File Name - Sorted Variance and Exemption Card Transactions File I.D. - SVECT File Layout Reference: VAEXT Record Name - V & E Trans (00/01) File Name - Variance and Exemption File File I.D. - VAEXN File Layout Reference: •VAEXT Record Name - Variance/Exemption File Name - Variance and Exemption Purged Records File I.D. - VEPRG File Layout Reference: VAEXF Record Name - Variance/Exemption -369- index systems fnc ------- Table; t Table Name - Error Messages Table I.D. - ERRMSG 3. REPORT OUTPUT: UPDT050R1 - Update Control and Error Report: Variances and Exemptions UPDT050R2 - Update Report: Variances and Exemptions CONTROL ACCUMULATORS: Number of SVECT transactions posted per state Number of SVECT transactions rejected per state Number of SVECT transactions posted for the run Number of SVECT transactions rejected for the run 5. GENERAL PROCESSING NOTES; The transaction file, SVECT, contains three types of trans- actions, as follows: Transaction code 00 - used to add a new record. All fields beyond record identification fields will be blank (positions 25 - 65) Transaction code 01 - used to change fields on an existing variance and exemption record or one being added by transaction 00 Transaction code 99 - used to mark for deletion a record which is to be removed from the variance and exemption file The Variance and Exemption Master File, VAEXO, is processed in a sequential manner and a new master file, VAEXN, is created during each run. A common subroutine STANDARD-ERROR is used to print reject messages on UPDT050R1. _370- ------- 6. LOGIC CHART: (Numbers Reference PROCESSING STEPS, Section 7) f START J (1) INITIALIZE PROCESSING READ OLD MASTER READ TRANS- ACTION SVECT / (2) END OF STATE PROCESSING ERROR PROCESSING -371- ------- TRAN CODE 00 NEW MASTER PROCESSING ERROR PROCESSING TRANS MASTER = MASTER TRANS>MASTER WRITE PURGE MASTER DEACTIVE RECORD VEPRG WRITE NEW MASTER READ OLD MASTER VAEXO -372- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all control accumulators to zero and open files. (2) Print the state totals as shown on UPDT050R1. Skip to a new page on both reports. Add the state accumulators to the run accumulators and zero out the state accumula- tors . (3) If TRAN-CODE is not equal to 00, 01 or 99 call STANDARD- ERROR to print reject message 015 on UPDT050R1. (4) Compare on REGION, STATE, PSW-ID and VE-ID. (5) Call STANDARD-ERROR to print reject message 016 on UPDT050R1. (6) Create a new VAEXN record in core with all blank fields except REGION, STATE, PWS-ID and VE-ID. Print the trans- action on UPDT050R2 but in the data element field print 'NEW RECORD". Leave old value and new value blank. (7) If VE-STATUS is D and LAST-UPDATE is more than 5 years before the current date then the master record is to be purged. -373- index systems inc ------- TRAN CODE 01 or 99 (8) ERROR PROCESSING TRANS = 1ASTER MASTER EACTIVE 5 YRS. (i) CHANGE MASTER PROCESSING WRITE NEW MASTER VAEXN READ OLD MASTER VAEXO WRITE PURGE RECORD VEPRG -374- ------- END OF FILE PROCESSING (2) END OF STATE PROCESSING WRITE NEW MASTER VAEXN READ OLD MASTER VAEXO MASTER EACTIVE 5 YRS. WRITE PURGE RECORD VEPRG B 7 (10) FILE END OF RUN PROCESSING STOP -375- ------- ( 8) Call STANDARD-ERROR to print reject message 017 on UPDT050R1. ( 9) For TRAM-CODE 99, set VE-STATUS to D and post today's date to LAST-UPDATE. For TRAN-CODE 01, check each field on the transaction beginning with VE-STATUS. For each non-blank field, replace the corresponding field on the master. Also print a line on UPDT050R2 showing the data element name and old and new values. Also post today's date to LAST-UPDATE. If any field on the input transaction has an asterisk (*) in the right-most position, set the corresponding master file field equal to blanks and print on UPDT050R2 the same as any other change. (10) Print the run totals as shown on UPDT050R1. close files and end the job -376- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: UPDT060 - MSIS Update Variance and Exemption File UPDATE This program updates the Variance and Exemption File with sorted transactions from the mechanized state processing system, MSIS. An update report is produced also by this program. SMVET VAEXO SORTED MSIS (VARIANCE & EXEMPTION TRANS- VAEXN OLD VARIANCE & EXEMPTION FILE UPDT060 SIS UPDATE VARIANCE AND EXEMPTION FILE UPDT060R1 MSIS UPDATE RPT: VARI- ANCES & EX- EMPTIONS VARIANCE & EXEMPTION PURGED RECORDS -377- index systems inc ------- INTRODUCTION; Function; This program processes change transactions against the Variance and Exemption File. Transaction Source: Input Sort Sequence; Created by the mechanized state processing system, MSIS EPA region, state, PWS identifi- cation and variance/exemption identification Report; UPDT060R1 - MSIS Update Report: Variances and Exemptions - a listing of all records which were changed and the processing control totals DATA USAGE Input Files; Output Files; File Name - Old Variance and Exemption File File I.D. - VAEXO File Layout Reference - VAEXF Record Name - Variance/Exemption File Name - Sorted MSIS Variance and Exemption Transactions File I.D. - SMVET File Layout Reference - VAEXF Record Names - Variance/Exemption V/E Control File Name - New Variance and Exemption File File I.D. - VAEXN File Layout Reference - VAEXF Record Name - Variance/Exemption File Name - Variance and Exemption Purged Records File I.D. - VEPRG File Layout Reference - VAEXF Record Name - Variance/Exemption -378- index systems inc ------- 3. REPORT OUTPUT; UPDT060R1 - MSIS Update Report: Variance and Exemptions 4. CONTROL ACCUMULATORS; Number of records added to Variance and Exemption File per state Number of records replaced on Variance and Exemption File per state Number of records added to the Variance and Exemption File for the run Number of records replaced on Variance and Exemption File for the run 5o GENERAL PROCESSING NOTES; The Variance and Exemption Master File, VAEXO, is processed in a sequential manner and a new master file, VAEXN, is created during each run. -379- index systems owe ------- 6. LOGIC CHART; (Numbers Reference PROCESSING STEPS, Section 7) INITIALIZE PROCESSING READ OLD MASTER READ TRANSACTION INPUT INDICATE EOF CONTROL RECORD REPLACE MASTER TRANS 2 MASTER END OF STATE RECORD PROCESSING PROCESSING RANS > MASTER ADD MASTER RECORD PROCESS ING MASTER \Ye-g DEACTIVE 5 YRS. WRITE PURGE RECORD WRITE NEW MASTER WZVPY READ OLD MASTER SET MASTER KEY TO INDICATE EOF END OF RUN PROCESSING C STOP -380- ------- 7. PROCESSING NOTES; Numbers reference LOGIC CHART, Section 6) (]) Initialize all control accumulators to zero and open files. (2) A control record is recognized by having hexadecimal F's in PWS-ID and VE-ID. (3) Compare on REGION, STATE, PWS-ID and VE-ID. (4) Print a line as indicated on UPDT060R1 with an action taken message 'NEW RECORD ADDED1. Create a new Variance and Exemption record in core and post today ' s date to LAST-UPDATE. (5) Print a line as indicated on UPDT060R1 with an action taken message 'EXISTING RECORD REPLACED1. Replace the current master record in core with the transaction and post today's date to LAST-UPDATE. (6) If VE-STATUS is D and LAST-UPDATE is more than 5 years before the current date then the master record is to be purged. (7) Print the state totals as indicated on UPDT060R1. The 'TOTAL INPUT1 figure is TOTAL-INPUT from the control record. If TOTAL-INPUT does not equal the sum of the accumulators of number of records added and number of records replaced on Variance and Exemption File, then print the out of balance message as indicated. Add the state accumulators to the run accumulators and zero the state accumulators. (8) Store hexadecimal F's in the comparison key of the transaction file to permit processing the remainder of the PWS Inventory File. (9) Store hexadecimal F's in the comparison key of the PWS Inventory File to permit processing the remainder of the transactions. (10) Print run totals as indicated on UPDT060R1 and close files. -381- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM; UPDT065 - Merge Variance and Exemption Purged Records SUBSYSTEM: UPDATE DESCRIPTION: Utility Sort/Merge Program VEPFO OLD VARIANCE & EXEMPTION PURGED FILE MERGED VARIANCE & EXEMPTION PURGED REC- ORDS FILE VARIANCE & EXEMPTION PURGED RECORDS SORT/MERGE -382- index systems inc ------- 1. SORT SEQUENCE; Data Element Offset Length Data Type REGION 1 2 character STATE 3 2 character PWS-ID 5 7 character VE-ID 12 5 character Ascending/ Descending ascending ascending ascending ascending 2. DATA USAGE: Input Files; File Name - Variance and Exemption Purged Records File I.D. - VEPRG File Layout Reference - VAEXF Record Name - Variance/Exemption File Name - Old Variance and Exemption Purged File File I.D. - VEPFO File Layout Reference - VAEXF Record Name - Variance/Exemption Output File; File Name - Merged Variance and Exemption Purged Records File File I.D. - MVEPG File Layout Reference - VAEXF Record Name - Variance/Exemption -383- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: UPDT070 - Update Processing Tables UPDATE This program creates any necessary processing tables on disk from card input. J V \ TABLE DATA I . »• F UPDT070 UPDATE PROCESS- ING TABLES ». ~"'f PROCESSING TABLES L W -384- index systems inc ------- INTRODUCTION: Many of the programs utilize common data tables such as the State Table, STATAB. For this reason, these tables should be maintained on a disk or tape file so they can be easily accessed by many programs. Card formats are needed to create the data tables. The purpose of this program is to read the cards, validate them and create the tables. This program cannot be specified in detail until the re- mainder of the processing tables are defined by state EPA personnel for MSIS. -385- ircdex systems one ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: PRRP010 - Edit Inventory Report Selection Cards PERIODIC REPORTING This program edits selection control cards for selecting PWS Inventory reports. It produces a deck of edited selection cards, and a selection Translation and Error Report PRRP010R1. PIRSC REPORT SELECTION CARDS PRRPOIO EDIT INVENTORY REPORT SELEC- TION CARDS PRRP010R1 SELECTION TRANSLATION & ERROR REPORT EDITED REPORT SELECTION CARDS EIRSC -386- index systems inc ------- INTRODUCTION; Function; This program edits selection control cards for selecting PWS Inventory reports. Input Source; Card input keypunched from input forms. Input Sort Sequence; All "AND" operaters must come first. Reports; PRRP010R1 - Selection Translation and Error Report: PWS Inventory DATA USAGE: Input Files; Output File; File Name - Report Selection Cards File I.D. - PIRSC File Layout Reference - PRRSC Record Names - Header Card Selection Card File Name - Edited Report Selection Cards File I.D. - EIRSC File Layout Reference - EPRSC Record Names - Edited Header Card Edited Selection Card Tables: Table Name Table I.D. Table Name Table I.D. State Table STATAB Inventory Selection Table ISLTAB REPORT OUTPUT: PRRP010R1 - Selection Translation and Error Report; PWS Inventory CONTROL ACCUMULATORS; Number of selection cards read and passed Number of selection cards punched -387- index systems inc ------- 5. GENERAL PROCESSING NOTES; A common subroutine, STANDARD-ERROR, is used to print error messages on PRRP010R1. Any data element can become a selection criteria if it is included in the Selection Table. -388- . . . index systems me ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) f START J I INITIALIZE CONTROL COUNTERS ©• t READ CONTROL CARD (1) READ AND STORE TABLES (2) (3) .(4) INCREMENT TRANSACTION COUNTER E PRINT ERROR MESSAGE 'RRP010R1 ALID TRANSACTION PRINT CONTROL TOTALS PRRP010R1 (10) f STOP J (7) PRINT RANSLATED SELECTION PRRP010R1 I F PUNCH EDITED SELECTION CARD (8) (9) INCREMENT ACCEPTED COUNTER -389- ------- PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all control counters to zero. (2) Read and store State Table and Selection Table. (3) Read a selection control card. (4) Increment transaction counter. (5) Validate transaction The selection control card must have 1 - 7 in column 1 and 0 or 1 in column 2. If not write error message 009. For each selection card, validate according to the edit requirements in the Data Element Descriptions. The sort code, if it exists, should not be identical to any other sort code. If it does exist, a sort table should be prepared, and punched at the end of the run. Write an error message to PRRP010R1 for any errors which are found. (6) If any errors occur, print the appropriate error message and do not punch any further cards. Continue editing transactions. (7) If all of the fields are valid, punch output cards. If the mnemonic is "SOURCE" a series of 15 control cards will be punched, each with the same value, but with the different offsets and lengths as found in the Selection Tables, If not "SOURCE" one control card will be punched, using the offset and length as found in the Selection Table. (8) A "translated" selection will be printed on PRRP010R1 for each punched control card, as shown on the report layout, using the current transaction counter as the card number. (9) The control card acceptance counter is incremented. (10) At the end of the run control totals are printed and a sort control table is punched from those records whose sort sequence is indicated. index systems line -390- ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAMS SUBSYSTEM: DESCRIPTION: PRRP020 - Generate PWS Inventory Reports PERIODIC REPORTING This program generates six PWS Inventory Reports according to specifications which are entered on cards. EIRSC REPORT SELECTION CARDS PWS IF PWS INVENTORY FILE PRRP020 GENERATE PWS INVENTORY REPORTS PRRP020R1- R6 PWS INVEN- TORY REPORTS PIESF PWS INVENTORY EXPANDED SORT FILE -391- index systems ------- 1. INTRODUCTION; Function; This program generates six PWS Inventory Reports based on report selection cards produced by PRRP010. Reports; PRRP020R1 - Public Water Systems Comprehensive List - a comprehensive list of public water systems, one per page. PRRP020R2 - Public Water Systems Detailed Listing - a detailed listing of public water systems, two per page. PRRP020R3 - Public Water Systems Address, Capacity and Source Data - a listing of PWS name and address and source data, twelve per page. PRRP020R4 - Public Water Systems State Discretionary Data - a report showing name and state discretionary data, two lines per PWS. PRRP020R5 - Public Water Systems Service Area and Source Data - a listing of PWS location and source data, one line per PWS. PRRP020R6 - Public Water Systems Codes and Miscel- laneous Data - a report of codes, dates and other miscellaneous data, one line per PWS. 2. DATA USAGE; Input Files; File Name - PWS Inventory File File I.D. - PSWIF File Layout Reference - PWSIF Record Name - Inventory File Name - Edited Report Selection Cards File I.D. - EIRSC File Layout Reference - EPRSC Record Names - Edited Header Card Edited Selection Card Intermediate Sort File: File Name - PWS Inventory Expanded Sort File File I.D. - PIESF File Layout Reference - PWSIF Record Name - Expanded Inventory -392- index systems inc ------- Tables; Table Name - State Table Table I.D. - STATAB 3. REPORT OUTPUT; PRRP020R1 - R6 - PWS Inventory Reports 4. CONTROL ACCUMULATORS; Total inventory records printed per report. 5. GENERAL PROCESSING NOTES; The program will sort and select records for report generation, based on the selection criteria being entered on cards. A subroutine is used to compare PWS Inventory records to a group of parameters defined by the selection control card (punched by PRRP010). -393- index systems ane ------- 6. LOGIC CHART; (Numbers reference PROCESSING STEPS, Section 7) f START J INITIALIZE COUNTERS (1) READ SELECi TION CON- TROL CARDS END OF REPORT GROUP (2) READ SORTED RECORDS YES (5) WRITE RECORD TO SORT fRITE RE- PORT 'RRP020 R1-R6 INCREMENT RECORD COUNTER [COMPARE TOTALS [ WRITE COUNTERS 7 (9); -394- ------- PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize counters. (2) Read all of the selection control cards for a report type, Store the report indicator (column 1 of header card). Store the address indicator (0 = mailing address, 1 = plant address)from the header card. Store the sort sequence number, starting position and length of each selection element identified as a sort parameter. Define a group of parameters to be passed to a selection subroutine. The parameters should contain the variable position in the record, the relation, the value and a switch to indicate if a failure to meet the parameter rejects the record (all "AND" operators) or if the next comparison is used ("OR"operators). (3) Read an Inventory record and pass the record to the selection routine. (4) The selection routine should return a 0 for select, or 1 for fail. If the record is a fail the program should read the next Inventory record. (5) Write the record (using the appropriate address) to a sort routine to be sorted by the stored sequence. This record should contain all of the information as indicated on the selected report layout. (6) After all records are read and processed, read the sorted file. Compute totals according to sort levels. (7) Write the Selected Inventory Report as indicated on the corresponding report layout and increment the record counter for each record printed. (8) After all sorted records are processed, print the total records written. (9) If another set of report selections exist, go to step one (1) and produce the next report. - 3 9 5 - index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: PRRP030 - Edit Variance and Exemption Report Selection Cards PERIODIC REPORTING This program edits selection control cards for selecting the parameters of the Variance and Exemption Review List. It produces a deck of edited selection cards, and a selection Trans- lation and Error Report PRRP030R1. VERSC REPORT SELECTION CARDS PRRP030 EDIT VARIANCE & EXEMPTION REPORT SELEC- TION CARDS PRRP030R1 SELECTION TRANSLATION & ERROR REPORT EDITED REPORT SELEC- TION CARDS EVRSC -396- index systems inc ------- INTRODUCTION: Function: This program edits selection control cards for selecting parameters of the Variance and Exemption Review List. Input Source; Card input keypunched from input forms. Input Sort Sequence; All "AND" operators must come first. Reports; PRRP030R1 - Selection Translation and Error Report: Variance and Exemption DATA USAGE: Input Files; Output File; File Name - Report Selection Cards File I.D. - VERSC File Layout Reference - PRRSC Record Names - Header Card Selection Card File Name - Edited Report Selection Cards File I.D. - EVRSC File Layout Reference - EPRSC Record Names - Edited Header Card Edited Selection Card Tables: Table Name Table I.D. Table Name Table I.D. State Table STATAB Variance and Exemption Selection Table VESTAB 3. REPORT OUTPUT: PRRP030R1 - Selection Translation and Error Reports Variance and Exemptions 4. CONTROL ACCUMULATORS; Number of selection cards read and passed Number of selection cards punched. -397- index systems inc ------- 5. GENERAL PROCESSING NOTES; A common subroutine, STANDARD-ERROR, is used to print error messages on PRRP030R1. Any data element can become a selection criteria if it is included in the Selection Table. — 39 8— index systems ie?e ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) START INITIALIZE CONTROL COUNTERS (£> READ CONTROL CARD (1) READ AND STORE TABLES (2) (3) INCREMENT TRANSACTION COUNTER PRINT ERROR MESSAGE PRRP030R1 END C STOP (4) ALID TRANSACTION PRINT CONTROL TOTALS PRRP030R1 (10) (7) PRINT RANSLATED SELECTION PRRP030R1 PUNCH EDITED SELECTION CARD (8) INCREMENT ACCEPTED COUNTER (9) -399- ------- PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all control counters to zero. (2) Read and store State Table and Selection Table. (3) Read a selection control card. (4) Increment transaction counter. (5) Validate transaction The selection control card must have 0 or 1 in column 1. If not write error message 009. For each selection card, validate according to the edit requirements in the Data Element Descriptions. The sort code, if it exists, should not be identical to any other sort code. If it does exist, a sort table should be prepared, and punched at the end of the run. Write an error message to PRRP030R1 for any errors which are found. (6) If any errors occur, print the appropriate error message and do not punch any further cards. Continue editing transactions. (7) If all of the fields are valid, punch output cards. If the mnemonic is "SOURCE" a series of 15 control cards will be punched, each with the same value, but with the different offsets and lengths as found in the Selection Table. If not "SOURCE" one control card will be punched, using the offset and length as found in the Selection Table. (8) A "translated" selection will be printed on PRRP030R1 for each punched control card, as shown on the report layout, using the current transaction counter as the card number. (9) The control card acceptance counter is incremented. (10) At the end of the run control totals are printed and a sort control table is punched from those records whose sort sequence is indicated. - 4 0 0 - index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: PRRP040 - Generate Variance and Exemption Review List PERIODIC REPORTING This program generates the Variance and Exemption Review List according to specifications which are entered on cards. PWSIF VAEXF PWS INVENTORY FILE EVRSC EDITED REPORT SELECTION CARD PRRP040 GENERATE VAR- IANCE & EXEMP- TION REVIEW LIST PRRP04QR1 VARIANCE & EXEMPTION REVIEW LIST VEESF VARIANCE & EXEMPTION EXPANDED SORT FILE -401- index systems inc ------- INTRODUCTION; Function r This program generates the Variance and Exemption Review List based on report selection cards pro- duced by PRRP030. Reports; PRRP040R1 - Variance and Exemption Review List - lists variances and exemptions meeting the criteria specified on selection cards. DATA USAGE: Input Files; File Name - PWS Inventory File File I.D. - PSWIF File Layout Reference - PWSIF Record Name - Inventory File Name - Variance and Exemption File File I.D. - VAEXF File Layout Reference - VAEXF Record Name - Variance/Exemption File Name - Edited Report Selection Cards File I.D. - EVRSC File Layout Reference - EPRSC Record Names - Edited Header Card Edited Selection Card Intermediate Sort File: File Name - Variance and Exemption Expanded Sort File File I.D. - VEESF File Layout Reference - VEESF Record Name - Expanded Variance/Exemption Record Tables: Table Name Table I.D. Table Name Table I.D. Table Name Table I.D. State Table STATAB Treatment Table TRETAB Contaminant Table CONTAB -402- index systems inc ------- 3. REPORT OUTPUT; PRRP040R1 - Variance and Exemption Review List 4. CONTROL ACCUMULATORS; Total variances and exemptions printed. 5. GENERAL PROCESSING NOTES; The program will sort and select records for report genera- tion, based on the selection criteria being entered on cards. A subroutine is used to compare Variance and Exemption re- cords to a group of parameters defined by the selection con- trol card (punched by PRRP030). The following variables should be matched to internally-coded tables, and the table values printed: Variable Table Status Status Table Milestone Milestone Table Reason Reason Table -403- Index, systems 'm® ------- 6. LOGIC CHART; (Numbers reference PROCESSING STEPS, Section 7) START /WRITE RE- PORT 'PRRP040R1 INITIALIZE COUNTERS (1) READ 'TION CON- TROL CARDS rTO END (2! (3) /READ VARI- ANCE AND /EXEMPTION / FILE READ SORTED RECORDS INCREMENT RECORD COUNTER WRITE COUNTERS YES (7) 'READ INVEN-y TORY FILE (5) /RITE COM- BINED CCORD TO SORT (6) STOP ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize counters. (2) Read ail of the selection control cards. Store the address indicator (0 = mailing address, 1 = plant address) from the header card and the sample percentage. Store the sort sequence number, starting position and length of each selection element identified as a sort paramter. Define a group of parameters to be passed to a selec- tion subroutine.- The parameters should contain the variable position in the record, the relation , the value and a switch to indicate if a failure to meet the parameter rejects the record (all "AND" operators) or if the next'comparison is used ("OR" operators). (3) Read a Variance and Exemption record and pass the record to the selection routine. (4) The selection routine should return a 0 for select, or 1 for fail. If the record is a fail the program should read the nexL Variance and Exemption record. (5) Match the PWS-ID to the Inventory File PWS-iD. if no match put-"NO INVENTORY RECORD" in name and address field. (6) Write a combined record (using the appropriate address) to a sort routine to be sorted by the stored sequence. This record should contain all of the information as indicated on the PRRP040R1 report layout. Note that the address, region, district, population, community and type of source are obtained from the PWS Inventory File. (7) After all Variance and Exemption records are read and processed, read the sorted file. (8) Write the Variance and Exemption Review List PRRP040R1, as indicated on the report layout and increment the record counter for each record printed. (9) After all sorted records are processed, print the total records written. -405- index systems 'me ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAMS SUBSYSTEM: DESCRIPTION: ANRP020 - Generate Compliance Profiles ANNUAL REPORTING This program generates two compliance summary summary reports reflecting violation occurrances, Various criteria are specified by the user on card input. PWSIF PWS INVENTORY FILE CPRSC ^ REPORT SELECTION CARD V, . f ANRP020 GENERATE COMPLIANCE PROFILES ANRP020R1 :OMPLIANCE PROFILE SHOW- ING NUMBER OF PWS's ANRP020R2 :OMPLIANCE PRO- TILE SHOWING POPULATION SERVED -406- ------- INTRODUCTION: This program creates two summary level reports 1 t T\ i"*ii -f* ty Y^^/"* T -P-i /-i a 4- -J ^M«* e» Function; This program creates two summary 1< based on card input specifications, Reports; ANRP020R1 - Compliance Profile Showing Number of Public Water Systems - shows number of water systems within categories based on number of violations and population served ANRP020R2 - Compliance Profile Showing Population Served - shows population served by water sys- tems within categories based on number of vio- lations and population served. DATA USAGE: Input Files: Table: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - CPRSC File Layout Reference - ANRSC Record Name - Selection Card Table Name - State Table Table I.D. - STATAB REPORT OUTPUT: ANRP020R1 - Compliance Profile Showing Number of Public Water Systems ANRP020R2 - Compliance Profile Showing Population Served TOTALING LEVELS: Not applicable GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. If the re- ports are to be printed for only one region, then only that portion of the data set need be accessed. -407- index systems inc ------- The violation accumulators to be accessed for these reports are the year-to-date figures, data elements 062, 063 and 064, and the total figures, data elements 065, 066 and 067. These six accumulators occur six times on each PWS Inventory record, representing the six contaminant categories. Each report is contained on only one page. Accumulators are used to "build" the entire report in core. It is then printed at the end of the program. - 4 o 8 - index systems inc ------- 6. LOGIC CHART; (Numbers reference PROCESSING STEPS, Section 7) ( START J INITIALIZATION PROCESSING (1) fREAD SELEC-y TION CARD CPRSC (2) (3/READ PWS 7 J INVENTORY / i FILE 7END OF PIL: CALCULATE TOTALS AND PERCENTAGES (8) (9) !/ PRINT / \J REPORT I"* END OF RUN PROCESSING STOP YES (4 YES ACCUMULATE VIOLATIONS PROCESSING BEING KSELECTED ON REGION EING SELECTED ON STATE -409- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Zero out all accumulators and open files. Read in State Table. (2) The selection card indicates the specifications to be used in generating the report. Validate each field in the card according to the edit rules specified in the Data Element Descriptions. If the card is invalid, abort the run and print 'REPORT SELECTION INVALID1 on ANRP020R1. (3) Read either the individual region as specified on the input card, CPRSC, or read sequentially through the entire data set. (4) Region selection is determined by input card, CPRSC. (5) State selection is determined by input card, CPRSC. (6) For both reports, check each inventory record to see whether or not it meets the specifications of the selection card, as follows: . Check TYPE-OF-PWS-SEL against PSW-TYPE. If A is specified, select all types. . Check REGION-SEL against REGION. If A is specified, select all regions. Check STATE-SEL against STATE. If A is specified, select all states. . Check SOURCE-TYPE-SEL against each SOURCE- CODE. The number of SOURCE-CODE fields to be checked is indicated in SOURCE-NUM. If any match is found, select the inventory re- cord for inclusion on the report. If A is specified, select all source types. CONTAM-CTG-SEL indicates which set of six accumulators on the inventory file should be used. If A is specified, add together corresponding accumulators for the six con- taminant categories. ACCUM-TYPE-SEL indicates whether the year- to-date or total-to-date accumulators should be used. VIO-TYPE-SEL specifies which of the three accumulators should be used. If A is speci- fied, add the contaminant, sampling and other accumulators together. ~ 41 ° ~ index systems inc ------- For each report, define a matrix of 152 accumulators representing the eight violation categories and the nineteen population categories. Analyze the POP-SERVED field in conjunction with VIOLATIONS ACCUMULATORS and determine which matrix accumulator should be incre- mented for each inventory record. For ANRP020R1, add 1 to the matrix accumu- lator selected. . For ANRP020R2, add POP-SERVED to the matrix accumulator selected. (7) Calculate the totals and percentages in the following manner: Sum the eight accumulators for each of the nineteen population categories to arrive at the right-most total column. Sum the nineteen accumulators for each of the eight violation categories to arrive at the bottom total row. Use the grand total figure (right-most column, bottom row) to calculate the percentages. Divide each of the 152 accumulators as well as the nineteen figures in the total column and the eight figures in the total row by the grand total figure. Each result will be a percentage (multiply by 100 before printing). (8) For ANRP020R2, divide all population figures by 1000 before printing. Print the report requested as shown on the report layouts. On line 3, under the heading print one of the following descriptions corresponding to TYPE-OF-PWS-SEL on the input card: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS -411- index systems inc ------- On line 5, print REGION-SEL for region. If REGION-SEL equals A, leave blank. Print the state name corresponding to STATE-SEL by using the table STATAB. If STATE-SEL equals A, leave blank. On line 6, print whichever of the following descriptions corresponding to CONTAM-CTG-SEL: PHYSICAL INORGANIC CHEMICALS PESTICIDES AND ORGANIC CHEMICALS MICROBIOLOGICAL RADIOACTIVE TREATMENT ALL (if A is specified) Line 7 should contain whichever of the fol- lowing corresponds to VIO-TYPE-SEL: CONTAMINANT SAMPLING OTHER ALL (if A is specified) On line 8 print whichever of the following corresponds to SOURCE-TYPE-SEL: SURFACE GROUND PURCHASED ALL (if A is specified) On line 9 print YEAR-TO-DATE or TOTAL-TO-DATE according to ACCUM-TYPE-SEL. (9) Close files and end the job. -412- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM; SUBSYSTEM: DESCRIPTION: ANRP031 - Generate PWS Inventory Reports by Ownership ANNUAL REPORTING This program generates two reports which analyze the PWS Inventory records according to type of ownership. PWS IF PWS INVENTORY FILE PIRSC REPORT SELECTION CARD ANRP031 GENERATE PWS OWNERSHIP REPORTS ANRP030R1 NO. OF FAC. & POP. SERVED BY OWNERSHIP ANRP030R2 PERCENTAGE FAC. & POP. SERVED BY OWNERSHi: -413- ------- INTRODUCTION; Function; This program produces two reports. Reports; ANRP030R1 - Number of Facilities and Population Served by Type of Ownership - shows the number of facilities and population served for each type of PWS ownership summarized by population cate- gory and state. ANRP030R2 - Percentage of Facilities and Popula- tion Served by Type of Ownership - shows the per- centage of facilities and percentage of population served for each type of ownership summarized by population category and state. DATA USAGE: Input Files; File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table: Table Name - State Table Table I.D. - STATAB REPORT OUTPUT; ANRP030R1 - Number of Facilities and Population Served by Type of Ownership ANRP030R2 - Percentage of Facilities and Population Served by Type of Ownership TOTALING LEVELS: Entire report (total of all states) -414- index systems inc ------- 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the reports are to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included. -415- index systems inc ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) ( START ) I INITIALIZATION PROCESSING READ AND VALIDATE 'SELECTION CARD U) (2) G> (3) READ PWS INVENTORY (4) (END N OF " (FILE CALCULATE TOTALS & PERCENTAGES (5) (6) PRINT7 END OF JOB PROCESSING J ACCUMULATE TOTALS -416- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all accumulators to zero and open files. Read in State Table. (2) Check PWS-TYPE-SEL for a C, N or A. If other than one of these values, abort the run and print 'INVALID SELECTION CARD1 on ANRP030R1. (3) Define a matrix of accumulators having ten accumulators for each of the nineteen population categories and ten for each of the fifty-six states and territories. Analyze PWS-OWNER-TYPE and POP-SERVED on each PWS Inventory record and add to the appropriate facility and population accumulators based on POP-SERVED . (if POP-SERVED is blank, add to the 'UNKNOWN1 accumulators). In a similar manner add to the appropriate facility and population accumulators based on the STATE field. (4) Calculate the total line by adding up the fifty-six state and territory accumulators. Calculate all the percentage fields for ANRP030R2 in the following manner: For each line, add up the five facility accum- ulators for ANRP030R1 and the five population accumulators. Find each percentage by dividing each individ- ual accumulator by the corresponding line total (facility or population). (5) On ANRP030R1 divide each population figure by 1000 before printing. For each report, centered under the heading, print one of the following descriptions: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS corresponding to PWS-TYPE-SEL on the report selection card. (6) Close files and end job. -417- index systems "me ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: ANRP032 - Generate PWS Inventory Reports by Type of Water Source ANNUAL REPORTING This program generates two reports which analyze the PWS Inventory records according to type of water source. PWS IF PIRSC REPORT SELECTION CARD PWS INVENTORY FILE ANRPQ32 GENERATE PWS SOURCE TYPE REPORTS ANRPQ30R3 NO. OF FAC. & POP. SERVED BY TYPE OF SOURi ANRP030R4 PERCENTAGE FAC, & POP. SERVED BY TYPE OF SOURCE -418- index systems inc ------- INTRODUCTION; Function; This program produces two reports. Reports; ANRP030R3 - Number of Facilities and Population Served by Type of Water Supply Source - shows the number of facilities and population served for each type of water supply source summarized by population category and state. ANRP030R4 - Percentage of Facilities and Popu- lation Served by Type of Water Supply Source - shows the percentage of facilities and percen- tage of population served for each type Of water supply source summarized by population category and state. DATA USAGE: Input Files: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.P. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table: Table Name - State Table Table I.D. - STATAB REPORT OUTPUT ANRP030R3 - Number of Facilities and Population Served by Type of Water Supply Source ANRP030R4 - Percentage of Facilities and Population Served by Type of Water Supply Source TOTALING LEVELS; Entire report (total of all states) -419- index systems inc ------- 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the reports are to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included, -420- index systems inc ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) I START INITIALIZATION PROCESSING i f 1) READ AND VALIDATE 'SELECTION CARD (2) (4) READ PWS /END A-VTtT-> INVENTORY / OF /FI (FILE (3) I CALCULATE TOTALS & PERCENTAGES (5) (6! PRINT7 END OF JOB PROCESSING STOP ACCUMULATE TOTALS -421- ------- 7. PROCESSING STEPS: (Numbers reference LOGIC CHART, Section 6) (1) Initialize all accumulators to zero and open files. Read in State Table. (2) Check PWS-TYPE-SEL for a C, N or A. If other than one of these values, abort the run and print 'INVALID SELECTION CARD' on ANRP030R3. (3) Define a matrix of accumulators having eight accumula- tors for each of the nineteen population categories and eight for each of the fifty-six states and terri- tories. Check the SOURCE-CODE field for each source on the PWS inventory record (use SOURCES-NUM to indicate the number of sources to be checked). If all are S, categorize as surface. If all are G, categorize as ground. If any is P, categorize as purchased. If some are S and some are G, categorize as surface and ground. Based on this analysis, add to the appropriate facility and population accumulators based on POP-SERVED (if blank add to UNKNOWN). In a similar manner add to the appro- priate facility and population accumulators based on the STATE field. (4) Calculate the total line by adding up the fifty-six state and territory accumulators. Calculate all the percentage fields for ANRP030R4 in the following manner: For each line, add up the five facility accumulators for ANRP030R3 and the five population accumulators. (These will be printed in the TOTAL columns.) Find each percentage by dividing each in- dividual accumulator by the corresponding line total (facility or population). (5) On ANRP030R3 divide each population figure by 1000 before printing. For each report, centered under the heading, print one of the following descriptions: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS Corresponding to PWS-TYPE-SEL on the report selection card, (6) Close files and end job. -422- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: ANRP033 - Generate PWS Inventory Reports by Treatment ANNUAL REPORTING This program generates five reports which analyze the PWS Inventory records according to whether or not the water source is treated. PWS IF PWS INVENTORY FILE PIRSC REPORT SELECTION CARD ANRP033 GENERATE PWS TREATMENT REPORTS M&P030R5 OF FAC 'OPo SERVED PERCENTAGE OF FAC. & POP. SERVED BY TREATMENT NUM. FACo & POP. BY TREAT- MENT GROUND SUPPLIES ANRP030R9 NUM. FAC. & BY TREATMENT SURFACE 6 GROUND UPPLIE ANRP030R7 NUM. FAC. & POP. BY TREAT- MENT SURFACE SUPPLIES -423- index systems me ------- INTRODUCTION; Function; This program produces five reports. Reports; ANRP030R5 - Number of Facilities and Population Served by Treatment - shows the number of facil- ities and population served by treated and un- treated water summarized by population category and state. ANRP030R6 - Percentage of Facilities and Popula- tion Served by Treatment - shows the percentage of facilities and percentage of population served by treated and untreated water summarized by population category and state. ANRP030R7 - Number of Facilities and Population Served by Treatment for Surface Only Supplies - same as ANRP030R5 but for surface supplies only. ANRP030R8 - Number of Facilities and Population Served by Treatment for Ground Only Supplies - same as ANRP030R5 but for ground supplies only. ANRP030R9 - Number of Facilities and Population Served by Treatment for Surface and Ground Supplies same as ANRP030R5 for surface and ground supplies. DATA USAGE: Input Files; Table: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table Name - State Table Table I.D. - STATAB -424- index systems inc ------- REPORT OUTPUT; ANRP030R5 - ANRP030R6 - ANRP030R7 - ANRP030R8 - ANRP030R9 - Number of Facilities and Population Served by Treatment Percentage of Facilities and Population Served by Treatment Number of Facilities and Population Served by Treatment for Surface Only Supplies Number of Facilities and Population Served by Treatment for Ground Only Supplies Number of Facilities and Population Served by Treatment for Surface and Ground Supplies TOTALING LEVELS: Entire report (total of all states). GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the reports are to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included. -425- index systems inc ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) C START INITIALIZATION PROCESSING G> (3) (1) READ AND VALIDATE 'SELECTION CARD (2) (4) READ PWS INVENTORY (END ""op""' (FILE CALCULATE TOTALS & PERCENTAGES (5) (6) / PRINT / END OF JOB REPORTS P" PROCESSING •*f STOP J ACCUMULATE TOTALS JJL 0 -426- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART,Section 6) (1) Initialize all accumulators to zero and open files. (2) Check PWS-TYPE-SEL for a C, N or A. If other than one of these values, abort the run and print 'INVALID SELECTION CARD1 on ANRP030R5. (3) For each report ANRP030R5, ANRP030R7, ANRP030R8, and ANRP030R9, define a matrix of accumulators having eight accumulators for each of the nineteen population categories and eight for each of the fifty-six states and territories. On each PWS Inventory record check each water source for as many as are indicated by SOURCES-NUM, as follows: If all sources have at least one TREATMENT indicated, add to the appropriate accumulators for 'TREATED ONLY' for ANRP030R5. If all sources have no TREATMENT indicators, add to the appropriate accumulators for 'UNTREATED ONLY1 for ANRP030R5. If only some sources have TREATMENT indicators and some do not, add to the appropriate accum- ulators for 'BOTH1 for ANRP030R5. Use POP-SERVED and STATE to determine the ap- propriate accumulators. In a similar manner, add to the accumulators for ANRP030R7 if all SOURCE-CODE indicators are 'S'. Add similarly to the ANRP030R8 accumulators if all SOURCE-CODE indicators are 'G'. Add similarly to the ANRP030R9 accumulators if some SOURCE-CODE indicators are 'S1 and some are 'G1. (4) Calculate the two total columns on each report by adding up the three facility columns and the three population columns. Calculate the total line for each report by adding up the fifty-six state and territory accumulators. Calculate all the percentage fields for ANRP030R6 by dividing each individual accumulator for report ANRP030R5 by the corresponding facility or population line total. - 4 2 7 - index systems inc ------- (5) On ANRP030R5, ANRP030R7, ANRP030R8 and ANRP030R9 divide each population figure by 1000 before printing. For each report, centered under the heading, print one of the following COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS corresponding to PWS-TYPE-SEL on the report selection card. (6) Close files and end job. ~428 index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SYBSYSTEM: DESCRIPTION: ANRP034 - Generate PWS Inventory Report by Lab Control ANNUAL REPORTING This program generates a report which analyzes the PWS Inventory records according to laboratory control PWS IF PIRSC REPORT SELECTION CARD PWS INVENTORY FILE ANRPQ34 GENERATE PWS LAB CONTROL REPORT ANRP030R10 NUM. FAC. AND POP. SERVED BY TYPE OF LAB CONTROL -429- index systems inc ------- 1. INTRODUCTION; Function; This program produces two reports. Reports; ANRP030R10 - Number of Facilities and Population Served by Type of Lab Control - shows the number of facilities and population served by plants having each of four types of lab control. 2. DATA USAGE: Input Files; Table: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table Name - State Table Table I.D. - STATAB 3. REPORT OUTPUT: 4. ANRP030R10 - Number of Facilities and Population Served by Type of Lab Control TOTALING LEVELS: Entire report (total of all states). 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the report is to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be in- cluded. -430- index systems inc ------- 6. LPGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) I START INITIALIZATION PROCESSING 1) READ AND VALIDATE 'SELECTION CARD (2) (4) ;READ PWS / /END [NVENTORY / ~oT^ /FILE (3) / CALCULATE TOTALS (5) (6) PRINT REPORT END OF JOB PROCESSING •if STOP J ACCUMULATE TOTALS -431- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all accumulators to zero and open files. Read in State Table. (2) Check PWS-TYPE-SEL for a C, N or A. If other than one of these values, abort the run and print 'INVALID SELECTION CARD1 on ANRP030R10. (3) Define a matrix having eight accumulators for each of the nineteen population categories and eight for each of the fifty-six states and territories. Analyze POP-SERVED and LAB-CONTROL on each PWS Inventory record and add to the appropriate facility and population. Accumulators based on POP-SERVED (if POP-SERVED is blank, add to the 'UNKNOWN' accumulators). In a sim- ilar manner add to the appropriate facility and popu- lation accumulators based on the STATE field. (4) Calculate the total line by adding up the fifty-six state and territory accumulators in each of the eight columns. (5) Divide each population figure by 1000 before printing. For each report, centered under the heading, print one of the following descriptions: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS corresponding to PWS-TYPE-SEL on the report selection card, (5) Close files and end job. - 4 3 2 - index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: ANRP035 - Generate PWS Inventory Reports by Treatment Process ANNUAL REPORTING This program generates six reports which analyze the PWS Inventory records according to type of treatment process. PIkSC REPORT SELECTION CARD PWS IF PWS INVENTORY FILE ANRP035 GENERATE PWS TREATMENT PROCESS REPORTS ANRP030R11B ANRP030R11A ANRP030R11 NUM. FAC. & POP SERVED BY TREAT MENT PROCESS ANRP030R12B ANRP030R12 PERCENTAGE OF FAC. & POP. SERVED BY KENT ROCESj -433- index systems inc ------- INTRODUCTION; Function; This program produces six reports. Reports; ANRP030R11, RllA, RllB - Number of Facilities and Population Served by Treatment Process - shows the number of facilities and population served by each treatment process summarized by popula- tion category and state. ANRP030R12, R12A, R12B - Percentage of Facilities and Population Served by Treatment Process - shows the percentage of facilities and percentage of population served by each treatment process sum- marized by population category and state. DATA USAGE: Input Files; Tabile: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table Name - State Table Table I.D. - STATAB REPORT OUTPUT: ANRP030R11, RllA, RllB - ANRP030R12, R12A, R12B - Number of Facilities and Popu- lation Served by Treatment Process Percentage of Facilities and Population Served by Treatment Process TOTALING LEVELS: Entire report (total of all states). -434- index systems inc ------- 5. GENERAL PROCESSING NOTES; The PWS Inventory File ir organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the report is to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included. -435- , index systems Sroe ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) ( START ) INITIALIZATION PROCESSING G> (3) 1) READ AND VALIDATE 'SELECTION CARD (2) ]READ PWS [NVENTORY CALCULATE TOTALS & PERCENTAGES (5) (6) / PRINT ""71 END OF JOB REPORTS fa PROCESSING ->f STOP J ACCUMULATE TOTALS jv 0 -436- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6 ) (1) Initialize all accumulators to zero and open files. (2) Check PWS-TYPE-SEL for a C, N or A. If other than one of these values, abort the run and print 'INVALID SELECTION CARD1 on ANRP030R11. (3) Define a matrix of accumulators having 28 accumulators (2 for each treatment process and 2 for totals) for each of the nineteen population categories and 28 for each of the fifty-six states and territories. Analyze POP-SERVED and STATE on each PWS Inventory record to determine which accumulators to increment for each record. If POP-SERVED is blank, add to the 'UNKNOWN1 accumulators. On each Inventory record, check each water source for as many as are indicated by SOURCES-NUM, as follows: Check each TREATMENT code and add to the corres- ponding accumulators if the treatment code is on. The purification indication is defined as having the following TREATMENT indicators all on: disinfection, coagulation, sedimentation and filtration, OR disinfection, coagulation, and filtration. Each record may be added to multiple accumulators. Add each PWS Inventory record to the line total accumu- lators based on POP-SERVED and STATE. (4) Calculate the total line by adding up the fifty-six state and territory accumulators. Calculate all the percentage fields for ANRP030R12, R12A and R12B by dividing each individual accumulator by the corresponding line total accumulator (facility or popu- lation) . (5) On ANRP030R11, RllA, and RllB divide each population figure by 1000 before printing. For each report, centered under the heading, print one of the following descriptions: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS corresponding to PWS-TYPE-SEL on the report selection card. (6) Close files and end job. _437_ index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION ANRP036 - Generate PWS Inventory Reports Analyzing Services ANNUAL REPORTING This program generates two reports which analyze the PWS Inventory records according to population, services and meters. PWS IF PIRSC SELECTION CARD PWS INVENTORY FILE GENERATE PWS INVENTORY SERVICES AND METERS REPORTS ANRP030R13 AVERAGE NUMBER PERSONS PER SERVICE ANRP030R14 PERCENTAGE OF SERVICES METERED -438- mdex systems me ------- INTRODUCTION; Function: This program produces two reports. Reports; ANRP030R13 - Average Number of Persons Per Service - shows the number of persons per service according to population categories and overall per state. ANRP030R14 - Percentage of Services Metered - shows the percentage of services metered according to pop- ulation categories and overall per state. DATA USAGE: Input Files: Table: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table Name - State Table Table I.D. - STATAB REPORT OUTPUT; ANRP030R13 - Average Number of Persons Per Service ANRP030R14 - Percentage of Services Metered TOTALING LEVELS; Entire report (total of all states). GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program, the entire data set is read sequentially. The report selection card indicates whether the report is to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included. -439- index systems inc ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all accumulators to zero and open files. Read in State Table. (2) Check PWS-TYPE-SEL for a C, N or A. If other than one of these values, abort the run and print 'INVALID SELECTION CARD' on ANRP030R13. (3) Define a matrix of accumulators for each of the three fields POP-SERVED, SERVICES-NUM and METERS-NUM. Each matrix must have thirteen accumulators (for the popula- tion categories) for each of the fifty-six states and territories. Analyze STATE and POP-SERVED on each PWS Inventory record and add to the appropriate accumulators. If any of the three fields POP-SERVED, SERVICES-NUM or METPERS-NUM is blank, skip the record. (4) Calculate the total line by first adding up the fifty- six state and territory accumulators. Calculate the fields on ANRP030R13 by dividing each POP-SERVED accum- ulator by the corresponding SERVICES-NUM accumulator. Calculate the fields on ANRP030R14 by dividing each METERS-NUM accumulator by the corresponding SERVICES-NUM accumulator. Calculate the state average columns by adding the line accumulators across and then dividing. (5) For each report, centered under the heading, print one of the following descriptions: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS corresponding to PWS-TYPE-SEL on the report selection card. (6) Close files and end job. -440- index systems ine ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) ( START J INITIALIZATION PROCESSING 1) READ AND VALIDATE 'SELECTION CARD (2) (4) READ PWS ]/END [NVENTORY fOP" /FILE (3) CALCULATE TOTALS & PERCENTAGES (5) (6) ACCUMULATE TOTALS / PRINT7 END OF JOB REPORTS I* PROCESSING •^f STOP J -441- ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: ANRP037 - Generate PWS Inventory Reports of Capacity and Production ANNUAL REPORTING This program generates two reports which analyze the PWS Inventory records according to production and capacity. PWS IF PWS INVENTORY FILE PIRSC ^REPORT SELECTION CARD ANRP037 GENERATE PWS INVENTORY CAP- ACITY & PRO- DUCTION REPORTS PERCENTAGE OF DIST. STOR. AS MAX. DAILY PRODUCTION PERCENTAGE OF CAPACITY AS MAX DAILY PRODUCTION -442- index systems inc ------- INTRODUCTION; Function; This program produces two reports. Reports; ANRP030R15 - Percentage of Distribution Storage as Maximum Daily Production - shows this percentage by population group and overall for each state. ANRP030R16 - Percent of Capacity as Maximum Daily Production - shows the number of systems falling within various percentages by population group and overall for each state. DATA USAGE: Input Files; Table: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table Name - State Table Table I.D. - STATAB 3. REPORT OUTPUT: 4. ANRP030R15 - Percentage of Distribution Storage as Maximum Daily Production ANRP030R16 - Percent of Capacity as Maximum Daily Production TOTALING LEVELS: Entire report (total of all states). 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must -443- index systems inc ------- therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the report is to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included. -444- index systems inc ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) ( START J INITIALIZATION PROCESSING G> (3) 1) READ AND VALIDATE 'SELECTION CARD (2) (4) READ PWS INVENTORY CALCULATE TOTALS & PERCENTAGES (5) 7 END OF JOB REPORTS A PROCESSING •*f STOP j ACCUMULATE TOTALS yr 0 -445- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Initialize all accumulators to zero and open files. Read in State Table. (2) Check PWS-TYPE-SEL for a C, N or A. If other than one of these values, abort the run and print 'INVALID SELECTION CARD1 on ANRP030R15. (3) For ANRP030R15, define a matrix of thirteen accumulators for each state for MAX-PRODUCTION and STORAGE-CAPACITY. For each PWS Inventory record add to these accumulators based on STATE and POP-SERVED. If POP-SERVED, MAX- PRODUCTION or STORAGE-CAPACITY is blank, skip the record. For ANRP030R16, define a matrix of thirteen accumulators for each of the percentage categories shown on the report for each state. For each PWS Inventory record, divide MAX-PRODUCTION by NORMAL-CAPACITY and add 1 to the appro- priate accumulator based on the result and the STATE and POP-SERVED fields. If POP-SERVED, NORMAL-CAPACITY or MAX-PRODUCTION are blank, skip the record. (4) For ANRP030R15, calculate the total line by adding up the fifty-six state and territory accumulators. Calcu- late the state average by first adding across the accumu- lators for each row. Then calculate each percentage figure (detail or total) by dividing each MAX-PRODUCTION accumulator by the corresponding STORAGE-CAPACITY accumu- lator. For ANRP030R16, calculate the state total section each row across. Then calculate the report totals by adding up all the corresponding accumulators for the fifty-six states and territories (5) For each report, centered under the heading, print one of the following descriptions: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS corresponding to PWS-TYPE-SEL on the report selection card. (6) Close files and end job. -446- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: ANRP038 - Generate PWS Inventory Report of Per Capita Water Use ANNUAL REPORTING This program generates one report which analyzes the PWS Inventory records according to maximum per capita daily water use. PIRSC REPORT SELECTION CARD PWS IF PWS INVENTORY FILE ANRP038 GENERATE PWS INVENTOYR PER CAPITA WATER USE ANRP030R17 MAX. PER CAPITA DAILY WATER USE -447- index systems isie ------- 1. INTRODUCTION; Function; This program produces one report. Reports; ANRP030R17 - Maximum Per Capita Daily Water Use - shows the population and maximum per capita water use by state. 2. DATA USAGE; Input Files; File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table: Table Name - State Table Table I.D. - STATAB 3. REPORT OUTPUT; ANRP030R17 - Maximum Per Capita Daily Water Use 4. TOTALING LEVELS; Entire report (total of all states). 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the report is to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included. -448- ------- INTRODUCTION; Function; This program produces one report. Reports; ANRP030R17 - Maximum Per Capita Daily Water Use - shows the population and maximum per capita water use by state. DATA USAGE: Input Files: Table: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table Name - State Table Table I.D. - STATAB REPORT OUTPUT: ANRP030R17 - Maximum Per Capita Daily Water Use TOTALING LEVELS: Entire report (total of all states). GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the report is to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included. -448- index systems inc ------- INTRODUCTION; Function; This program produces one report. Reports; ANRP030R17 - Maximum Per Capita Daily Water Use - shows the population and maximum per capita water use by state. DATA USAGE: Input Files: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - PIRSC File Layout Reference - ANRSC Record Name - Selection Card Table: REPORT OUTPUT: Table Name - State Table Table I.D. - STATAB ANRP030R17 - Maximum Per Capita Daily Water Use TOTALING LEVELS: Entire report (total of all states). GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. For this program the entire data set is read sequentially. The report selection card indicates whether the report is to be printed for community, non-community or all PWS's. Check PWS-TYPE in each record to see if it should be included. -448- index systems inc ------- 6. LpGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) C START INITIALIZATION PROCESSING , , 1) (3) READ AND VALIDATE 'SELECTION CARD (2) JREAD PWS [NVENTORY CALCULATE TOTALS (5) (6) PRINT REPORT END OF JOB PROCESSING STOP ACCUMULATE TOTALS JSL. © -449- ------- 7. PROCESSING STEPS; (Numbers -eference LOGIC CHART, Section 6) (1) Initialize all accumulators to zero and open files. Read in State Table. (2) Check PWS-TYPE-SEL for a C, N or A. If other than one of these values, abort the run and print 'INVALID SELECTION CARD' on ANRP030R17. (3) Define an array of accumulators for MAX-PRODUCTION and POP-SERVED for each of the fifty-six states and terri- tories. Analyze each PWS Inventory record according to STATE and add to the appropriate accumulators. If either MAX-PRODUCTION or POP-SERVED is blank, skip the record. (4) Calculate the total line by adding up the fifty-six state and territory accumulators. (5) For each report, centered under the heading, print one of the following descriptions: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS corresponding to PWS-TYPE-SEL on the report selection card. (6) Close files and end job. - 4 5 0 - index systems ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: ANRP040 - Generate Enforcement Action Summary ANNUAL REPORTING This program generates two enforcement action summary reports, each reflecting enforcement actions taken for community, non-community or all public water systems. PWSIF ENACF PWS INVENTORY FILE EARSC REPORT SELECTION CARD ENFORCEMEN ACTIONS FILE ANRPQ40 GENERATE EN- FORCEMENT AC- TION SUMMARY ANRP040R1 ENFORCEMENT AC- TION SUMMARY POPULATION ANRP040R2 ENFORCEMENT AC- SUMMARY BY TYPE AND SOURCE -451- index systems inc ------- 1. INTRODUCTION; Function; This program creates two summary level reports. Reports; ANRP040R1 - Enforcement Action Summary by Population - lists the number of enforce- ment actions undertaken by population grouping, action type and state. ANRP040R2 - Enforcement Action Summary by Type and Source - lists the number of enforcement actions taken for each state categorized by type of water source and type of action. 2. DATA USAGE: Input Files; Table: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Enforcement Action File I.D. - ENACF File Layout Reference - ENACF Record Name - Enforcement File Name - Report Selection Card File I.D. - EARSC File Layout Reference - ANRSC Record Name - Selection Card Table Name - State Table Table I.D. - STATAB 3. REPORT OUTPUT; ANRP040R1 • ANRP040R2 • Enforcement Action Summary by Population Enforcement Action Summary by Type and Source 4. TOTALING LEVELS; Accumulate totals by state, EPA region and for the entire nation as indicated on the report layouts. -452- index systems inc ------- 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. -453- index systems ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) ( START ) INITIALIZATION PROCESSING ACCUMULATE PWS TOTALS PROCESSING (1) :READ SELECTION CARD EARSC (2) READ PWS ' INVENTORY FILE PWS IF READ EN- ORCEMENT FILE ENACF (4) & (5) (6) FILE END OF STATE & END OF RE- GION PROCESSING \ END OF JOB PROCESSING STOP (4) ES >-* END OF STATE PROCESSING (5) END OF REGION PROCESSING -€> END OF STATE PROCESSING YES (3) NEW PWS -MATCH INVENTORY PWS I READ PWS INVENTORY FILE -454- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Zero all accumulators and open files. Read in State Table. (2) The selection card indicates which report is to be printed and whether community, non-community or all PWS's are to be included. The community/non-community designation is PWS-TYPE, data element 020. On the second line of the report heading print one of the following descriptions to indicate what was present on the selection card: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS (3) To be valid, the input card must indicate report ANRP040R1 or ANRP040R2 and selection criterion C, N or A. If the card is invalid, abort the run and print 'REPORT SELECTION INVALID1 on ANRP040R1. For each enforcement action record, analyze the MILESTONES array. NUM-MILESTONES indicates how many milestones are present. Each one represents one en- forcement action with the MILESTONE-CODE indicating the type of action. Therefore each record may be added to several accumulators depending on the num- ber of milestones. For ANRP040R1: Define an array of 77 accumulators for the eleven population groups (not including TOTAL) and the seven action types. Add to the accumulators as indicated by the MILESTONE-CODE fields on the Enforcement Action File and the POP-SERVED field on the PWS Inventory file. For ANRP040R2: Define an array of eleven accumulators rep- resenting the seven action types, the three water source types and one total accumulator representing the total of the seven action type accumulators. -455- index systems inc ------- Add to the action type accumulators based on the MILESTONE-CODE fields on the Enforce- ment Action File. For each Enforcement Action record, add to the type of source accumulators based on SOURCE-CODE, data element 071 on the PWS Inventory File. Check as many SOURCE-CODE fields as are indicated in SOURCES-NUM If any are surface, consider the water supply surface only. Otherwise add to whatever accumulators apply based on SOURCE-CODE (thus each en- forcement action may be added to both the ground and purchased accumulators). (4) For ANRP040R1: Print a line for each action type which has any non-zero accumulators. Also print the one-line state total as shown on the layout. For ANRP040R2: Print one line for each state as shown. Print the state name on the first line printed for each state. Use STATAB table to retrieve the name. If the state code is blank on one or more records, print the state name as 'INDIAN RESERVATION1. Add the state accumulators to region accumulators and zero out the state accumulators. (5) Print the region total line as shown on the report layouts. Add the region accumulators to grand total accumulators and zero out the region accumulators. Skip to a new page on the report (unless at end of file). (6) Print the grand totals as indicated as NATIONAL TOTALS on the report layouts. Close all files and end job. -456- index systems inc ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATIONS PROGRAM: SUBSYSTEM: DESCRIPTION: ANRP050 - Generate Violation Summary ANNUAL REPORTING This program generates two violation summary re- ports, each reflecting violation occurrances for community, non-community or all public water systems, PWSIF VIKSC REPORT SELECTION CARD PWS INVENTORY FILE ANRP050 GENERATE VIOLATION SUMMARY VIOLATION SUMMARY BY POPULATION VIOLATION SUM- MARY BY TYPE AND SOURCE -457- index systems inc ------- 1. INTRODUCTION; Function; This program creates two summary level reports. Reports; ANRP050R1 - Violation Summary by Population - lists the number of violations occurring by population group for each contaminant category and state. ANRP050R2 - Violation Summary by Type and Source lists the number of violations occurring by type of violation and type of source for each contam- inant category and state 2. DATA USAGE; Input Files: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record Name - Inventory File Name - Report Selection Card File I.D. - VIRSC File Layout Reference - ANRSC Record Name - Selection Card Table: Table Name - State Table Table I.D. - STATAB 3. REPORT OUTPUT: ANRP050R1 - Violation Summary by Population ANRP050R2 - Violation Summary by Type and Source 4. TOTALING LEVELS; Accumulate totals by state, EPA region and for the entire nation as indicated on the report layouts. 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. -458- index systems snc ------- The violation accumulators to be printed are those for the year-to-date figures, data elements 062, 063 and 064. These three occur six times on each PWS Inventory record, representing the six contaminant categories which should be printed with the following descriptions: PHYSICAL INORGANIC CHEMICALS PEST & ORGANIC CHEMS MICROBIOLOGICAL RADIOACTIVE TREATMENT For each report, accumulate all records for an entire state before printing anything. -459- ------- 6. LOGIC CHART: (Numbers reference PROCESSING STEPS, Section 7) START (1) INITIALIZE PROCESSING READ SEL- 'ECTION CARD/ VIRSC ,(2) fREAD PWS / INVENTORY / A—> PWSIF / END / OF / FILE ACCUMULATE VIOLATIONS PROCESSING (4) & (5) END OF STATE PROCESSING (6) END OF STATE & END OF REGION PRO- CESSING END OF RUN PROCESSING STOP (5) END OF STATE PROCESSING END OF REGION PROCESSING -© -€> -460- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Zero all accumulators and open files. Read in State Table. (2) The selection card indicates which report is to be printed and whether community, non-community or all PWS's are to be included. The community/non-community designation is PWS-TYPE, data element 020. Print the state name on the first line printed for each state. Use STATAB table to retrieve the name. If the state code is blank on one or more records, print the state name as 'INDIAN RESERVATION'. (3) For ANRP050R1: Define an array of 66 accumulators for the eleven population groups (not including TOTAL) and the six contaminant categories For each PWS Inventory record, add to the population accumulators based on POP-SERVED, data element 035 All three year to date accumulators should be added together for each contaminant group For ANRP050R2: Define an array of 36 accumulators for the three violation types, the three water source types and the six contaminant cate- gories For each PWS Inventory record, add to the violation type accumulators from the record accumulators (the MCL accumulator is VIO-CONTAM-YTD) For each PWS Inventory record, add to the type of source accumulators based on SOURCE- CODE, data element 071 Check as many SOURCE-CODE fields as are indicated in SOURCES-NUM If any are surface, consider the water supply surface only. Otherwise add to whatever accumulators apply based on SOURCE-CODE (thus the accumulators may be added to both the ground and purchased accumulators) index systems inc -461- ' ------- (4) Print a line for each contaminant category which has any non-zero accumulators. For ANRP050R1, the TOTAL field is the totals of the eleven population categories. For ANRP050R2, the TOTAL field is the total of the three types of violation categories. Also print the one line state total as shown on the report layouts. Add the state accumulators to region accumulators and zero out the state accumu- lators. On the second line of the report heading print one of the following descriptions to indicate what was present on the selection card: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS To be valid, the input card must indicate report ANRP050R1 or ANRP050R2 and selection criterion C, N or A. If the card is invalid, abort the run and print 'REPORT SELECTION CARD INVALID1 on ANRP050R1. (5) Print the region total line as shown on the report layouts. Add the region accumulators to grand total accumulators and zero out the region accumulators. Skip to a new page on the report (unless at end of file). (6) Print the grand totals as indicated as NATIONAL TOTALS on the report layouts. Close all files and end job. -462- index systems see ------- EPA WATER SUPPLY DATA SYSTEM PROGRAM SPECIFICATION PROGRAM: SUBSYSTEM: DESCRIPTION: ANRP060 - Generate Variance and Exemption Summary ANNUAL REPORTING This program generates two variance and exemption summary reports each reflecting variances"and ex- emptions granted to community, non-community or all public water systems. PWSIF VERSC REPORT SELECTION CARD VAEXF PWS INVENTORY FILE VARIANCE & EXEMPTION FILE ANRP060 GENERATE VARI- ANCE & EXEMP- TION SUMMARY ANRP060R1 VARIANCE & EX- EMPTION SUMMARY BY POPULATIO ANRP060R2 VARIANCE & EX- EMPTION SUM- MARY BY SOURCE TYPE -463- index systems ienc ------- INTRODUCTION; Function: This program creates two summary level reports. Reports: ANRP060R1 - Variance and Exemption Summary by Population - lists the number of variances and exemptions by population grouping, contami- nant or treatment type and state ANRP060R2 - Variance and Exemption Summary by Source Type - lists the number of variances and exemptions for each state categorized by type of water source and contaminant or treatment type, DATA USAGE: Input Files; Tables: File Name - PWS Inventory File File I.D. - PWSIF File Layout Reference - PWSIF Record name - Inventory File Name - Variance and Exemption File File I.D. - VAEXF File Layout Reference - VAEXF Record Name - Variance/Exemption File Name - Report Selection Card File I.D. - VERSC File Layout Reference - ANRSC Record Name - Selection Card Table Name Table I.D. Table Name Table I.D. Table Name Table I.D. State Table STATAB Contaminant Table CONTAB Treatment Table TRETAB 3. REPORT OUTPUT; ANRP060R1 - Variance and Exemption Summary by Population ANRP060R2 - Variance and Exemption Summary by Source Type -464- jndex systems inc ------- 4. TOTALING LEVELS; Accumulate totals by state, EPA region and for the entire nation as indicated on the report layouts. 5. GENERAL PROCESSING NOTES; The PWS Inventory File is organized as a partitioned data set with one partition for each EPA region. Each region must therefore be accessed as a separate file. -465- index systems iroe ------- f START J INITIALIZATION PROCESSING U, I READ SELECTION CARD VERSC READ PWS INVENTORY PILE PWS IF (4) & (5) (6) /READ VARI- / 'ANCE & EX- L—± EMPTION /END vaSE / FILE END OP STATE & END OF RE- GION PROCESSING \ END OF JOB PROCESSING —rf STOP 1 (5) END OF STATE - »- ? END OF REGION PROCESSING END OF STATE PROCESSING -o YES NEW PWS MATCH INVENTORY MATCH ACCUMULATE PWS TOTALS PROCESSING READ PWS INVENTORY FILE -466- ------- 7. PROCESSING STEPS; (Numbers reference LOGIC CHART, Section 6) (1) Zero al_ accumulators and open files. Read in tables. (2) The selection card indicates which report is to be printed and whether community, non-community or all PWS's are to be included. The community/non-community designation is PWS-TYPE, data element 020. On the second line of the report heading print one of the following descriptions to indicate what was present on the selection card: COMMUNITY SYSTEMS NON-COMMUNITY SYSTEMS ALL PUBLIC WATER SYSTEMS To be valid, the input card must indicate report ANPR060R1 or ANRP060R2 and selection criteria C, N or A. If the card is invalid, abort the run and print 'REPORT SELECTION CARD INVALID1 on ANRP060R1. (3) Each Variance/Exemption record represents one variance or exemption. VE-TYPE indicates V for variance and E for exemption. Each record will have either a CONTAMINANT-ID, or, if this field is blank, the TREATMENT field will be filled. For ANRP060R1: Define two arrays of eleven accumulators each (one for variances and one for exemptions) for each unique CONTAMINANT-ID or TREATMENT which is found on the Variance and Exemption File. Add to the accumulators for each variance and exemption record read by checking the POP- SERVED field on the PWS Inventory File to determine the population category. For ANRP060R2: Define an array of eight accumulators for each unique CONTAMINANT-ID or TREATMENT which is found on the Variance and Exemption file. These represent the three water source types and the total for variances and for exemptions. -467- index systems ine ------- For each Variance and Exemption record, add to the type of source accumulators based on SOURCE-CODE, data element 071 on the PWS inventory File. Check as many SOURCE-CODE fields as are indicated in SOURCES-NUM. If any are surface, consider the water supply surface only. Otherwise add to whatever accumulators apply based on SOURCE-CODE (thus each variance or exemption may be added to both the ground and purchased accumulators). Add to the "total" accumulators only once for each variance or exemption based on VE-TYPE. Each total may there- fore be less than the arithmetical total of the three source categories. (4) For ANRP060R1: Print three lines for each contaminant or treatment which has any non-zero accumulators; one for variances, one for exemptions and one for the total. Use CONTAB and TRETAB to retrieve the descriptions to be printed in the contaminant/treatment field. Also print the one line state total as shown on the layout. For ANRP060R2: Print one line for each contaminant or treatment which has any non-zero accumulators. Use CONTAB and TRETAB to retrieve the des- criptions to be printed in the contaminant/ treatment field. Also print the one line state total as shown on the layout. iPrint the state name on the first line printed for each state. Use STATAB table to retrieve the name. If the state code is blank on one or more records, print the state name as 'INDIAN RESERVATION'. Add the state accumulators to region accumulators and zero out the state accumulators. index systems inc -468- y ------- (5) Print the region total line as shown on the report layouts. Add the region accumulators to grand total accumulators and zero out the region accumulators. Skip to a new page on the report (unless at end of file). (6) Print the grand totals as indicated as NATIONAL TOTALS on the report layouts. Close all files and end job. index systems iroe ------- |