DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦5abafd9ce⟧ TextFile

    Length: 5347 (0x14e3)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Io;
with Log;
with Library;  
with Profile;
with Tape_Utils;
with Tape_Tools;
with Directory_Tools;
with String_Utilities;
procedure Make_Mvs_Tape (Files : String := "$@";
                         Volume : String := "";
                         Record_Length : Natural := 80;
                         Block_Length : Natural := 2000) is

    Tape : Tape_Utils.Device;
    List : Directory_Tools.Object.Iterator;
    File : Directory_Tools.Object.Handle;
    Jcl_File : constant String := "$.MVSJCL";
    Jcl_Handle : Io.File_Type;
    Unit_Number : Natural := 1;
    Temp_Filename : constant String := "$.tape_temp";

    function "=" (This_Class : Directory_Tools.Object.Class_Enumeration;
                  That_Class : Directory_Tools.Object.Class_Enumeration)
                 return Boolean renames Directory_Tools.Object."=";

    procedure Put_Move_Command (To_File : Io.File_Type;
                                Unit_Number : Natural;
                                Unit_Target_Name : String) is
    begin
        Io.Put_Line (To_File,
                     "// EXEC MOVE,TNAME='UNIT" &
                        String_Utilities.Strip (Natural'Image (Unit_Number)) &
                        "',TFILE=" & String_Utilities.Strip
                                        (Natural'Image (Unit_Number + 1)) &
                        ",MNAME=" & "'" & Unit_Target_Name & "'");
    end Put_Move_Command;
begin
    List := Directory_Tools.Naming.Resolution (Files);
    if Directory_Tools.Object.Done (List) then
        Log.Put_Line ("No files processed");
    else
        Io.Create (Jcl_Handle, Io.Out_File, Jcl_File);
        while not Directory_Tools.Object.Done (List) loop
            File := Directory_Tools.Object.Value (List);
            if (Directory_Tools.Object.Class (File) =
                Directory_Tools.Object.Ada_Class) or
               (Directory_Tools.Object.Class (File) =
                Directory_Tools.Object.File_Class) then
                Put_Move_Command
                   (Jcl_Handle, Unit_Number,
                    Get_Mvs_Name
                       (Directory_Tools.Naming.Unique_Full_Name (File)));
                Unit_Number := Unit_Number + 1;
            end if;
            Directory_Tools.Object.Next (List);
        end loop;
        Io.Close (Jcl_Handle);
        Directory_Tools.Object.Reset (List);
        Tape := Tape_Utils.Obtain (Mode => Tape_Utils.To_Tape,
                                   Format => "VAX/VMS",
                                   Volume => Volume,
                                   To_Operator => "Thank you",
                                   Record_Format => Tape_Tools.Fixed_Length,
                                   Record_Length => Record_Length,
                                   Block_Length => Block_Length,
                                   Response => Profile.Get);
        Tape_Utils.Write (Tape => Tape,
                          Host_Name => Jcl_File,
                          Tape_Name => Volume,
                          Record_Format => Tape_Tools.Fixed_Length,
                          Record_Length => Record_Length,
                          Response => Profile.Get);
        Unit_Number := 1;
        while not Directory_Tools.Object.Done (List) loop
            File := Directory_Tools.Object.Value (List);

            if Directory_Tools.Object.Class (File) =
               Directory_Tools.Object.Ada_Class then
                Pretty_Print (Directory_Tools.Naming.Unique_Full_Name (File),
                              Temp_Filename);
                Tape_Utils.Write
                   (Tape => Tape,
                    Host_Name => Temp_Filename,
                    Tape_Name => "UNIT" & String_Utilities.Strip
                                             (Natural'Image (Unit_Number)),
                    Record_Format => Tape_Tools.Fixed_Length,
                    Record_Length => Record_Length,
                    Response => Profile.Get);
                Log.Put_Line (Directory_Tools.Naming.Unique_Full_Name (File) &
                              " has been written to tape as UNIT" &
                              String_Utilities.Strip
                                 (Natural'Image (Unit_Number)),
                              Profile.Positive_Msg);
                Unit_Number := Unit_Number + 1;
            else
                Tape_Utils.Write
                   (Tape => Tape,
                    Host_Name => Directory_Tools.Naming.Unique_Full_Name (File),
                    Tape_Name => "UNIT" & String_Utilities.Strip
                                             (Natural'Image (Unit_Number)),
                    Record_Format => Tape_Tools.Fixed_Length,
                    Record_Length => Record_Length,
                    Response => Profile.Get);
                Log.Put_Line (Directory_Tools.Naming.Unique_Full_Name (File) &
                              " has been written to tape as UNIT" &
                              String_Utilities.Strip
                                 (Natural'Image (Unit_Number)),
                              Profile.Positive_Msg);
                Unit_Number := Unit_Number + 1;
            end if;
            Directory_Tools.Object.Next (List);
        end loop;
        Tape_Utils.Release (Tape);
        Library.Delete (Temp_Filename);
    end if;

end Make_Mvs_Tape;