Architecting, installing and maintaining your SAS environment

Connecting to Host from SAS using tcpunix file

Accepted Solution Solved
Reply
Contributor
Posts: 33
Accepted Solution

Connecting to Host from SAS using tcpunix file

Hi,

 

I want to connect to Unix host from SAS using code & tcpunix.scr file. I could able to connect to existing Unix host successfully.

But when i try to connect to a new UNIX host by using same tcpunix file it is giving below error.

 

Do I need to contact Admin for the latest tcpunix.scr file which may be present on the New Unix host to which i am trying to connect from SAS??

 

Code:

%let rmt = xxxxx.xx.xxx.com 1234 ;

 

options comamid=TCP ;
signon remote = rmt  '../root/../../.tcpunixsas.scr' ;
     %syslput run_dte = &run_dte ;
signoff;

Piece of tcpunix.scr file:
   log "NOTE: Script file 'tcpunix.scr' entered.";
   if not tcp then goto notcp;
   if signoff then goto signoff;
   /* --------------- TCP SIGNON ------------------------------------*/
   waitfor 'login:'
         , 'Username:'
         , 'Scripted signon not allowed' : noscript
         , 120 seconds: noinit;
/*----------------UNIX LOGON---------------------------------------*/
/*-- for some reason, it needs a LF to turn the line around      --*/
/*--  after the login name has been typed. (A CR will not do)    --*/
/*-----------------------------------------------------------------*/

/*   input 'Userid?'; */
   type 'xxxxxxxxx' LF;
   waitfor 'Password', 30 seconds : nolog;
/*   input nodisplay 'Password?'; */
     type 'xxxxxxx' LF;   
unx_log:

AND SO ON........

 

ERROR:

 

TRACE:    Echo on;
TRACE:    Log 'NOTE: Script file 'tcpunix.scr' entered.';
NOTE: Script file 'tcpunix.scr' entered.
TRACE:    If not TCP then goto notcp;
TRACE:    If signoff then goto signoff;
TRACE:    Waitfor    'login:',
TRACE:               'Username:',
TRACE:               'Scripted signon not allowed': noscript,
TRACE:               120.0 seconds: noinit;
TRACE: noinit:
TRACE:    Log 'ERROR: Did not understand remote session banner.';
ERROR: Did not understand remote session banner.
TRACE: nolog:
TRACE:    Log 'ERROR: Did not receive userid or password prompt.';
ERROR: Did not receive userid or password prompt.
TRACE:    Abort;
NOTE: End of script file trace.
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: Communication script processing aborted.
ERROR: Remote signon to X1RIO canceled.
ERROR: A link must be established by executing the SIGNON command before you can communicate with X1RIO.
31              %syslput run_dte = &run_dte ;

 

 

Can anyone please help me on this?

Thanks in advance.

 

Regards,

RaviSPR

 


Accepted Solutions
Solution
‎12-23-2016 04:54 AM
Super User
Posts: 3,254

Re: Connecting to Host from SAS using tcpunix file

It would be worth checking with SAS admin to see if the SAS/Connect spawner is running. If so you can avoid using a script file entirely. Most SAS sites don't use SIGNON scripts anymore. It is far more reliable to go scriptless.

View solution in original post


All Replies
Super User
Posts: 7,806

Re: Connecting to Host from SAS using tcpunix file

Use telnet to connect to the server on port 1234 (or the number that you really used). The first message you see that prompts for your UserID is the one that needs to be included in the waitfor statement of the txpunix.scr file. Similar for the password prompt.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎12-23-2016 04:54 AM
Super User
Posts: 3,254

Re: Connecting to Host from SAS using tcpunix file

It would be worth checking with SAS admin to see if the SAS/Connect spawner is running. If so you can avoid using a script file entirely. Most SAS sites don't use SIGNON scripts anymore. It is far more reliable to go scriptless.

Contributor
Posts: 33

Re: Connecting to Host from SAS using tcpunix file

