Thanks for your response... Due to number of records and fields I don't want to use PROC SQL. I found a way but not sure this efficient way to do this. Anybody have better suggestions? data temp; infile DATALINES dsd missover; input Ins_ID per_id p_no f_id m_id; CARDS; 986789,984731,01,, 986789,984236,02,, 986789,123484,03,984731,984236 986789,435123,04,984731,984236 986789,654234,05,984731,984236 345754,654456,01,, 345754,234864,02,,654456 345754,934512,03,,654456 run; proc sort data= temp; by Ins_ID f_id;run; data f_temp1 (rename=(per_id=f_id p_no=f_no)) m_temp1 (rename=(per_id=m_id p_no=m_no)) ; set temp (where = (f_id = . and m_id = .)); Keep Ins_ID per_id p_no; run; proc sort data= f_temp1; by Ins_ID f_id;run; proc sort data= m_temp1; by Ins_ID m_id;run; data out1; merge temp (in=a) f_temp1 (in=b); by Ins_ID f_id; if a then output; run; data out2; merge out1 (in=a) m_temp1 (in=b); by Ins_ID m_id; if a then output; run;
... View more