Shmuel, 1) In most of your input records height=17, age=45 - are the same. By using MERGE - those rows will output in one MALE record and one FEMALE record. Is this your intention? Yes 2) Data THREE has same variables names like data ONE: alias, city, zipcode that means that by MERGE data will overide and you will get last observation data. Is that what you want? No Does each observation represent one person? yes Sir. Do height, age and gender make it unique equivalent to an ID ? No, but that's all I have to mess with. Thank you for your response. Yes, you are right, I am getting the repeated observations from last observation.I used this code below. How can I have just same number of observations and missing values for other repeating values of the last observation (which I don't want). Is there any other like proc sql gets me what I want. Please advise. Thanks for responding. data one; input height age weight2 gender2$ alias2$ city2$ zipcode2$ store$; cards; 17 45 25 ganges fakenote wilming 584157 walmart ; run; data two; input height age weight1 gender$ date mmddyy10. alias1$ city1$ zipcode1$; cards; 17 45 247.96 male 07/21/2017 john1 richmond 12546 17 45 283.13 female 06/15/2017 cindy1 siouxcit 45104 ; run; data three; input height age weight gender$ alias$ city$ zipcode$; cards; 17 45 45.5 male john richmond 12546 17 45 56.48 male shawn Newyork 40534 17 45 57.78 female cindy siouxcit 45104 17 45 45.21 female crawford chicago 15483 17 45 47.14 male jason brooking 57006 17 45 94.18 female gita villa 58461 17 45 98.84 male johnson volga 15581 17 45 85.96 female smita raymond 48634 ; run; data four; input name$ title$ earning dollar7. date mmddyy10.; cards; Kum&go Manager $65,000 07/29/2017 ; run; proc sort data=three out=three1(rename=(gender=gender1)) ; by height age gender; run; proc sort data=two out=two2; by height age gender; run; data two_concat; merge two2 three1; by height age ; run; proc sort data=two_concat out=two_concat1; by height age; run; data concat; merge one two_concat1; by height age; run;
... View more