BookmarkSubscribeRSS Feed
SunilJ
Fluorite | Level 6

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

12 REPLIES 12
Reeza
Super User

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.

SunilJ
Fluorite | Level 6

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

ballardw
Super User

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.

SunilJ
Fluorite | Level 6

Hi Ballarws,

I am using windows OS.

Regards,

Sunil

ballardw
Super User

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.

SunilJ
Fluorite | Level 6

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

Reeza
Super User

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

SunilJ
Fluorite | Level 6

Hi Reeza,

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

Thanks,

Sunil

Reeza
Super User

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.

Reeza
Super User

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.

SunilJ
Fluorite | Level 6

Files are created through SAS DI

Reeza
Super User

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 12 replies
  • 1060 views
  • 0 likes
  • 3 in conversation