How to save log in an external file
Use PROC PRINTTO
proc printto log="C:\Users\Deepanshu\Downloads\LOG2.txt" new;
run;