saspy options for logging #534
-
Hi there, I am trying to use a more efficient way to save a sas log to a specific file. I tried doing this by passing in the log file as an option, but it doesn't work. The code runs, but log not saved to a file. I tried in batch mode and not. I ended up using the method I was already aware of, which is running in batch mode and then writing the ['LOG'] to a file. What I am trying to do: What I ended up doing: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Right, you can't redirect the log out from under saspy, it needs the log to function correctly. SASPy stores the SASLOG for the whole session; all the code you run, not just one submit. You can access the log at any point with the sas.saslog() method, which returns the whole log, up to that point. So If you want to write the log to a file when you're done with your session, just do that:
|
Beta Was this translation helpful? Give feedback.
Right, you can't redirect the log out from under saspy, it needs the log to function correctly. SASPy stores the SASLOG for the whole session; all the code you run, not just one submit. You can access the log at any point with the sas.saslog() method, which returns the whole log, up to that point. So If you want to write the log to a file when you're done with your session, just do that: