As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Changing your program to run on Unix

From sasCommunity
Jump to: navigation, search

Thankfully, there are few changes required to have a SAS program running on Unix. All of these relate to the input and output of data.


LIBNAME statement

Change from this format : LIBNAME in "d:\myfolder" ;

where d: refers to the drive where your file is saved, to

LIBNAME in "~/myfolder" ;

For example, your LIBNAME statement on a Windows machine might be:

LIBNAME in "c:\users\annmaria" ;

on Unix it would be

LIBNAME in "~/users/annmaria" ;

NOTE: the ~/ refers to your personal userid, similar to saving something in My Documents on Windows. Often you may want to save your data somewhere else. If you work at a large institution you may have a small amount of space for your home directory but a very large amount of space on a shared project directory. To read or write data using that directory, say it is /home/scf-sam4/ademars you would just write your statement as follows,


LIBNAME in "/home/scf-sam4/ademars" ;


note that there is no ~


ODS

Now that you have the general idea, the changes to the rest of the statements controlling SAS input and output should be fairly obvious. If I want to create an html file in my SAS program, I would change my statement from

ODS HTML FILE = "d:\myfolder\filename.html" ;

to

ODS HTML FILE = "~/myfolder/filename.html" ;