Yes. The SAS/Connect spawner is running i think.
Now I referred one link - https://support.sas.com/training/tutorial/el/libspcnd_rh.pdf

And i tried below code to go with scriptless file.

 

Code:


%let rmt = xxxxx.xx.xxx.com spawner_name ;

options comamid=TCP ;
signon rmt userid='xxxxxx' pw='xxxxxxx';
     %syslput run_dte = &run_dte ;
signoff;

 

1. Is the above code correct to connect to Host without Script file?

2. In the %LET statement, xxxx.xx.xxx is the Unix Host name or Server name?

3. I dont know the SAS/Connect spawner name to mention in the %LET statement.

    Is there any way to get the Spawner name (withithout contacting Admin. Because i have access to most of the root folders on the Servers)??

4. Whatever the USerID mentioned in the Signon statement, must have Access permission to connect to the Host which I mentioned in the %LET statement. I think, this userid does not have access?? And I am sure Admin may not give access to this User ID?

 

Thanks a lot. As I am in the migration project and facing lot of connection issues with the new environment.

 

Regards,

Ravi

 

Super User
Posts: 3,254

Re: Connecting to Host from SAS using tcpunix file

Usually you only need to specify the hostname you are connecting to not the spawner name too: signon hostname username = .xxx password = "yyy". Try without to start with.

Contributor
Posts: 33

Re: Connecting to Host from SAS using tcpunix file

Thanks SASKiwi for quick reply.

 

I triied below codes and got below errors. Is this relating to Firewall issue or somethin else?

 

Code-1:
%let rmt = xxxx.xxx.xxx.com  xxxx;
signon rmt userid='xxxxx' pw='xxxxxx';
     %syslput run_dte = &run_dte ;
signoff;

 

ERROR:

 

23         %let rmt = xxxx.xxx.xxx.com  xxxx;
24         
25         signon rmt userid='xxxxx' pw=XXXXXXXXXXXXX;
NOTE: Remote signon to RMT commencing (SAS Release 9.04.01M3P062415).
ERROR: A communication subsystem partner link setup request failure has occurred.
ERROR: The connection was refused.
ERROR: Remote signon to RMT canceled.
ERROR: Unrecognized option to the %SYSLPUT statement.
26              %syslput run_dte = &run_dte ;
27         signoff;
NOTE: A link to rmt does not exist.  SIGNOFF is not necessary.

 

Code-2:
signon xxxxx.xx.xxx.com userid='xxxx' pw='xxxxxx';
     %syslput run_dte = &run_dte ;
signoff;

 

ERROR:

 

24         signon xxxxx.xx.xxx.com userid='xxxx' pw=XXXXXXXXXXXXX;
ERROR: Invalid fileref or remote session ID, xxxxx.xx.xxx.com.
ERROR: Remote signon to UNKNOWN canceled.
ERROR: Unrecognized option to the %SYSLPUT statement.
25              %syslput run_dte = &run_dte ;
26         signoff;

 

Thank You,

 

Regards,

Ravi

 

Super User
Posts: 3,254

Re: Connecting to Host from SAS using tcpunix file

Yes it could be a firewall rule or it could be you are trying the wrong port. I'm assuming you can PING the host OK. Check with your SAS admin to confirm you are using the right port and with IT network admin regarding firewall rules.

Contributor
Posts: 33

Re: Connecting to Host from SAS using tcpunix file

Thanks a lot SASKiwi. I had a meeting with SAS Admin yesterday and he ran the same code from his end and got the same error.

Then he restarted the Connect spawner. Now it is working fine without .tcpunix.scr file.

 

Than you.

Regards,

Ravi

 

 

Super User
Posts: 3,254

Re: Connecting to Host from SAS using tcpunix file

Fantastic! Great to hear you are successful.

☑ This topic is solved.

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

Discussion stats
  • 8 replies
  • 669 views
  • 3 likes
  • 3 in conversation