I have a macro that reads a filename and then I wish to use substr and index to grab specific parts of the filename.
%macro test
%let campaign_code = %substr(&filename,1,8);
%let campaign_cycle = %substr(&filename,10,1);
%let month = %substr(&filename,12,3);
%let year = %substr(&filename,16,4);
%let campaign_name = %index(&filename,'.');
%mend test;
everything above works except the index, it keeps returning 0.
filename = h3kd89e_JAN_2007_GOOGLE.txt
What could be wrong?
Thanks
%macro test
%let campaign_code = %substr(&filename,1,8);
%let campaign_cycle = %substr(&filename,10,1);
%let month = %substr(&filename,12,3);
%let year = %substr(&filename,16,4);
%let campaign_name = %index(&filename,'.');
%mend test;
everything above works except the index, it keeps returning 0.
filename = h3kd89e_JAN_2007_GOOGLE.txt
What could be wrong?
Thanks