In reply to pratheep.

Hi Pratheep,
1) Do not use %PUT within your macro since it is in a data step, use just PUT statement:

put "MACRO: ipdsn -->: &ipdsn"; /* double quote here to resolve macro variable reference &ipdsn */
put 'MACRO: ipdsn -->:' filea;
put 'MACRO: newHostDSN -->:' newHostDSN;

2) You can trim a value within CALL EXECUTE when you pass parameter to your macro:

CALL EXECUTE (cats( '%INPS(', trim(file), ');' ));

3) In the future, when you need help with your coding problems, please post your questions at SAS Communities - https://communities.sas.com/ .

Hope this helps.