In an interview I have been asked the below question:
One file have 1000 records and another file have 2000 records,Need to have one file with the records where the first 15 bytes between the two files matches with each other.If multiple records of first file matches with a second file record then all the records will be there into the third file.
Can anybody tell me how can I do other than writing a cobol program.
Please don't mind but as I know to use splice I have to consider one file as base file and records from another file will be joined with the base file records based on matching key and those bytes will be joined to the base record which are mentioned WITH parameter.
But if I want to have the base record too in my output file then how can I achieve and If the both file have duplicates then how can I consider one as a Base file.
Please suggest if you have any trick.
The KEEPBASE operand of SPLICE keeps the base records.
If you want a complete answer, you need to give a complete description of the problem. Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.