I'm an administrator of a sas server that executes sas code that is dynamically generated in a web service outside sas. So there is no way for me to inject sas code that copies files from work to a persistant data location. I still have the need to see what is contained in the temporary files for debugging and analysis. Is there a way to tell sas on a configuration level to keep files in work or copy it to a persistant data location, so that I have access to it after the sas session has ended?
Here is a method that will not depend on what the system admins have done.
Make sure your code is creating/referencing the "work" files using single level names. MYDATA instead of WORK.MYDATA.
Then you can create a USER libref and SAS will automatically use USER.MYDATA instead of WORK.MYDATA for the single level name MYDATA references. Or look into the USER= option to use a different libref for the location where you want the single level names to go.