Ashwini, Modifying the above code gives a complete proc sql solution. data test; informat agreementdate datetime18.; format agreementdate datetime18.; input Agreementno $ serialno $ agreementdate amount interest; cards; ab10005 7456q9 10jan2012:00:00:00 150000 700 cd20006 6783q8 15feb2012:00:00:00 700000 . bv40007 7672q5 07mar2011:00:00:00 80000 . gu80005 7637q8 09mar2010:00:00:00 90000 300 ; run; proc sql; create table want as select agreementno, '' as col1, '' as col2, '' as col4, serialno, '' as col5, 'dh' as col6, agreementdate, cats(agreementno,substr(serialno,5,2),substr(put(datepart(agreementdate),date9.),1,2),amount) as recieptno, amount, case when interest = . then 400 when interest > 700 then 300 else interest end as interest from test; quit; proc print;run; HTH, Rich
... View more