BookmarkSubscribeRSS Feed
n6
Quartz | Level 8 n6
Quartz | Level 8


I googled this and it has been addressed before but I still don't get it.  This is about autosave.

 

I assumed that if you're working on a program XYZ from folder Q and you have your Tools > Options > Preferences > Edit > Autosave set for every 5 minutes, then it saves your program under the name XYZ in folder Q every 5 minutes.  So it saves it at 2:30 and then again at 2:35 and the most work you could lose is 4 minutes worth, if your computer crashed at 2:34.

 

But apparently that's not so.  Instead it seems it autosaves it in some mysterious place on your computer and even then, only if you use Enhanced Editor (which I don't).  Can it really be that in 2019 the only way to save your program XYZ in the folder Q is to do it manually every single time?  Maybe (Hopefully) I'm wrong.

 

Any info is greatly appreciated.

 

 

20 REPLIES 20
Krueger
Pyrite | Level 9

I've never used this feature but with a very long past of programming and losing TONS of work I began using CTRL+S very frequently. 

n6
Quartz | Level 8 n6
Quartz | Level 8

Yes, I've discovered that (the hard way, like you) but even for that I have to remember and interrupt my train of thought.

Reeza
Super User
Are you using SAS Foundation/Base? Which version?

I'm fairly certain Studio is saving it in the same place and I know they haven't been developing features in SAS Base/Foundation for about a decade now. Studio and EG are more likely to have the features you want.
You can also use any other IDE if so inclined, I'm becoming a fan of the Jupyter Notebooks myself.
n6
Quartz | Level 8 n6
Quartz | Level 8

I'm just using regular SAS. which I assume is Base SAS.  It is Version 9.4 TS Level 1M1.

Reeza
Super User
9.4 M1 is from 2013.
n6
Quartz | Level 8 n6
Quartz | Level 8

Okay, but is that necessarily a bad thing?  I mean, if I was talking about some new thing then I should expected only newer versions of SAS to be up to date on it, but saving a program is a forever thing.

Reeza
Super User
You're using an older interface, that SAS has stopped adding enhancements and features to 10 years ago.
SAS Studio and EG have the features you want, that's my point. I don't necessarily agree with it, I'm just explaining why the feature doesn't likely exist. No one is developing enhancements for SAS Base as they're trying to push users to EG or Studio, and the features you want are in those tools since they're more recent.
ballardw
Super User

@n6 wrote:


I googled this and it has been addressed before but I still don't get it.  This is about autosave.

 

I assumed that if you're working on a program XYZ from folder Q and you have your Tools > Options > Preferences > Edit > Autosave set for every 5 minutes, then it saves your program under the name XYZ in folder Q every 5 minutes.  So it saves it at 2:30 and then again at 2:35 and the most work you could lose is 4 minutes worth, if your computer crashed at 2:34.

 

But apparently that's not so.  Instead it seems it autosaves it in some mysterious place on your computer and even then, only if you use Enhanced Editor (which I don't).  Can it really be that in 2019 the only way to save your program XYZ in the folder Q is to do it manually every single time?  Maybe (Hopefully) I'm wrong.

 

Any info is greatly appreciated.

 

 


For the PROGRAM window you may want to consider actually setting the AUTOSAVELOC option to path you want. May want that in your Autoexec.sas.

 

 

You can find the current setting for the option with:

proc options option=autosaveloc;
run;

If undefined, which I suspect is the default with SAS expecting most users to use the Enhanced Editor that may be why you are having a hard time finding the files.

 

For consistency you might want to point that to

C:\Users\yourusername\AppData\Roaming\SAS\EnhancedEditor

if running on Windows to have all of the autosave go to the same location.

 

n6
Quartz | Level 8 n6
Quartz | Level 8

I've never seen that proc options autosave thing before.  Maybe the thing to do would be to put that line at the top of every program you right, with it pointing to where you want to save it.  I'm going to have to check to see if that really works.

n6
Quartz | Level 8 n6
Quartz | Level 8

 

But how do I make it point to anywhere?  And why would I want it to point to Enhanced Editor?  Shouldn't I just want it to point the location on my computer where I want to save the program?

SASKiwi
PROC Star

@n6  - The Autosave feature is there to act as a backup to the primary way you save your program, controlled by explicit manual saving. Would you try and store your disk backups in the same location as your primary storage?

 

By all means put it in a location more meaningful to you, but it should be in a separate folder to your primary storage.  

n6
Quartz | Level 8 n6
Quartz | Level 8

Okay, so what version of SAS would have I have to get SAS Studio and EG?  I would consider doing it if I knew.  On one hand I don't want to become someone out of touch with new things but OTOH in the past I've sometimes experienced pain going to a newer version of SAS because things that worked perfectly before sometimes suddenly no longer work.

Reeza
Super User
It's not an issue of versions, it's the client you use to interface with SAS. SAS Studio does work with SAS 9.4M versions afaik. You just need to install the appropriate thin clients.
n6
Quartz | Level 8 n6
Quartz | Level 8

Okay, with the help of this post I have figured it out.  If you run the following and then go to the log window...

 

proc options option=autosaveloc;
run;

 ...you just see "AUTOSAVELOC="  IOW, it is not being autosaved.  So you can specify the location for it using the options autosave= command.

 

Supposed your program is located in the folder C:\Project and is named xyz.sas.  Suppose you submit this line

 

options autosave = 'c:\Project\xyz.sas';

 

That tells SAS to autosave your program   The frequency with which it will be autosaved can be specified by doingTest > Options > Prefernces > Edit

 

Having the autosave overwrite it in the same place you're have it might not be desirable.  So what I'm going to (try) to get into the habit of doing is, in any folder in which I have a SAS program I'm going to have a subfolder named Autosave_Pgm.  And when I start writing a program, I'm going to add the a line at the top that will autosave the program to the Autosave_Pgm.  If I get into the habit of doing it when I'm already putting that sort of info at the top of a program (name, purpose, etc) then it will become a habit.

 

What's not clear to me is that whether the option will remain on when I close SAS then open it later.  But I can just start making the first line I run each time I open the program be the options autosave line and that should work

 

So for the above example, I'll run

 

options autosave 'C:\Project\Autosave_Pgm\xyz.sas';

 

each time I open the program.

 

Thanks for the help.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 20 replies
  • 4188 views
  • 7 likes
  • 6 in conversation