What is the consequence of using my own autoexec.sas file? - sas

I want to write my own autoexec.sas file, but I don't want to lose any functionality that I might have had from the default autoexec.sas file(s).
When I do a SASHome directory search, I find many files with this name. Do all of these files execute by default after the SAS system initializes? Or just one of the files?
Where do I save my own autoexec.sas file so that the other files still execute, along with my own?
Just starting here. Thank you very much.

You really shouldn't edit the usermods file. When you upgrade versions you'll lose all of your changes. There's actually a specific autoexec file designed just for this purpose -- autoexec_usermods.sas
That's where you'll want to keep your site specific modifications -- this way when you upgrade versions your transition will be relatively seamless.
I think you will want to edit these 3 usermods files:
opt-biserver-Lev1-SASMeta
opt-biserver-Lev1-SASMeta-MetadataServer
opt-biserver-Lev1-SASMeta-WorkspaceServer

The following links from SAS documentation should help answer your question on impact, storage and order of execution of autoexec file :
Customizing Your SAS Session by Using Configuration and Autoexec Files
Files Used by SAS -> SAS Autoexec File

Related

Is there a way to apply SAS EG processes to new files?

I'm taking over a project from a coworker that involves several extensive SAS process flows. I have all the files with all the same names and a copy of the process flows they used. Since the file paths in their processes are direct references to their computer, normally I would just re-import the files with the same output names and run the process from there. In a few cases I would have to recreate a query builder as I'm using a few .sas7bdat files from another project.
However, there are quite a few files involved and I may end up having to pass this to another coworker in a few months, and since I can't get a good look at exactly what the import task is doing I'm concerned I may have some of the variables imported incorrectly. Is there an easy way to just change the file path the import or other task refers to?
Given the updates in comments, there's two possibilities I see.
If the paths you're changing are, or can be, relative to the location of the EGP, then you can right click on the Project->Properties->File References and check "Use paths relative to the project...", which means instead of storing a file in c:\my EGP folder\my code folder\code.sas it would store it as my code folder\code.sas. So then if the whole project moves to another computer (or just any other folder) then it automatically has the right path. This is mostly useful for code or similar things.
Otherwise, you're going to have to convert things to SAS code modules. There you can use macro variables to define the locations of things.

SAS - How to configure sas to use resources from local disk other than local disk C:

Basically when I do sorting or join table in sas, the sas will use resources / space from local disk C: to process the code, but since I only have 100GB left on local disk C:, It will result in error whenever SAS was out of resources.
My question is how to configure / change the setting in SAS to use resources from Local Disk E: instead, since I have larger space there.
I already looking through the forum, but found no similiar question.
Please Help.
Assuming you are talking about desktop SAS, or a server that you administer, you can control where the work and utility folders are stored in a few ways.
The best way is to use the -work and -utilloc options in your sasv9.cfg file. That file can be in a few places, but often the SAS Shortcut you open SAS with specifies it with the -CONFIG option. You can also set the option in that shortcut with -WORK or -UTILLOC command line options. The article How SAS Finds and Processes Configuration Files can help you decide the location of the sasv9.cfg you want to modify; if you are using a personal copy on your own laptop, you may change the one in the Program Files folder, but if not, or if you don 't have administrative rights, you have other places you can place a config file that will override that one.
A paper that discusses a few of these options is one by Peter Eberhardt and Mengting Wang.
One way is to set up a library named user for projects that will be time intensive and this way you get it to be dynamic as needed. When you have a library called user, that becomes the default workspace instead of work. But, you need to clean up that library manually, it won't delete data sets automatically when you're done with it.
libname user '/folders/myfolders/demo';
As #Tom indicates, you can also set an option to use a library that already exists if desired.
options user = myLib;
An advantage of this method over the config file method as it only does it for projects where it's needed, rather than your full system.

Change temporary file directory in SAS

I need to use PROC.SQL statements for my analysis. The problem is, SAS uses C disk in order to create temporary files when I use SQL statements. My datasets are very large and I do not have enough space for that. Could you please explain me how to allocate this temporary file in other place rather than C disk?
You want to change the WORK system option. You can do:
c:\sas\sas.exe -work d:\temp
to use the d:\temp directory.
You can also use the OPTIONS statement within the config file used when starting SAS (thanks Tom):
options work='d:\temp'
See also:
Indiana University answer for SAS on UNIX systems.
SAS 9.2 documentation on system options.
Create a 'user' library instead. When a USER library is in effect, all one level datasets are written to this directory and it's used as the default instead of WORK library.
libname user 'path to other location';
If you want to permanently change sas work location, you can set it in sasv9.cfg. (Default location: C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg). Along with -WORK, you may also want to change the value for -UTILLOC option.
You can even spread a Load across Multiple Volumes of Different Disks. Please read Example 1 mentioned in this link - https://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n1qr5dmzagn9krn1lt1c276963za.htm

Copy files from local PC to SAS server in Enterprise Guide

I need to extract a particular sheet from a .xls file on my local machine and get it as a .sas7bdat files on the SAS server on which I work (or the other way round, that is, import it and then convert).
The problem is that although this can be done using the Import Wizard, I need to do this using the 'Copy Files Add-in' because it needs to be built as a part of an automated process.
When I tried doing this using the copy files add-in, it DID copy the .xls file onto the server according to the log, but the .xls file didn't actually show in the library and could not be referenced either (or maybe I'm just referencing it wrongly).
This has led me to believe that I need to convert it to a .sas7bdat and then import it.
Is there a way to get past this? Please bear in mind that I am talking about an automated process, so the wizard is useless for me (or is it? I'm not sure)
NOTE : I am extremely sorry that I cannot post the log and screenshots here, because I work as an offshore resource for a very large bank and cannot post anything here. I have, however, tried to make my problem as clear as possible. If any further clarifications are needed, please let me know!
I assume you've read There and Back Again which covers this in some detail.
Ultimately, all you're doing is copying the excel file as a file onto the SAS server. You're not importing it into a SAS dataset. You would import it by placing the file (either the remote file after copy files add-in, or the local file) in the workflow as an import step.
For example, if you chose /usr/lib/sasdata/myexcel.xls as the remote copy destination, you then need to include that file in your workflow as an import step (you can drag/drop the file and it will automatically create that step for you, with some wizardry).

Does SQLite3 change databases even if every statement is "SELECT"

we try to deploy our software on Windows 7, and there are several sqlite3 db files around. But, these are all read-only and we execute only "SELECT" statements. However, we have observed that Windows 7 also make virtualization on these files, which means file structure or content is changed. What do you think of it? What changes these files without any INSERT or UPDATE? Thanks in advance.
Do these databases exist in your Program Files folder? If so, you should take a look at e.g. this article on MSDN. Data files shouldn't go in the Program Files folder but in Program Data. Otherwise, if you really positively absolutely have to put the databases in the Program Files folder, make sure you pass SQLite the proper flags to open it in read-only mode by passing SQLITE_OPEN_READONLY (see the manual).