I haven't found an elegant solution, but I'm using this code in Enterprise Guide:
*-- start code --;
data _NULL_;
length WORD $8;
do j = 1 to 8;
WORD = byte(int(65 + ranuni(0)*26)) || WORD;
end;
call symput("mylibrary", WORD);
run;
libname &mylibrary 'physical_path_to_library';
*-- end code --;
This assign every time a different random LIBREF to you library.
It works.
Regards
Paolo
Lucy
this seems a very parallel thread.
See my response in the other, at
http://communities.sas.com/message/102072#102072
When (if) this problem occurs in enterprise guide, instead of puting code in the autexec, place your "one-time-code" at the code box in
menu: tools/options/sas programs/"submit code when server is connected"/edit
Are you trying to point the libref to a different location? Or are you just re-running the code that assigned the libref?
If the latter then test first before defining the library. Here is can example command using the IFC and LIBREF functions to conditionally issue the libname statement only when the libref does not already exist.
4 %sysfunc(ifc(%sysfunc(libref(macros)),libname macros '~/temp',));
NOTE: Libref MACROS was successfully assigned as follows:
Engine: V9
Physical Name: /home/abernt/temp
5 %sysfunc(ifc(%sysfunc(libref(macros)),libname macros '~/temp',));
The other thing to consider is changing the SASMSTORE option before trying to modify the libref.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.