I have 2 datasets and based on the value of the first dataset i need to update the values in the other dataset.
Dataset1
Source Date1 Date2
AAA 201601 20150901
BBB 201601 20151001
CCC 201601 20151101
AAA 201601 20150901
BBB 201601 20151001
CCC 201601 20151101
Dataset2
Source field1 field2 BegDate1 field3 BegDate2
AAA HEADR1 201601
AAA NAME1 CITY1 20160101 STATE1 20160201
AAA NAME1 CITY1 20160101 STATE1 20160201
AAA NAME1 CITY1 20160101 STATE1 20160201
AAA TRAIL1 0003
AAA HEADR1 201601
AAA NAME1 CITY1 20160101 STATE1 20160201
AAA NAME1 CITY1 20160101 STATE1 20160201
AAA NAME1 CITY1 20160101 STATE1 20160201
AAA TRAIL1 0003
The requirement is I need to match the source from dataset 1 with dataset 2, match the date1 from dataset 1 with the date in the header of dataset 2. If they are same, use the date2 from dataset 1 and change the Begdate1 of dataset 2 ie 20160101 to 20150901. Also my output dataset should have the header and trailer record also.
Thanks in advance for your help.