Joined: 14 Jan 2015
| 0 votes |
| 0 salutes ||
|Posted: Wed Jan 14, 2015 3:56 am Post subject: 2 Files / Same Format / Need changed record and NEW records
I want help in finding the output from 2 files on the below scenario:
1. I have 2 file which are of same length (1700) and same format. Lets say the data in these files are of customer details .
2. Daily there will be a new file which will have the data for new customers along with the changes made to existing customers if any.
3. The files also have the status of the customer - active or not active
From this I need the new records and also the changed records. I used SYNCTOOL to get this data which works perfectly right.
Snippet of my code is as follows:
//STEP001 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILE1 DD DSN=FILE1, DISP=SHR
//FILE2 DD DSN=FILE2, DISP=SHR
//OUT DD DSN=FILE3,
//TEMPFL DD DSN=&&B1,DATACLAS=MB010E,
//TOOLIN DD *
COPY FROM(FILE1) TO(TEMPFL) USING(CTL1)
COPY FROM(FILE2) TO(TEMPFL) USING(CTL2)
SELECT FROM(TEMPFL) TO(OUT) ON(1,1700,CH) NODUPS USING(CTL3)
//CTL1CNTL DD *
//CTL2CNTL DD *
//CTL3CNTL DD *
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
But there is a another scenario which needs to be filtered out from this.
There is a possibility that a non active customer can be modified and sent in the latest file.
Is there any way to filter these records from being selected in the OUT file?
1 - 10 Unique Number
10 - 7 Customer Number
314 - 314 Status