OK, I see the problem. FileBaseName() only works in a load statement loading from a file (qvd, txt, xls etc) and does not work from a resident load or a database load. You are using it in a resident load and it will not work because it gets the base file name of the file being loaded.
Your best bet is to move the FileBaseName() to the TempFolder load. You can then fetch the basename from the temp folder in the second load