Help using Base SAS procedures

libname statement

Reply
N/A
Posts: 0

libname statement

Hi all,

I want to create a link to a remote teradata schema in my library explorer window.

I am trying the following code:

rsubmit;
1st statement- libname test teradata user='scott' password='tiger' database=schema_name;
endrsubmit;

2nd statement- libname rwork server=remoteserver slibref=work;
3rd statement- libname tera server = teradata user='scott' password='tiger' slibref = test;

Here TEST library is successfully assigned on the server in the 1st statement.

In the 2nd statement I am trying to link remote WORK to explorer window, which works totally fine.

But the 3rd statement does not work.
Can someone help me with this.

Thanks & Regards,
Saurabh.
Frequent Contributor
Posts: 127

Re: libname statement

Hi,

Have you already tried to execute your first statement without the remote submit statements (rsubmit; and endrsubmitSmiley Wink ?

Just an idea...

Kind regards,
Florent
N/A
Posts: 0

Re: libname statement

Hi Florent,

Thanks for the reply !
Since I will be using the teradata schema tables with the tables already on SAS remote server, so I need to run the first statement with RSUBMIT.

As per, mapping the work directory on the remote server using the 2nd statement works,
but I don't know where is the 3rd statement wrong in terms of the connection.
Please check the log for more info.

ERROR: Attempt to connect to server TERA failed.
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: Cannot find TCP service 'tera'.
ERROR: Error in the LIBNAME statement.


Thanks & Regards,
Saurabh.
Frequent Contributor
Posts: 127

Re: libname statement

Emerald,

You're welcome Smiley Happy

When establishing the connection to your remote server (signon statement), do you define 'teradata' as remote session id (the 'remote=' part of your signon statement)?

Libname statement has the following syntax:
LIBNAME libref <'SAS-data-library'> SERVER=remote-session-id ;

You have to make sure that the 'remote_session_id' that you use in your libname statement is the same that the one defined when establishing the connection to your remote server.

Hope it helps.

Kr,
Florent
N/A
Posts: 0

Re: libname statement

Hi,

For the remote connection, that happens at the time of logon, it connects to the remote SAS server & teradata.
After that when I assign the libname statement to connect to the particular schema on the remote server, that is successfully executed and I can access the tables.
For eg.

rsubmit;
1st statement;
data test;
set tr_schema.tr_tbl_name;
run;
endrsubmit;

This is successful.

Now what I want is, as I can display the Remote work library on the library explorer, using the 2nd statement successfully on the local libraries explorer, I want the same for the teradata library in my project explorer on Local, for which I tried to execute the 3rd statement, but that doesn't work.

I hope the above information helps in understanding the problem.

Thanks,
Saurabh.
Frequent Contributor
Posts: 127

Re: libname statement

Hi,

I understand your problem and I'm pretty sure that the issue that you're facing with your third statement is related to the server name that you're using (following part: server = teradata).

3rd statement: libname tera server = teradata user='scott' password='tiger' slibref = test;


You have to make sure that it corresponds to the server name that you specified when connecting to the remote SAS server (maybe could you provide me with the connection statement(s) after removing the username and password info from it ?).

Here is an example of connection to a remote SAS server (where the part 'remote=SasHost' should be equal to 'remote=teradata' in your case):

%let SasHost = ;
options comamid=TCP remote=SasHost;
signon username= password=;


It's also possible that you only have one statement to connect to your remote SAS server... I'm used to split it in 3 as you can see in the previous example.

Kind regards,
Florent
Ask a Question
Discussion stats
  • 5 replies
  • 785 views
  • 0 likes
  • 2 in conversation