10-03-2016 12:56 PM
I have one doubt that suppose I am working in work library.
session is not ended yet. So, wanted to know that is there any process which let me know for dataset a which code was run ??
10-03-2016 01:10 PM
The answer depends on your SAS environment:
In SAS Studio you can just go to CODE window;
In regular SAS status is displayed on top of program ediror window;
in any SAS O/L environment you can look at the LOG window.
In unix environment you can run on xterm the ps -ef | grep sasexe command.
I don't think you can answer a question as: which process created work.a table, except
if you can recall last code submitted until 1st time you find a step creating data a;
10-03-2016 04:25 PM
If you have saved the program file bebore running then code similar to this:
data work.junk (label=%sysget(SAS_EXECFILENAME)); set sashelp.class; run;
will put the name of the running program file in the data set label. Which can be viewed in the SAS Explorer data set properties or seen in the description column of explorer.
But nothing much retroactively.
10-04-2016 10:28 AM
Hi, Thanks for your reply.
As this approach can help you in the current session.
I just want to know suppose I have created permanent dataset in a library say a.
then after I close the sas session. I want to get a previous log or any other info which tell me which code was submitted to create a dataset a ?
Thanks in Advance.
10-04-2016 01:26 PM
The code I showed above sets the data set label (or description) if you prefer. It will stay with that value until you change it.
There is nothing in SAS I am familiar with that will retroactively do what you you want unless, possibly, you implement a source code management system and reference that for which programs create data sets.
Or use an operating system search tool to look in program files that may reference the data set.
10-04-2016 01:36 PM
I can think of few ways to save traces of work:
1) you can save the log files, of each run, under name containing a timestamp (date and time) in a dedicated directory
2) you can save a dataset and append a record for each run with any desired information
3) as said before, you can enter upto 240 characters into the dataset label as text, in any format you decide.
You may think of other solutions depending on your environment.