Hi,
I am trying to merge three data sets. First data have 1 record, second data have 2 records and third data set have 4 records.
While merging records, duplicate values gets copied in left data set.
Please suggest how to avoid duplicate values
Example –
Data1
TransactionId
|
Premium
|
ICM_DEC_20_718256
|
1000000
|
Data2
TransactionId
|
Comm%
|
Commission
|
ICM_DEC_20_718256
|
10
|
100000
|
ICM_DEC_20_718256
|
7.5
|
75000
|
Data3
TransactionId
|
Rwd %
|
Reward Commission
|
ICM_DEC_20_718256
|
10
|
100000
|
ICM_DEC_20_718256
|
7.5
|
75000
|
ICM_DEC_20_718256
|
5
|
3000
|
ICM_DEC_20_718256
|
2
|
10000
|
Syntax -
Data want;
Set data1 (in=a) data2 (in=b) data3 (in=c);
By TransanctionId;
If a;
Run;
output -
TransactionId
|
Premium
|
Comm %
|
Commission
|
Rwd %
|
Reward
|
ICM_DEC_20_718256
|
1000000.00
|
10.00
|
100000.00
|
10
|
100000
|
ICM_DEC_20_718256
|
1000000.00
|
7.50
|
75000.00
|
7.5
|
75000
|
ICM_DEC_20_718256
|
1000000.00
|
7.50
|
75000.00
|
5
|
3000
|
ICM_DEC_20_718256
|
1000000.00
|
7.50
|
75000.00
|
2
|
10000
|
I don't want duplicate values in premium, comm % and commission variables.