Originally posted by: TarunB
That's some rule you have there. If you know that you have a date in the filename, as in FileName04252010, then just use:-
SUBSTITUTE (RIGHT (SUBSTITUTE (GETFILENAME (input), GETDIRECTORY(input), ""), 8), "")
To account for the fact that the date is optional, build upon the rule above as follows:-
IF (ISNUMBER (RIGHT (SUBSTITUTE (GETFILENAME (input), GETDIRECTORY(input), ""), 8) ),
SUBSTITUTE (RIGHT (SUBSTITUTE (GETFILENAME (input), GETDIRECTORY(input), ""), 8), ""),
SUBSTITUTE (GETFILENAME (input), GETDIRECTORY(input), "") )
ISNUMBER is not a check for a date as such, so it's usefulness here depends on the format of your filename. Also due to the recurrent use of SUBSTITUTE (GETFILENAME (input), GETDIRECTORY(input) , you would be advised to put store the result in a previous cell and use it from there, so that it is only calculated once.
#IBMSterlingTransformationExtender#DataExchange#IBM-Websphere-Transformation-Extender