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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.