-- $Source: /commtar/monoBANK/CICS_INTF/fc_c_3.ada,v $ -- $Revision: 1.1 $ $Date: 88/03/15 18:09:21 $ $Author: chris $ with CICS_test_reporter; use CICS_test_reporter; with File_control_testing_utility; use File_control_testing_utility; with Host_character_pkg; use Host_character_pkg; with CICS_exceptions; use CICS_exceptions; ---------------- procedure fc_c_3 ---------------- is use Numbered_line_file_pkg; package NLF renames Numbered_line_file; Host_rec : Host_numbered_line_record; Rec : Numbered_line_record; Key : Count_type; Subkey : string(1..4); begin Start_module("fc_c_3", "delete records for Data Type Files"); declare begin Start_test("fc_c_3_a", "delete record using exact key"); Key := Pad(integer'image(90000), Key'length); NLF.Delete(File=>Recfile, Key=>To_host_string(Key)); declare begin NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Key)); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; exception when Not_open => Unexpected_exception("Not_open"); when Duplicate_key => Unexpected_exception("Duplicate_key"); when Duplicate_record => Unexpected_exception("Duplicate_record"); when End_file => Unexpected_exception("End_file"); end; declare begin Start_test("fc_c_3_b", "delete record after read for update"); Key := Pad(integer'image(89999), Key'length); NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Key), Update=>TRUE); NLF.Delete(file=>Recfile); declare begin NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Key)); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; exception when Not_open => Unexpected_exception("Not_open"); when Not_Found => Unexpected_exception("Not_found"); when Duplicate_key => Unexpected_exception("Duplicate_key"); when Duplicate_record => Unexpected_exception("Duplicate_record"); when End_file => Unexpected_exception("End_file"); when Others => Unexpected_exception("undocumented exception"); end; declare begin Start_test("fc_c_3_c", "delete remaining records using generic key"); Subkey := Pad(integer'image(9000), Subkey'length); NLF.Delete(File=>Recfile, Key=>To_host_string(Subkey), Generic_key=>TRUE); Subkey := Pad(integer'image(8999), Subkey'length); NLF.Delete(File=>Recfile, Key=>To_host_string(Subkey), Generic_key=>TRUE); declare begin Subkey := Pad(integer'image(9000), Subkey'length); NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Subkey), Generic_key=>TRUE); Fail_test; exception when Not_Found => Null;--look for rest of file in next declare block when Others => Unexpected_exception("undocumented exception"); end; declare begin Subkey := Pad(integer'image(8999), Subkey'length); NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Subkey), Generic_key=>TRUE); Fail_test; exception when Not_Found => Pass_test; when Others => Unexpected_exception("undocumented exception"); end; exception when Not_open => Unexpected_exception("Not_open"); when Not_Found => Unexpected_exception("Not_found"); when Duplicate_key => Unexpected_exception("Duplicate_key"); when Duplicate_record => Unexpected_exception("Duplicate_record"); when End_file => Unexpected_exception("End_file"); when Others => Unexpected_exception("undocumented exception"); end; End_module; end;