Desktop productivity for business analysts and programmers

Running x command for different server

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Running x command for different server

Hello ...

     We are running one code from SAS EG 4.3. The following is the x command we are running from the code.

         x "cd /sasconf/sasconf/data/dbscripts";

         x "./adddata.sh -t KriObservations > logfile.txt";   

Our problem is that the above location is on some other server (10.0.29.88). SAS server is on 10.0.29.89. So how can we run this script from the x command?? I tried ssh command within x command before above two lines to connect to that server (10.0.29.88), but still it is not working and goes to 10.0.29.89 and search the location.

Note that sas server in AIX server.

Regards,

Rakshit


Accepted Solutions
Solution
‎04-03-2012 01:43 PM
Community Manager
Posts: 2,882

Running x command for different server

If you want this shell script to execute on a completely different box, I think you will have to bundle all of your commands in a single shell script, where the first command "remote-shells" to the desired node.  So that your X statement runs just one logical command, but that in turn is a script with the sequence of commands that you need.

Chris

View solution in original post


All Replies
Regular Contributor
Posts: 233

Running x command for different server

How do you normally connect to SAS Server? Can you try connecting to the other server in a similar fashion? Is that a possibility?

Occasional Contributor
Posts: 9

Re: Running x command for different server

Hima : Thanks for reply...

     Normally it will always connect to SAS Application server, which is on 10.029.89..So when i am running code through EG it always searches to the location

/sasconf/sasconf/data/dbscripts    on 10.0.29.89.

when i run the following statement :

  x "cd /sasconf/sasconf/data/dbscripts";.

---------------------------------------------------------------------------------------

The requirement is that i want to search it on 10.0.29.88.

In simple terms i want to go to the location :

/sasconf/sasconf/data/dbscripts 

on  server 10.0.29.88.

Because the script file adddata.sh is located on 10.0.29.88 server, and i cant run it on 10.0.29.89.


Regular Contributor
Posts: 233

Re: Running x command for different server

I totally understand what you are saying but my question is will you be able to connect to the server 10.0.29.88. using Enterprise Guide just like you connected to SAS Application Server 10.0.29.89. Check if this a possibility with the SAS Admin. Then remote submit the code on the server 10.0.29.88 but not on 10.0.29.89. where the files can be found.

Let me see if there are any other opportunities in this case but I normally connect to the server where I have the code and remote submits on that server.

Solution
‎04-03-2012 01:43 PM
Community Manager
Posts: 2,882

Running x command for different server

If you want this shell script to execute on a completely different box, I think you will have to bundle all of your commands in a single shell script, where the first command "remote-shells" to the desired node.  So that your X statement runs just one logical command, but that in turn is a script with the sequence of commands that you need.

Chris

Occasional Contributor
Posts: 9

Running x command for different server

To Hima and Chris:

Is it possible through r submit statement??

To Chris:

Thanks...i completely got your point. I will try it and let you know if any problems...

Regards,

Rakshit

New Contributor
Posts: 2

Re: Running x command for different server

Hello,

You may try it through r submit statment and joining the two X commands in one:

      x "./sasconf/sasconf/data/dbscripts/adddata.sh -t KriObservations > logfile.txt"; 



Regards,

Carlos S.

Occasional Contributor
Posts: 5

Re: Running x command for different server

I don't know what the adddata.sh does but my paper "Using SAS to Move Data Between Servers" might be useful.  It was presented at SGF 2011 and speaks about connecting servers in a client-server configuration and using SAS on the client to run SAS on the server.  http://support.sas.com/dsearch?qt=bentley&style=sup&col=+&qp=url%3A%2Fresources%2Fpapers%2Fproceedin...

SAS Employee
Posts: 25

Re: Running x command for different server

You should be able to do this with ssh between the two systems.  Note that you'd need to have the SSH keys in place to handle authenticaction, as there is no other available mechanism.

That is, if you can submit the ssh command to execute the remote script from the "local" system and have it correctly execute without being prompted for credentials, then you should be able to use the same command in an X statement from wthin your SAS session.

Occasional Contributor
Posts: 9

Re: Running x command for different server

Yes...we have done that one only. However it was really great exercise to enable SSH passwordless login.

Funny part was that  with the help of admin we came to know that the script was updating on the same database server wether we run it from 10.0.29.89 or 10.0.29.88....the problem was that the the entry for 10.0.29.89 was not there in host file, so script was giving errors....We added it into the Host file...so now we are able to run it on 10.0.29.89 also.....(after enabling SSH).

Anyways thanks..this might be very much helpful in future..

🔒 This topic is solved and locked.

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

Discussion stats
  • 9 replies
  • 929 views
  • 9 likes
  • 6 in conversation