Hello everyone,
I am combining a series of files using merges. One of the fields (first_prin_bal) gets lost halfway thru the merges. Any input will be greatly appreciated.
Thank you!
Here is my code:
(first_prin_bal is in the dataset hafc_input2)
data wk_rpt1;
merge wk_rpt (in=a) hafc_input2 (in=b);
by loan_no;
if a;
run;
(* now i select 3 loan_nos and print their first_prin_bal *)
select loan_no, first_prin_bal
from wk_rpt1
where loan_no in ('0010136695', '0012754990', '0015171150');
run;
First_Prin_
loan_no Bal
------------------------
0010136695 73607.66
0012754990 62552.84
0015171150 98799.29
data hafc_mail_wf_nov30;
merge hafc_mail_temp(in=a) wk_rpt1 (in=b) cont_hist1(in=c) ;
by loan_no;
if b;
if in_h_wf = 1 or in_map_wf = 1 then workflow = 'Y';
else workflow = 'N';
run;
( now if i try to print the first_prin_bal for the same 3 loan_nos they aren't there anymore )
proc sql;
select loan_no, first_prin_bal
from hafc_mail_wf_nov30
where loan_no in ('0010136695', '0012754990', '0015171150');
run;
loan_no First_Prin_Bal
---------------------------------
0010136695 .
0012754990 .
0015171150 .
I think its obvious they got lost in the second merge. Is it because i have 'if in b'? How do i keep this field in the output?
Thank you!