Hi All
I am trying to copy defined macro variables to a remote server session. I have found the code on this forum:
signon linux user="&sasbatchuser" pass="&sasbatchpass";
* Combine Credit ABT tables and download to APP server;
rsubmit;
libname rwork slibref=work server=??;
%SYSLPUT _all_;
I just have no idea what to specify in the server option of the libname statement. I tried using the value of &SYSLOCALHOST (which in my case is uatsasapp03), but got the following error:
1 libname rwork slibref=work server=uatsasapp03;
-----------
23
ERROR: Libref RWORK is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 23-7: Invalid value for the SERVER option.
Please can anyone assist?
Thanks!
It looks like you are trying to allocate your local WORK library as a remote libname on the server. I do not think that is possible. What you can do is to allocate a remote library in your own session, like this (no RSUBMIT):
libname rwork slibref=work server=linux;
Sorry, I made 2 glaring errors in this post. I meant SAS/CONNECT in the subject and not &SYSLOCALHOST, but &SYHOSTNAME.
@HeidiDT wrote:
Sorry, I made 2 glaring errors in this post. I meant SAS/CONNECT in the subject and not &SYSLOCALHOST, but &SYHOSTNAME.
It also feels you're actually not asking about macro variables but about remote libraries.
Have a look at this sample from the docu:
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/connref/p0a9po9um01h3cn1sdhnas5vh5sq.htm
It looks like you are trying to allocate your local WORK library as a remote libname on the server. I do not think that is possible. What you can do is to allocate a remote library in your own session, like this (no RSUBMIT):
libname rwork slibref=work server=linux;
Thanks so much - I realised that it should be outside of the rsubmit after some more reading 🙂
Below working sample code if spawning a 2nd session on the same machine. Not sure if that's also going to work if the remote server is on a different node - but I believe it should.
Just take into consideration that whenever you use a remote library there will be a data transfer process in the background that is going to severely impact performance.
signon sess2 sascmd="!sascmd -nosyntaxcheck -noterminal";
data test;
set sashelp.class;
run;
%syslput local_work=%sysfunc(pathname(work));
rsubmit sess2;
libname lwork "&local_work";
proc print data=lwork.test;
run;
endrsubmit;
signoff sess2;
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.