What I want to do is, for each entry in the dataset I want to get the dataset name
In the above example, for first entry C:\MySAS\MyData\Folder1\unit1.sas7bdat
I want to get "unit1.sas7bdat" string extracted.
I tried to use the index function..INDEX(file,'\');
but don't know how to use it recursively to get till the last slash. After getting the index of last '\' I thouguht I can use substring to get the part of string from that index onwards.
[BTW, is there any function that returns the index of last occurence of a character in string..like in Java there lastindexof(String,character)]
In a possibly completely warped approach if all of the files are 1) SAS data sets and 2) in the same folder I would be tempted to assign a library name to the folder and then use the SAS dictionary.members table to get the names.