set define off;
drop synonym BENZENE_AIR_MONITORING;
create or replace PROCEDURE BENZENE_AIR_MONITORING (p_addr_id   IN VARCHAR2 DEFAULT NULL) IS

-------------------------------------------------------------------------------------------------------------------
--AUTHOR:       A Deer
--DATE CREATED: OCTOBER 01, 2001.
--
--MODIFICATION HISTORY
--Person Date         Comments
--
-------------------------------------------------------------------------------------------------------------------

--variables
v_location     VARCHAR2(100);
v_sysdate      VARCHAr2(100);
r_cntr         NUMBER;

v_sample_date  varchar2(100);
v_sample_time  varchar2(100);

v_address      varchar2(150);

--cursors
CURSOR c_geo_area(c_addid    VARCHAR2) IS
       SELECT display_addr
         FROM nyr_Benzene_results
        WHERE display_addr_id = c_addid;

CURSOR c_pcb_levels(c_addid    VARCHAR2) IS
       SELECT end_date,
              detect_status,
              result,
              SIGN,
              units
         FROM nyr_Benzene_results
        WHERE display_addr_id = c_addid
          AND media = 'AIR'
          and analysis_code != 'EPA-TO-15'
          AND trim(TO_CHAR(end_date)) IS NOT NULL
        ORDER BY 1 desc;

CURSOR c_benz24_levels(c_add   VARCHAR2) IS
       SELECT end_date,
              detect_status,
              result,
              SIGN,
              units
         FROM nyr_Benzene_results
        WHERE upper(display_addr) = upper(c_add)
          AND media = 'AIR'
          and analysis_code = 'EPA-TO-15'
          AND trim(TO_CHAR(end_date)) IS NOT NULL
        ORDER BY 1 desc;

v_Benzene_rec    c_pcb_levels%ROWTYPE;

BEGIN
--htp.p('<BASE HREF="http://www.epa.gov/air/wtc/">');
htp.p('<html>
<head>
<!-- #BeginEditable "doctitle" -->
<title>Benzene in Air</title>
<!-- #EndEditable -->
<link rel="stylesheet" href="http://www.epa.gov/epahome/epa_styles.css" type="text/css">
</head><!-- #BeginEditable "script" --><!-- {script}--><!-- #EndEditable -->
<body bgcolor="#FFFFFF" text="#000000"
leftmargin="0" topmargin="0" marginwidth="1" marginheight="0" link="#0000CC" vlink="#990099" alink="#00CC00">
<a name="pagetop"></a>
<table width="620" border="0" cellspacing="0" cellpadding="0">
	<tr>

    <td valign="top" class="sideNavCell"><a href="http://www.epa.gov/"><img src="http://www.epa.gov/epahome/images/logo_epaseal.gif" width="140" height="114" alt="United States Environmental Protection Agency" border="0"></a><br>
      <a href="#pagecontents"><img src="http://www.epa.gov/epahome/images/misc_dot_sbblue.gif" width="1" height="1" border="0"
			alt="Skip common site navigation and headers" vspace="2" hspace="69"></a>
      <table width="100%" border="0" cellspacing="1" cellpadding="2">
        <tr>
          <td id="sidenav1"><a href="http://www.epa.gov/epahome/wtc/data_summary.htm" class="epaSideBarLinks">Monitoring
			Summaries</a></td>
        </tr>
        <tr>
          <td id="sidenav2"><a href="http://www.epa.gov/epahome/wtc/index.html#monitoring" class="epaSideBarLinks">Monitoring
			Data</a></td>
        </tr>


        <tr>
          <td id="sidenav7"><a href="http://www.epa.gov/epahome/wtc/headline_092101.htm" class="epaSideBarLinks">Frequently
			Asked<br>
            &nbsp;&nbsp;Questions</a></td>
        </tr>
        <tr>
          <td id="sidenav8"><a href="http://www.epa.gov/epahome/wtc/pictures.html" class="epaSideBarLinks">Pictures</a></td>
        </tr>
        <tr>
          <td id="sidenav9"><a href="http://www.epa.gov/epahome/wtc/releases.htm" class="epaSideBarLinks">EPA Press Releases</a></td>
        </tr>
        <tr>
          <td id="sidenav10"><a href="http://www.epa.gov/epahome/wtc/index.html#help" class="epaSideBarLinks">How
			You Can Help</a></td>
        </tr>
      </table>
      <p align="center">&nbsp;</p>
			<p align="center">&nbsp;</p>
			<p align="center">&nbsp;</p>
			<p>&nbsp; </p>
		</td>
		<td valign="top" rowspan="2"><img src="http://www.epa.gov/epahome/images/misc_dot_dkblue.gif" width="5" height="47" vspace="26" hspace="0" alt=""></td>
		<td valign="top">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td colspan="3"><img src="http://www.epa.gov/epahome/images/ban_topepa.gif" width="485" height="26" align="right" alt="United States Environmental Protection Agency"></td>
				</tr>
				<tr>
					<td bgcolor="#000066"><img src="http://www.epa.gov/epahome/images/misc_space.gif" width="1" height="1" vspace="2" hspace="2" alt=""></td>

          <td width="100%" bgcolor="#000066" class="epaPageHeaders">EPA Response to September 11</td>
					<td><img src="http://www.epa.gov/epahome/images/ban_end.gif" width="21" height="47" alt=""></td>
				</tr>
				<tr>
					<td><img src="http://www.epa.gov/epahome/images/misc_space.gif" width="1" height="1" vspace="2" hspace="2" alt=""></td>
					<td><img src="http://www.epa.gov/epahome/images/misc_space.gif" width="1" height="1" vspace="2" hspace="234" alt=""></td>
					<td><img src="http://www.epa.gov/epahome/images/misc_space.gif" width="1" height="1" vspace="2" hspace="2" alt=""></td>
				</tr>
			</table>

	  <table width="100%" border="0" cellspacing="2" cellpadding="0">
        <tr valign="baseline">
          <td><img src="http://www.epa.gov/epahome/images/misc_space.gif" width="1" height="1" vspace="2" hspace="2" alt=""></td>
          <td class="epaltSans" nowrap width="100%">
		  <FORM METHOD="post" ACTION="http://search.epa.gov/s97is.vts">

       <INPUT TYPE="hidden" NAME="Action" VALUE="FilterSearch">
       <INPUT TYPE="hidden" NAME="Filter" VALUE="sample3filt.hts">
       <INPUT TYPE="hidden" NAME="resulttemplate" VALUE="group_results.hts">
       <INPUT TYPE="hidden" NAME="collection" VALUE="All">
	   <INPUT TYPE="hidden" NAME="fld" VALUE="epapages">
	   <INPUT TYPE="hidden" NAME="url_directory" VALUE="wtc">


<!--<form name="fcol" method="post" onSubmit="return validateForm()" action="http://oaspub.epa.gov/webi/meta_first_new2.try_these_first">
              <input type="hidden" name="button1" value="all">
              <input type="hidden" name="button2" value="">
              <input type="hidden" name="button3" value="metaboth"> -->
              <a href="http://www.epa.gov/epahome/comments.htm">Contact Us</a>
              <img src="http://www.epa.gov/epahome/images/misc_space.gif" width="1" height="1" vspace="2" hspace="5" alt="">
              Search:
              <input name="queryText" size=20 value="">
              <input type="image" src="http://www.epa.gov/epahome/images/btn_search.gif" value="Search" border="0" width="40" height="16" alt="Search Button" name="image">
              <a href="http://www.epa.gov/epahome/search.html">Advanced Search</a>
            </form>
			<p class="epaltSans">
<a href="http://www.epa.gov/epahome/wtc/index.html">Response to 9-11</a> &gt;
<a href="http://www.epa.gov/epahome/wtc/index.html#monitoring"> Monitoring Data </a> &gt;
<a href="http://www.epa.gov/enviro/nyc/benzene"> Benzene in Air </a> &gt;
');
     OPEN c_geo_area(p_addr_id);
     FETCH c_geo_area INTO v_location;
     CLOSE c_geo_area;


     htp.p(replace(initcap(v_location), 'Wtc', 'WTC')||'<!-- #BeginEditable "breadcrumbs" -->   <!-- #EndEditable --></p>
          </td>
        </tr>
      </TABLE>
      <!-- #BeginEditable "content" --><a name="pagecontents"></a>');

     htp.p('<B><p class="epaSubHeadBig">EPA Monitoring Site:<br>');
     htp.p(v_location||'</B>');
     htp.p('</p><p class="epaSubHead">Benzene Grab Sample Air Monitoring Data</p>');

     htp.p('<p>Benzene is a Volatile Organic Compound, or VOC, found in emissions from burning coal,
     oil and gasoline and in evaporation at gasoline service stations. These and other sources all
     contribute to the baseline level of benzene found in outdoor air.  Benzene is also released
     from tobacco smoke. </p>');

     htp.p('<p>Benzene levels in urban areas like New York City fluctuate widely, across locations (near idling
cars or trucks vs. on the waterfront) and across time (rush hour vs. middle of the night).
Routine monitoring involves sampling over a 24-hour period to obtain an average concentration
during that day. </p>');

     htp.p('<p>Past data from routine monitoring sites in New York City find some 24-hour average samples
 ranging up to approximately 5 parts per billion (ppb).  In response to these urban area levels,
 EPA has adopted several programs to reduce benzene emissions from large urban sources such as
motor vehicles.  More information on these programs can be found at www.epa.gov/otaq. </p>');

     htp.p('<p>The table below shows the results of EPA monitoring for benzene since September 11.
Measurements are of benzene from World Trade Center smoke and associated cleanup
activities (vehicles and equipment) and include background levels from other more
routine sources such as city traffic.  Nearly all of these measurements were "grab" samples,
lasting but a few minutes; they are intended to quickly compare levels at the work site with
those found in the surrounding streets. </p>');

     htp.p('<p>To protect workers at the site, EPA attempts to identify the highest concentration levels of
benzene by taking grab samples where smoke plumes have been sighted at the work site.
Some of the results have been dramatically higher (up to 4000 times) than those taken in the
surrounding streets.  EPA has urged workers to wear respirators and other protective gear,
which the Agency and others have provided.  Used properly, respirators can protect workers
from exposure to benzene and other contaminants at the levels we have found. </p>');

     htp.p('<p>Benzene dissipates quickly and grab samples outside the work zone have been drastically lower,
indicating dramatic drop-offs in levels as you move away from the debris pile. Full day air
samples have also been taken at eight sites, mainly along the outer edge of the work zone.
These measurements, which are comparable to levels seen prior to September 11 in New York City,
confirm the rapid dissipation of benzene as you move away from the debris pile. </p>');

     htp.p('<p>These full day air samples have also been taken at eight sites, mainly along the outer edge of the work zone.
     These measurements, which are comparable to levels seen prior to September 11 in New York City,
     confirm the rapid dissipation of benzene as you move away from the debris pile and illustrate
     that over a full day, average levels are much lower than many of
     the levels captured in the few minute grab samples.</p>');

    htp.p('<p>These full day air samples are all below EPA''s screening level,
     which was set to be protective against significantly increased risks of
    cancer and other adverse health effects assumes
     continuous exposure for a year to an average concentration of 20 ppb.</p>');

     r_cntr := 0;
     OPEN c_pcb_levels(p_addr_id);
     LOOP
         FETCH c_pcb_levels INTO v_Benzene_rec;
         EXIT WHEN c_pcb_levels%NOTFOUND;

            r_cntr := r_cntr + 1;
            IF r_cntr = 1  THEN
               htp.br;
               htp.p('<P><CENTER><B>Grab Samples</B></CENTER></P>');
              --htp.p('<font size="2" face="Arial">');
               htp.p('<table width="100%" border="1">');
               htp.p('<tr>');
               htp.p('<th scope="col">');
               htp.p('<p>Date</p>');
               htp.p('</th>');
               htp.p('<th scope="col">');
               htp.p('<p>Measurement*</p>');
               htp.p('</th>');
               htp.p('<th scope="col">');
               htp.p('<p>Units</p>');
               htp.p('</th>');
               htp.p('</tr>');
           END IF;

           IF r_cntr >= 1 THEN
              htp.p('<font size="2" face="Arial">');
              htp.p('<tr>');

              -- Print out the Sample Data
              htp.p('<td align="center"><font size="2" face="Arial">'||v_Benzene_rec.end_date||'</td>');

              if v_benzene_rec.sign = '<' then
                 htp.p('<td align="center"><font size="2" face="Arial">Not Detected</font></td>');
              else
              IF trim(TO_CHAR(v_Benzene_rec.result)) IS NOT NULL THEN
                 htp.p('<td align="center"><font size="2" face="Arial">'||
                         v_Benzene_rec.sign || trim(TO_CHAR(v_Benzene_rec.result))
                         || '</td>');
              ELSE
                 htp.p('<td align="center"><font size="2" face="Arial">'||
                        NVL(INITCAP(v_Benzene_rec.detect_status), 'No Data Recorded')||'</td>');
              END IF;
              end if;
              htp.p('<td align="center"><font size="2" face="Arial">'||replace(v_Benzene_rec.units, 'ppbv', 'ppb')||'</td>');
              htp.p('</tr>');
           END IF;
     END LOOP;
     CLOSE c_pcb_levels;
     IF r_cntr >= 1 THEN
        htp.p('</font>');
        htp.p('</table>');
     END IF;

     r_cntr := 0;
     OPEN c_benz24_levels(v_location);
     LOOP
         FETCH c_benz24_levels INTO v_Benzene_rec;
         EXIT WHEN c_benz24_levels%NOTFOUND;
           r_cntr := r_cntr + 1;
            IF r_cntr = 1  THEN
               htp.br;
               htp.p('<P><CENTER><B>Full Day Samples</B></CENTER></P>');
              --htp.p('<font size="2" face="Arial">');
               htp.p('<table width="100%" border="1">');
               htp.p('<tr>');
               htp.p('<th scope="col">');
               htp.p('<p>Date</p>');
               htp.p('</th>');
               htp.p('<th scope="col">');
               htp.p('<p>Measurement*</p>');
               htp.p('</th>');
               htp.p('<th scope="col">');
               htp.p('<p>Units</p>');
               htp.p('</th>');
               htp.p('</tr>');
           END IF;

           IF r_cntr >= 1 THEN
              htp.p('<font size="2" face="Arial">');
              htp.p('<tr>');

              -- Print out the Sample Data
              htp.p('<td align="center"><font size="2" face="Arial">'||v_Benzene_rec.end_date||'</td>');

              if v_benzene_rec.sign = '<' then
                 htp.p('<td align="center"><font size="2" face="Arial">Not Detected</font></td>');
              else
              IF trim(TO_CHAR(v_Benzene_rec.result)) IS NOT NULL THEN
                 htp.p('<td align="center"><font size="2" face="Arial">'||
                         v_Benzene_rec.sign || trim(TO_CHAR(v_Benzene_rec.result))
                         || '</td>');
              ELSE
                 htp.p('<td align="center"><font size="2" face="Arial">'||
                        NVL(INITCAP(v_Benzene_rec.detect_status), 'No Data Recorded')||'</td>');
              END IF;
              end if;
              htp.p('<td align="center"><font size="2" face="Arial">'||replace(v_Benzene_rec.units, 'ppbv', 'ppb')||'</td>');
              htp.p('</tr>');
           END IF;
     End Loop;
     CLOSE c_benz24_levels;
     IF r_cntr >= 1 THEN
        htp.p('</font>');
        htp.p('</table>');

     END IF;

     htp.p(' <!-- #BeginLibraryItem "/low limit.lbi" -->');

     htp.p('<p>*The information contained in this database should be considered provisional and may be subject to adjustment upon final analysis.</p>');

     htp.p('<p>There may be gaps in daily readings because of relocated construction '
           ||'equipment and variations in sampling locations.</p>');

     htp.p('<!-- #EndEditable --> </td>');
     htp.p('</tr>');
     htp.p('</table>');

     htp.p('<table width="620" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top" class="sideNavCell"><img src="http://www.epa.gov/epahome/images/misc_space.gif" width="140" height="1" border="0" vspace="2" alt=""></td>
		<td valign="top"><img src="http://www.epa.gov/epahome/images/misc_space.gif" width="1" height="1" vspace="2" hspace="2" alt=""></td>
		<td valign="top" width="100%" align="center"><img src="http://www.epa.gov/epahome/images/misc_footer_bar.gif" width="500" height="10" vspace="4" alt="Begin Site Footer"></td>
	</tr>
	<tr>
		<td valign="top" class="sideNavCell">&nbsp;</td>
		<td valign="top">&nbsp;</td>
		<td valign="top" width="100%" align="center" class="epaltSans"><!-- #BeginEditable "localnav" -->
      <p class="epaltSans">&nbsp;</p>
	  <!-- #EndEditable -->
        <p class="epaltSans"><a href="http://www.epa.gov/">EPA Home</a> | <a href="http://www.epa.gov/epahome/usenotice.htm">Privacy
		and Security Notice</a> | <a href="http://www.epa.gov/epahome/comments2.htm">Contact Us</a><br>
		<script language="javascript">
						document.write("Last Updated: " +  document.lastModified + "<BR>")
						document.write("URL: " + document.location.href)
						</script>
	  </p>
	  <p>&nbsp;</p>
		</td>
	</tr>
</table><!-- #BeginEditable "script2" --><!--{script2}--><!-- #EndEditable -->

');
     htp.p('</BODY>');
     htp.p('</HTML>');
/*EXCEPTION
         WHEN others THEN
              htp.bold('NOTE: ');
              htp.p('<P>The database is currently being updated. Please check back shortly.</P>');
              htp.p('</TD>');
              htp.p('</TR>');
              htp.p('</TABLE>');
              htp.p('</BODY>');
              htp.p('</HTML>');*/
END;    --end of procedure Benzene_Air_MONITORING

/
show errors;
