The PLT Scheme macro system attaches location information to syntax, which you can manipulate using macros. If your macro-fu is not strong, there are some libraries that will help you out. To simply get the source directory and file name you can use procedures in the etc.ss collection in MzLib?:
Notice that this-expression-file-name is #f in the example above. This is because I haven't saved the code to file. If I do so the output changes as we'd expect:
(display (this-expression-file-name)) ; display foo.ss, the file I saved the code in