Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

index function inside macro

Status
Not open for further replies.

evaaseow

Programmer
Jan 25, 2007
29
CA
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top