Hi all of my friends, hope all of you are very well. I have one sas file with multiple program and I need the following programs for every of my program written in it.
libname Learn '/folders/myfolders/60864_example/Learning';
libname CharData '/folders/myfolders/Dataset/CharDataset';
libname Learn '/folders/myfolders/60864_example/Learning';
libname CharData '/folders/myfolders/Dataset/CharDataset';
libname Learn '/folders/myfolders/60864_example/Learning';
libname CharData '/folders/myfolders/Dataset/CharDataset';
Then for each program I have to put these two libraries above the program for example
"libname Learn '/folders/myfolders/60864_example/Learning';"
"libname CharData '/folders/myfolders/Dataset/CharDataset';"
"proc print data=Learn.phone obs='5';"
run;
I would like to define these two libraries once at the top of the sas file and it would work for all the program written in that file.
Thank you very much, I am looking forward for your descent answers.
looks like you are using SAS UE. On the top right of the screen there is a menu before the ?
you can edit the autoexec.sas from there
Hi and ghosh, and thank you very much for the reply
what is your idea about this
libname Learn '/folders/myfolders/60864_example/Learning';
options fmtsearch=(learn);
I put these two lines of cose at the first of the sas files and run it once and I think it works for the rest of the programs on the file.
Please tell me your idea ,
Thank you very much
You can write your libname as follows:
libname Learn '~/60864_example/Learning';
This was your code is portable assuming the /60864_example/Learning part of your folder is the same on the other computer
Put these LIBNAME statements into your AUTOEXEC file and then you don't even need them at the top of each program you write.
Hello PageMiller, this is what ghosh suggest me in his first reply. would you please tell me where may I find the Autoexec file? Thank you again PageMiller and ghosh, deeply appreciated of both of you my friends.
looks like you are using SAS UE. On the top right of the screen there is a menu before the ?
you can edit the autoexec.sas from there
In SAS, run this command
%put %sysfunc(getoption(autoexec));
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.