hi, thanks for your reply. Actually, i am getting the file position from the first file and find records in the first file too. I am using the second file, only to know which record i should fetch based on the id given in second file. Thus i am matching the id's from the second file to the first file. The second file is important for the cluster headings.Thanks !!!