I have two sequential files file1 and file2. I have to retrieve the records which are present in File1 but not in File2 & update File2. Layout of File1 & File2 is 950 & 650 respectively. The common field which uniquely identifies the records is STUD-ID-CODE field
this field is present from record 1-11 [STUD-ID-CODE PIC X(11)]
this field is present from record 3-13 [05+04+02]
10 STUD-QUAL PIC X(02).
25 STUD-ZONE-CD PIC X(05).
25 STUD-TYPE-CD PIC X(04).
20 STUD-HOST-ZONE-CD PIC X(02).
how I can solve this ? Is it possible to sort both the files & merge them and take the non duplicate records from the merged file (through ICE TOOL Utility) and then update file2 (Using COBOL PGM).
But the problem in merging is the record positions (STUD-ID-CODE) of two files are not the same.
I want to add the records to file2. That is those records which is present in file1 but not in file2. eg: file1 contains A,B,C,D. File2 contains A,C.
Here the records b,d are not present in File2. So, I want to add these records in File2.
1. Make the file2 to 950 Layout by adding a filename field of size 1 and rest add fillers.
2. Then call a cobol pgm which adds the filename as 'F' to all the records of file2.
3. Then using JCL to merge both the files and retrieve the nonduplicate rows and store it in merged-file.
4. Then using another cobol pgm which updates file2, with all the records in merged-file, whose filename field is not F. (If the 'Filename' field has the value 'F' then it denotes that particular record is from file2.) This helps us to add the records present only in File1 but not in File2.
Please tell me whether this design will work ? Can I get the feedbacks of this design ? or do you suggest any other technique ?
You really don't need a cobol program. Show me a sample of your input data with key information and the contents that you want to update from file 1 on to file2. Will be there be duplicates in any of the files?