BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JohnWeyk
Fluorite | Level 6

*How do I recover a file?

 

I am learning SAS using University SAS Studio and I came across the following problem. The eu_occ table that is part of the PG1 library of the Essentials 1 course is only showing the Country and Geo columns:

 

*Run pg1.eu_occ;
data pg1.eu_occ2;
	set pg1.eu_occ;
run;

Using statements suggested by Roger Dean:

*Statements by Roger Dean;
data WORK.EU_OCC;
   infile datalines dsd truncover;
   input Geo:$2. Country:$40.;
   label Geo="Country Code" Country="Reporting Country";
 datalines;
 AT Austria
 AT Austria
 AT Austria
 AT Austria
 AT Austria
 ;;;;

 NOTE: There were 5 observations read from the data set PG1.EU_OCC.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 250        
 251        OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 263        

 

How can I recover the original file? It is necessary for other stages of the course.
I have tried to create a new library, called PG2 but it just makes a copy of PG1.

 

Capturar.PNG

 

Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Go back to the original setup code and run it again - but consider putting it in a different folder. Then replace the one file you want.

If you're on Windows you can try the Previous Versions trick via File Properties in Windows Explorer if you have it turned on.

View solution in original post

5 REPLIES 5
Reeza
Super User
Go back to the original setup code and run it again - but consider putting it in a different folder. Then replace the one file you want.

If you're on Windows you can try the Previous Versions trick via File Properties in Windows Explorer if you have it turned on.
JohnWeyk
Fluorite | Level 6

Thank you very much, I managed to recover the original file using Windows.

ed_sas_member
Meteorite | Level 14

Hi @JohnWeyk 

 

In addition to @Reeza 's answer, you can put access=readonly in the libname statement to avoid this kind of issue.

libname pg1 "&path./data" access=readonly;

 

JohnWeyk
Fluorite | Level 6

Thanks for the tip.

Reeza
Super User

@ed_sas_member wrote:

Hi @JohnWeyk 

 

In addition to @Reeza 's answer, you can put access=readonly in the libname statement to avoid this kind of issue.

libname pg1 "&path./data" access=readonly;

 


I think the course requires you to write to that library periodically though?

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1476 views
  • 2 likes
  • 3 in conversation