%@ LANGUAGE="VBScript" %> <% ndate=CStr(Request("ndate")) Set Connection = Server.CreateObject("ADODB.Connection") Connection.Mode = adModeRead Connection.Open phdb_rd_repl SQLStmtx = "select to_char(max(reqdate),'MM/DD/YYYY HH24:MI:SS') ddate,to_char(max(reqdate),'MM/DD/YYYY') sdate,count(reqdate) NTOT " SQLStmtx = SQLStmtx & " from ASSEMBLY.FEC_MAP " SQLStmtx = SQLStmtx & " where reqdate=to_date('" & ndate & "','YYYYMMDDHH24MISS') " ' response.write(SQLStmtx) Set RSx = Connection.Execute(SQLStmtx) If Not RSx.EOF Then ntot=CLng(RSx("ntot")) ddate=CStr(RSx("ddate")) sdate=CStr(RSx("sdate")) Else ntot=0 ddate="" sdate="" End If Set RSx=nothing SQLStmt = " select fc.FEC_NUMBER,fc.FEC_STRING,af.REQDATE,af.STARTDATE, " SQLStmt = SQLStmt & " af.GEO_MOD,af.SHYBRID_NPOS,af.SWURST_ID,fc.FEC_ST_LEN nchan,af.FEC_ST_LEN " SQLStmt = SQLStmt & " from ASSEMBLY.ACTIVE_FECS_PERM af, " SQLStmt = SQLStmt & " (select fs.startdate,fs.fec_number,fs.fec_string,fs.fec_st_len from assembly.fec_strings fs, " SQLStmt = SQLStmt & " (select max(startdate) startdate,max(abs(fec_number)) afec_number from assembly.fec_config " SQLStmt = SQLStmt & " where startdate<=to_date('" & ndate & "','YYYYMMDDHH24MISS') " SQLStmt = SQLStmt & " group by abs(fec_number)) fcs " SQLStmt = SQLStmt & " where fcs.startdate=fs.startdate and fcs.afec_number=abs(fs.fec_number) and fs.fec_number>0) fc " SQLStmt = SQLStmt & " where af.reqdate(+)=to_date('" & ndate & "','YYYYMMDDHH24MISS') " SQLStmt = SQLStmt & " and af.fec_number(+)=fc.fec_number and af.fec_string(+)=fc.fec_string " SQLStmt = SQLStmt & " ORDER BY fc.FEC_NUMBER,fc.FEC_STRING " ' response.write(SQLStmt) Set RS = Connection.Execute(SQLStmt) %>
Total Map Length Is <%=ntot %>
<% fec_old=-999999 fused=0 ftotal=0 ftotal_fec=0 fec_max=-1 fec_max_len=-10 Do While Not RS.EOF If CInt(RS("FEC_NUMBER"))<>fec_old Then If fec_old<>-999999 Then ' Response.write("FEC # | FEC Port | FEC String | FEC Channels | Geometrical Module |
Hybrid Position |
Wurst ID | Module Channels | Used Fraction | |||||
<%=RS("FEC_NUMBER")%> | <%response.write(round(CInt(RS("FEC_STRING"))/2-0.1,0))%> | <%=RS("FEC_STRING")%> | <%=nchan%> | <% If Not IsNull(RS("GEO_MOD")) Then ' module is connected to this string %>&DATE=<%=sdate%>"><%=RS("GEO_MOD")%> | <%=RS("SHYBRID_NPOS")%> | <%=RS("SWURST_ID")%> | <%=string_length%> | <%=Round(fract,2)%> | <% Else ' empty string %>Empty | - | - | 0 | 0 | <% End If %>
Total number of channels in this map is <%=ntot%> out of which <%=fused%> are connected to modules. This makes the average FEC usage of <%=Round(fused/ntot,2)%>
<% Else %>No active FEC's defined <% End If Connection.Close %>