SAS DataSet

Reply
Occasional Contributor
Posts: 15

SAS DataSet

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

Super User
Posts: 17,808

Re: SAS DataSet

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.

Occasional Contributor
Posts: 15

Re: SAS DataSet

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

Super User
Posts: 10,494

Re: SAS DataSet

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.

Occasional Contributor
Posts: 15

Re: SAS DataSet

Hi Ballarws,

I am using windows OS.

Regards,

Sunil

Super User
Posts: 10,494

Re: SAS DataSet

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.

Occasional Contributor
Posts: 15

Re: SAS DataSet

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

Super User
Posts: 17,808

Re: SAS DataSet

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

Occasional Contributor
Posts: 15

Re: SAS DataSet

Hi Reeza,

But all sas code are on servers. Will this search find the file on server as well.

Thanks,

Sunil

Super User
Posts: 17,808

Re: SAS DataSet

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.

Super User
Posts: 17,808

Re: SAS DataSet

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.

Occasional Contributor
Posts: 15

Re: SAS DataSet

Files are created through SAS DI

Super User
Posts: 17,808

Re: SAS DataSet

Well that was like pulling teeth.

Try asking whomever runs the jobs or look for documentation or try searching the metadata:

SAS(R) Data Integration Studio 4.3: User's Guide

Ask a Question
Discussion stats
  • 12 replies
  • 344 views
  • 0 likes
  • 3 in conversation