/*MAIN
 Overview
 
 GFST_PROCESS1 is a sub-procedure of the main reconstruction procedure 
    RECONSTRUCTION1.  It serves the purposes of 
MAIN*/

/*ARGUMENTS
  Arguments
 
  GFST_PROCESS1 takes the following arguments, all of which have an IN 
  parameter mode:
   - GFST (VARCHAR2).  This argument represents the name of the Good Frames 
     Statistics Table that was posted by Labview just prior to the onset of 
     reconstruction.  Entries in the GFST were built and logged into a script
     file during processing of the annotated minor frames file by AD.

   - RETURN_VAL1 (INTEGER).  This argument represents 

   - DIRECTION1 (INTEGER).  This argument represents 

   - SPAN_NUMBER (INTEGER).  This argument represents
ARGUMENTS*/

/*DEPENDENCIES
 Dependencies
 
 The following are the procedures called by GFST_PROCESS1 (listed in their
 order of call):
   - SWITCH.  This is the package that manipulates the switches for all 
     the reconstruction rules.

   - RULES_STATES.  This is a package of three procedures and one function all
     of which track and post reconstruction states for all rules as they become
     available, in the temporary table LOGT.

   - RULE.  This is the stored package that manipulates the reconstruction rules
     numbers, name and version number.

   - OPEN_AND_PARSE.  This function combines what would otherwise have
     been separate calls to the native Oracle DBMS_SQL.OPEN_CURSOR and
     DBMS_SQL.PARSE procedures, into a single function.

   - DBMS_SQL.  This the native Oracle dynamic SQL package.

   - CONFIG.  This is the stored package that manipulates the configuration
     parameters for all the reconstruction rules.

   - EXECUTE_AND_CLOSE.  This function combines what would otherwise have
     been separate calls to the native Oracle DBMS_SQL.EXECUTE and
     DBMS_SQL.CLOSE procedures, into a single function.

   - COUNT_ALL.  This is a stored function created to count all entries in any
     table.  This function takes in as argument the name of the table to count
     from (as a varchar2), and any "where" clause that may be used to constraint
     the count (as a varchar2).  Note that if no "where" clause is to be used in
     a count, the second argument to this function is optional.

   - GFST_EX_INSERT_TIME.  

   - LOG_FILE.  This is a package of procedures which handle the tasks of
     creating the file in which reconstruction output messages will be written
     to, writing to the latter file, and closing it at the end of
     reconstruction.

   - POST_STATE.  This is a package of three procedures and one function all
     of which serve the role of writing the states of all rules as they become
     available, in the system_state table.
DEPENDENCIES*/

/*VARIABLES
 Variables

 The following are variables used in the procedure:
   - C and D (INTEGER). Cursor handles.

   - EXECUTE1 (INTEGER).  The number of rows processed by the SQL statement
     if that statement is an UPDATE, INSERT, or DELETE.  If the SQL statement is
     not an UPDATE, INSERT, or DELETE, this value should be ignored.

   - NUM_UNIQUE (NUMBER).  Represents the

   - NMF (NUMBER).  Represents the

   - FP_UMF_DATETIME1, NEW_FP_UMF_DATETIME1 and NEW_FP_UMF_DATETIME2 (NUMBER).
     Represents the
 
   - NEW_FP_UMFGR_DATETIME1 and NEW_FP_UMFGR_DATETIME2 (NUMBER).  Represent the


   - NEW_ID1 and NEW_ID2 (NUMBER).  Represent the

   - MAX_ID (NUMBER).  Represents the

   - NEW_CDM1 and NEW_CDM2 (NUMBER).  Represent the 

   - NUM_INSERT1 (NUMBER).  Represent the 

   - NUM_INSERT2 (NUMBER).  Represent the 

   - NUM_INSERT3 (NUMBER).  Represent the 

   - INSERT_NUM (NUMBER).  Represent the 

   - INSERT_NUM1 (NUMBER).  Represent the 

   - SLOP1 (NUMBER).  Represent the 

   - NEW_MFDP1 and NEW_MFDP2 (NUMBER).  Represent the

   - LOOP_ENTRY (INTEGER).  Represent the

   - MFP1, NEW_MFP1 and NEW_MFP2 (NUMBER).  Represent the

   - NEW_UMFC, NEW_UMFC1, and NEW_UMFC2 (NUMBER).  Represent the

   - LOOP_INDEX (NUMBER).  Represent the 

VARIABLES*/

/*EXAMPLES
  Examples
 
  Here is a call to GFST_PROCESS1:
 
   DECLARE RETURN_VAL1 INTEGER;
   BEGIN
       GFST_PROCESS1 ('GEOTAIL1997274142242671GOOD',RETURN_VAL1,1,12);
   END;
   /

 The arguments of this procedure are passed in from Assembly/Decommutation. 
EXAMPLES*/

/*EXCEPTIONS
 Exceptions

 There are no named exceptions for this procedure, except for the generic one
   WHEN OTHERS.  When the latter is triggered, the error message is outputted
   along with the name of the module that erred, and any cursors that may still
   be opened are closed.  
EXCEPTIONS*/

/*ERRORS
 Errors

 There are no errors that this procedure is known to generate.  Should an
   error occur, take action based on the description of the error.
ERRORS*/

/*TABLES
 Tables
 
 The following tables are referenced in this procedure:
  - GFST. This is the Good Frames Statistics Table that was posted by
    AD just prior to the onset of reconstruction.

  - GRADE2_TEMP_STOR.  This a temporary table created by procedure GFST_PROCESS1.
    Its purpose is to temporarily store information about all the major frames
    (grades 2) that have been found as missing within and accross data spans of
    the GFST.

 For more information on these and other tables, see the documentation on tables.
TABLES*/

/*OTHERS
 Others
 
 It should be noted that 

 For more details on this procedure see the reconstruction documentation.
OTHERS*/
