separate (Tracker.Report_Generator)
procedure Work_Units_Per_Ss is
    ----------------------------------------------------------------------
    --|
    --|  NAME:  WORK_UNITS_PER_SS
    --|
    --|  OVERVIEW:
    --|    This report displays the total amount of original and current size
    --|    units for each defined subsystem in the project.  Total original
    --|    and current size for the project are given as summary data at the
    --|    bottom of the report.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    others   an error message is printed and processing continues
    --|
    --|  HISTORY:
    --|    written by   Bonnie Burkhardt   March 1985
    --|
    ----------------------------------------------------------------------

    use Ss_List_Pkg;
    use Calendar;

    Header1 : String (1 .. 132) := (others => ' ');
    Header2 : String (1 .. 132) := (others => ' ');
    Header_Lines : String (1 .. 132) := (others => ' ');

    End_List : Boolean := False;
    New_Date : Date_Type := Null_Date;
    New_Tot_Date : Date_Type := Null_Date;
    Old_Date : Date_Type := Null_Date;
    Old_Tot_Date : Date_Type := Null_Date;
    Ss_Index : Integer := 0;
    Ss_Ptr : Subsystem_Pointer;
    Ss_Orig_Size : Integer range 0 .. 999_999 := 0;
    Ss_Cur_Size : Integer range 0 .. 999_999 := 0;
    Ss_Eq_Size : Integer range 0 .. 999_999 := 0;
    Tot_Orig_Size : Integer range 0 .. 999_999 := 0;
    Tot_Cur_Size : Integer range 0 .. 999_999 := 0;
    Tot_Eq_Size : Integer range 0 .. 999_999 := 0;
    Title : constant String := "LINES OF CODE PER SUBSYSTEM";

    procedure Init_Size_Headers is separate;
    procedure Calc_Size is separate;

begin
    Init_Size_Headers;
    Start_Page (Title, "", Header1, Header2, Header_Lines);

    -- print out each line of the report
    Start_Walk (Ss_List);

    loop
        Walk (Ss_List, Ss_Ptr, End_List);
        exit when End_List;
        Ss_Index := Ss_Index + 1;

        Calc_Size;

        -- print out subsystem
        Set_Col (Report_File, 2);
        Put (Report_File, Ss_Ptr.Name);
        Set_Col (Report_File, 14);
        Put (Report_File, Ss_Orig_Size, 6);
        Set_Col (Report_File, 24);
        Put (Report_File, Ss_Cur_Size, 6);
        Set_Col (Report_File, 34);
        Put (Report_File, Ss_Eq_Size, 6);
        Set_Col (Report_File, 45);
        Put (Report_File, Old_Date.Month, 2);
        Put (Report_File, '/');
        Put (Report_File, Old_Date.Day, 2);
        Put (Report_File, '/');
        Put (Report_File, Old_Date.Year, 4);
        Set_Col (Report_File, 59);
        Put (Report_File, New_Date.Month, 2);
        Put (Report_File, '/');
        Put (Report_File, New_Date.Day, 2);
        Put (Report_File, '/');
        Put (Report_File, New_Date.Year, 4);
        New_Line (Report_File);
    end loop;


    -- print out totals
    Set_Col (Report_File, 14);
    Put (Report_File, Header_Lines (14 .. 132));
    New_Line (Report_File);
    Set_Col (Report_File, 2);
    Put (Report_File, "TOTALS: ");
    Set_Col (Report_File, 14);
    Put (Report_File, Tot_Orig_Size, 6);
    Set_Col (Report_File, 24);
    Put (Report_File, Tot_Cur_Size, 6);
    Set_Col (Report_File, 34);
    Put (Report_File, Tot_Eq_Size, 6);
    Set_Col (Report_File, 45);
    Put (Report_File, Old_Tot_Date.Month, 2);
    Put (Report_File, '/');
    Put (Report_File, Old_Tot_Date.Day, 2);
    Put (Report_File, '/');
    Put (Report_File, Old_Tot_Date.Year, 4);
    Set_Col (Report_File, 59);
    Put (Report_File, New_Tot_Date.Month, 2);
    Put (Report_File, '/');
    Put (Report_File, New_Tot_Date.Day, 2);
    Put (Report_File, '/');
    Put (Report_File, New_Tot_Date.Year, 4);
    New_Line (Report_File, 2);

exception
    when others =>
        Put_Line ("exception raised in WORK DISTRIBUTION REPORT");
end Work_Units_Per_Ss;
