-- $Source: /commtar/monoBANK/CICS_INTF/fc_c_2.ada,v $ -- $Revision: 1.2 $ $Date: 88/03/29 19:06:34 $ $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_2 ---------------- 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_2", "Retrieve records via key for Data Type Files"); declare begin Start_test("fc_c_2_a", "read record using full key"); Key := Pad(integer'image(90000), Key'length); NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Key), Gt_Eq=>TRUE); Rec := To_rec(Host_rec); if Rec.count /= " 90000" then Fail_test; else Pass_test; end if; 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_2_b", "read record with key GTEQ full key"); Key := Pad(integer'image(80000), Key'length); NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Key), Gt_Eq=>TRUE); Rec := To_rec(Host_rec); if Rec.count /= " 89990" then Fail_test; else Pass_test; end if; 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_2_c", "Read record using generic key"); Subkey := Pad(integer'image(8999), Subkey'length); NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Subkey), Generic_key=>TRUE); Rec := To_rec(Host_rec); if Rec.count /= " 89990" then Fail_test; else Pass_test; end if; 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_2_d", "read record with key GTEQ generic key"); Subkey := Pad(integer'image(8000), Subkey'length); NLF.Read(File=>Recfile, Element=>Host_rec, Key=>To_host_string(Subkey), Generic_key=>TRUE, Gt_Eq=>TRUE); Rec := To_rec(Host_rec); if Rec.count /= " 89990" then Fail_test; else Pass_test; end if; 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;