BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
HeidiDT
Quartz | Level 8

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!

1 ACCEPTED SOLUTION

Accepted Solutions
s_lassen
Meteorite | Level 14

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;

View solution in original post

5 REPLIES 5
HeidiDT
Quartz | Level 8

Sorry, I made 2 glaring errors in this post. I meant SAS/CONNECT in the subject and not &SYSLOCALHOST, but &SYHOSTNAME.

Patrick
Opal | Level 21

@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 

s_lassen
Meteorite | Level 14

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;
HeidiDT
Quartz | Level 8

Thanks so much - I realised that it should be outside of the rsubmit after some more reading 🙂

Patrick
Opal | Level 21

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;  

 

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1793 views
  • 0 likes
  • 3 in conversation