Desktop productivity for business analysts and programmers

remote libname statement

Accepted Solution Solved
Reply
Super Contributor
Super Contributor
Posts: 419
Accepted Solution

remote libname statement

Hello,

 

my goal is kick off sas (9.4 on linux) eg job from server-A and remote submit code on server-B (so job will be running here on server-B) and get results back on Server-A.

 

I am not sure how to define libname statement to achieve it,

 

I am trying with below statement which doesn't seems working,

 

libname remote "serverA.com:\test"

 

please help...


Accepted Solutions
Solution
‎11-10-2017 03:29 PM
Super User
Super User
Posts: 8,279

Re: remote libname statement

[ Edited ]

woo wrote:

Thanks Tom and Mbuchecker.

 

Anyway to NOT generate default html output when getting data back on server-A, I can use just SAS dataset. generating html takes lot of time.

 

* back on serverA;
proc print data=localds;
run;

 

 


Why is the code you want to submitted to a remote server generating ANY output? 

You could include try using ODS _ALL_ CLOSE in the rsubmit block to turn off all output destinations, but it would probably be better to only run code that doesn't generate any output to begin wiht.

 

Or is that your whole point and your use of LIBNAME in the original question just causing confusion?

 

You can use PROC DOWNOAD to move files in addition to datasets.  So if you generated HTML in the remote session to a file named serverb.html you could run PROC DOWNLOAD at the end of the remote code to copy that to a file on the local session.  

 

Or just use a shared disk that all sessions can wrtie/read.

 

View solution in original post


All Replies
Contributor
Posts: 67

Re: remote libname statement

Could you clarify a little? Where is the data you want your libname statement pointing to? Is it on server A or Server B? Also, is Server A your 9.4 Linux machine, or is Server A your EG session?
Michelle
Super Contributor
Super Contributor
Posts: 419

Re: remote libname statement

Posted in reply to mbuchecker

thanks.

 

both servers has sas 9.4 installed on Linux.

 

here is the case,

 

- running sas eg job from server-A

         - this job has remote submit code which is asking sas to run job on server- B - which is happening fine

         - sas job runs without error

         - since sas job executing on server - B - output is happening there

- I want output on server- A

 

hope that make sense.

Contributor
Posts: 67

Re: remote libname statement

There are multiple options. PROC DOWNLOAD would probably be the easiest though.
Michelle Buchecker
Michelle
Super User
Super User
Posts: 8,279

Re: remote libname statement

What do you mean by "output"? I will assume because you mentioned libname that you mean datasets.

You could just download them.

* running sas eg job from server-A ;
rsubmit serverB ;
* running job on serverB ;
data remoteds;
  ....
run;
proc download data=remoteds out=localds status=n; run;
endrsubmit;
* back on serverA;
proc print data=localds; 
run;

You can also look into the INHERITLIB= option on the RSUBMIT/SIGNON commands.

libname local 'path1';
rsubmit serverb INHERITLIB=(local) ;
data local.want ;
 ....
run;
endrsubmit;
proc print data=local.want;
run;
Super Contributor
Super Contributor
Posts: 419

Re: remote libname statement

Thanks Tom and Mbuchecker.

 

Anyway to NOT generate default html output when getting data back on server-A, I can use just SAS dataset. generating html takes lot of time.

 

* back on serverA;
proc print data=localds;
run;

 

 

Contributor
Posts: 67

Re: remote libname statement

Try:

ODS HTML CLOSE;

 

to turn off generating HTML 

Michelle
Super Contributor
Super Contributor
Posts: 419

Re: remote libname statement

Posted in reply to mbuchecker

not quite sure where exactly it should goes,

 

I tried before proc print and after but still it is generating html output. - thanks.

 

 

Contributor
Posts: 67

Re: remote libname statement

It should go before the PROC PRINT. Perhaps WAY before the PROC PRINT. My guess is that some report is generating on Server B, and then being shown. Try putting the ODS HTML Close; in your RSUBMIT block.

Michelle
Solution
‎11-10-2017 03:29 PM
Super User
Super User
Posts: 8,279

Re: remote libname statement

[ Edited ]

woo wrote:

Thanks Tom and Mbuchecker.

 

Anyway to NOT generate default html output when getting data back on server-A, I can use just SAS dataset. generating html takes lot of time.

 

* back on serverA;
proc print data=localds;
run;

 

 


Why is the code you want to submitted to a remote server generating ANY output? 

You could include try using ODS _ALL_ CLOSE in the rsubmit block to turn off all output destinations, but it would probably be better to only run code that doesn't generate any output to begin wiht.

 

Or is that your whole point and your use of LIBNAME in the original question just causing confusion?

 

You can use PROC DOWNOAD to move files in addition to datasets.  So if you generated HTML in the remote session to a file named serverb.html you could run PROC DOWNLOAD at the end of the remote code to copy that to a file on the local session.  

 

Or just use a shared disk that all sessions can wrtie/read.

 

Super Contributor
Super Contributor
Posts: 419

Re: remote libname statement

thanks Tom. I used it outside of rsubmit/endrsubmit block and it worked fine.

 

endrsubmit;

 

ODS _ALL_ CLOSE;

 

prod print data....

 

ya, so I was trying to define libname statement to output final datasets to serverB.

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 556 views
  • 5 likes
  • 3 in conversation