In reply to Leonid Batkhan.

Hello Leo,

Thank you for your prompt response!
I have coded a sample program to pass the value from data step inside a macro variable (filea) . I can see the file name is being passed into the macro, but i m not sure how to get the value inside the macro variable and trim. could you please assist me on this?

%Macro INPS(ipdsn);
data _null_;
filea = "&ipdsn";
%put MACRO: ipdsn -->: &ipdsn;
%put MACRO: ipdsn -->: filea;
newHostDSN = trim(filea);
run;
%Mend;
data _null_;
files = 'AAAAAAAAAAAAAA,BBBBBBBBBBBBBB';
f_count = countw(files);
do i=1 to f_count;
file = scan(files, i, ',');
put 'DATA STEP: ipdsn -->: ' file;
CALL EXECUTE (cats( '%INPS(', file, ');' ));
end;
run;

Output:

DATA STEP: ipdsn -->: AAAAAAAAAAAAAA
MACRO: ipdsn -->: AAAAAAAAAAAAAA
MACRO: ipdsn -->: filea
DATA STEP: ipdsn -->: BBBBBBBBBBBBBB
MACRO: ipdsn -->: BBBBBBBBBBBBBB