BookmarkSubscribeRSS Feed
sudharsanan
Calcite | Level 5

Hi,

Is there is any way to get the name of the server which is already signed on in SAS/Base?

is the details like this about signed on server is stored in any SASHELP dataset or macro variables?

Thanks in advance!

-Sudharsanan

4 REPLIES 4
jakarman
Barite | Level 11

Please explain what you are really looking for. This is looking a duplicate of: https://communities.sas.com/thread/58003

Eguide SP Base all have some information. But If your goal is logging then there logging chapters   

---->-- ja karman --<-----
sudharsanan
Calcite | Level 5

@Jaap Karman Thanks for your reply. The mentioned thread is created by me.

I want to copy a table from work library of remote server to local PC SAS library for processing with it.

But constrain is I won't be knowing the name of the server which user has remote signed on.

So I could not create library reference to the remote server. As the syntax of such libname statement requires servername as below.

 

libname rwork server=&servname slibref=work;

I could not use proc download as its very slow and also pops up a downloading dialog window while running it.

So it would be better if I get the server name somehow for using in the libname statement to create library reference.

Hope I have clearly explained.Smiley Happy

Thanks!

-Sudharsanan

Amir
PROC Star

Hi,

Is the following of any help?

SAS(R) 9.4 Macro Language: Reference

Regards,

Amir.

jakarman
Barite | Level 11

sudharsanam, That explains a lot.  

The servername you are referring is not one like the hostname of the machine it is a logical SAS name the user has to give when doing the connection.

It has the same naming conventions as the libname statement.


With async processing you can have a lot them all running at the same moment. Could become as stressing situation for one taking care of the server.

In that case it would make much sense to have you sas-admin a global defined table in the sasautos / autoexec.

As long you are working with the last connected session you have sas macro-variable containing that session name.

It is easy to find with %put _all_ ;  (do not remember the exact name could be comething like remoteid)
It is the same approach as some connect statements not needing the servername as long it is the last session.

As you are telling proc download is slow, you have more troubles to solve as that one should be fast. It can only be slow by bad network or not optimized SAS settings (small buffers being resized). The remote libname is easy to show the remote structure, to combine some data. The datatransfer rate is the same or lower as proc download.   

---->-- ja karman --<-----

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1564 views
  • 0 likes
  • 3 in conversation