BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rakshit_shah
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

View solution in original post

9 REPLIES 9
Hima
Obsidian | Level 7

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

rakshit_shah
Calcite | Level 5

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.


Hima
Obsidian | Level 7

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.

ChrisHemedinger
Community Manager

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

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
rakshit_shah
Calcite | Level 5

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

Carlos_S
Calcite | Level 5

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.

bentleyj
Calcite | Level 5

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...

TimB_SAS
SAS Employee

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.

rakshit_shah
Calcite | Level 5

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..

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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