You need to give more details of what you're trying to do. Show an example of the records in each input file and what you want the output records to look like. Give the RECFM and LRECL of each input file. Give the starting position, length and format of each relevant field.
YEAR N 4
MONTH A 3
Region-CODE A 2
DEALER-CODE A 7
QTY N 2
TYPE A 3
This data is extracted on monthly basis and is stored in dataset in the above format. Once the new data is extracted, I need to compare that with the previous month extract. If there is any new record or change in values of any record needs to be moved to a different dataset. Hope you are clear with my requirement.
No, I'm not. I don't know what the field definitions you show mean. Does A 3 mean 3 characters? Does N 2 mean 2-byte numeric? What format? BI, PD, ZD?
What exactly is it you're comparing in the two files? Are you comparing record 1 in file 1 to record 1 in file 2, or a record with a particular field in file 1 with a record with the same field in file 2, or what? We don't know anything about your data or the result you're trying to get, so you need to be very specific about what you're trying to do to help others understand your requirement.
Please provide the information I asked for previously:
Show an example of the records in each input file and what you want the output records to look like. Give the RECFM and LRECL of each input file. Give the starting position, length and format of each relevant field.
I am sorry for the confusion. My requirement is very simple. I do have two flat files of same structure. The record length is 23 characters. Both the flat files are extracted from same database file but at different time. One was extracted this month and the other last month. I need to find the changed records and new records. All new records and the records which have changed values should be stored in another flat file with same structure.
Record structure is as below