Help using Base SAS procedures

Regarding forgot Dataset

Regular Contributor
Posts: 229

Regarding forgot Dataset

HI i am having 4 libraries yesterday i have created two datasets and i forgot what are the names and in which libraries i have stored them .I have created only two datasets yesterday. This is a FAQ any one help me out
Posts: 8,743

Re: Regarding forgot Dataset

If you created the SAS datasets in a permanent library (on disk) and NOT in the WORK library, then you should be able to search on Windows and/or UNIX for operating system files with the file extension "sas7bdat". For example, if, in Windows, this libname statement was issued :

libname perm 'c:\temp';

and a SAS dataset called PERM.WOMBAT was created (where PERM is the library reference and WOMBAT is the SAS dataset name), then a search on the C: drive should find the operating system file:[pre]

So, if you search for *.sas7bdat on your entire drive, you should find files with a creation date of yesterday, assuming that you created permanent SAS datasets yesterday.

However, if you created WORK.WOMBAT as the SAS dataset, then when you ended your SAS (or EG) session, the WORK library was cleaned up and all the temporary datasets would have been deleted. Note that a one level name used when creating a SAS dataset such as the one level name for newclass below:
proc sort data=sashelp.class out=newclass;
by age name;

-- has the effect of creating WORK.NEWCLASS as a temporary data set. If this was the case, then you would have to recreate or retrieve the program code that you ran yesterday in order to recreate the datasets.
Posts: 0

Re: Regarding forgot Dataset

Hi John,
To resolve your query,first of all you get the date of creation for all datasets present all libraries by using the below mentioned syntax.

proc sql ;
create table dsn1 as select libname,memname,crdate from dictionary.tables;

Then you create a dataset,it should contain only the datasets which are created on yesterday by using a WHERE CLAUSE.

data dsn2;
set dsn1;
if newvar='yesterday date'; * (eg:29DEC2008)*

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation