Hi,
I am looking for a table originally created in sas code. I can find out where it is used but not able to find where it is created. Can someone let me know is there any way i can find out where this data set originally created.
Thanks
Sunil
I'm not sure what you mean.
Are you looking for where the SAS dataset is created within a particular program or in general?
I think the only way is to search for the first instance of the dataset name in the programs. The issue is if a macro was used to create it then you won't be able to trace it back using any automated searches.
Hi Reeza,
Actually, I am looking for data set which is created somewhere but dont know how to do backtrack. like where or in which sas code/program it was created. I am sure it was not created by macro.
Regards,
Sunil
Best bet would be one of the operating system search or directory listing tools. Can't be more specific than that without knowing which OS you are using.
Hi Ballarws,
I am using windows OS.
Regards,
Sunil
One way at least in Windows 7, don't know about Windows 8:
Open Windows explorer
Navigate to the root of the drive you think the data may be on
In the search box type the name of the SAS dataset without the library name and with an extension of sas7bdat.
However, if you are looking at code and there is not a library associated with the variable there is a strong likelihood that the dataset was written to a temporary WORK library and would not exist after the session of SAS that created is was closed. If it likely to be in the current WORK library then you can get the path to that by executing:
%put %sysfunc(Pathname(WORK));
and then looking in the log for the folder location of the current work library.
Hi Ballardw,
I am sorry I guess i am not able to frame my question correctly.
Data set has associated library. I am able to see that data set in that library. But looking for SAS code where that data set is created.
Thanks,
Sunil
SAS programs are text files. The windows search can be set up to search for that word in the .sas (SAS Programs) files.
In windows 7 - I want to search for all files containing "A word - Microsoft Community
Hi Reeza,
But all sas code are on servers. Will this search find the file on server as well.
Thanks,
Sunil
No, then you need to search the server and use whatever tools Unix or Windows has there.
In a situation like this its probably easier to ask a colleague or a supervisor for help.
EDIT: or look for documentation that might point you in the right direction.
If the file was created through a SAS DI process or a SQL server you may not be able to do a text search for it.
Files are created through SAS DI
Well that was like pulling teeth.
Try asking whomever runs the jobs or look for documentation or try searching the metadata:
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.