When a condition is met, I need to execute a batch program (SAS) on a remote server. OS on both sides is WIN 2003.
I tried RCONSOLE and PSEXEC.
PSEXEC seems to work if run manually, outside of datastage but when running from within datastage it is rather erratic. Sometimes it runs and sometimes not and I get the message:
"The process tried to write to a nonexistent pipe"
(this I see in the job log).
How do I solve this OR is there another solution (program) that works
for submitting to a remote server a command line command (with username and password as parms).
Thanks!
Command line processing on remote server
Moderators: chulett, rschirm, roy
Hi And Welcome aboard
.
How are you running this command line? (there are 3 ways at least that pops to my mind, perhaps even more)
Do you have any fire-wall program closing the open pipe?
IHTH,
![Smile :)](./images/smilies/icon_smile.gif)
How are you running this command line? (there are 3 ways at least that pops to my mind, perhaps even more)
Do you have any fire-wall program closing the open pipe?
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Is there any difference between the user the process runs under and the one you'r using when you manualy run it?
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
Yes there is. But, you need to answer Roy's question for that.
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
Minhajuddin,
Thanks for the encouraging answer! I want to test how to use psexec
to run a remote command in another machine. I created a Execute Command stage and the command is:
'D:\Lab\TestPsExec.bat'
It runs a batch file that does the following:
cd D:\Lab
psexec.exe \\remotemachine -d "D:\Lab\TestPsExec2.bat"
EXIT 0
Inside TestPsExec2.bat, it runs simply "echo 0".
Sometimes if I run it through Director, it works. But if I schedule it to run, e.g. 9 a.m, it never stop and the status is always 'Running/Restartable'.
If I run it through Designer, it has the same issue, that is, the status is always in 'Running/Restartable' status.
I am not sure how Execute Command stage interact with PSEXEC.
Thank you very much for further advice!
Rwe
Thanks for the encouraging answer! I want to test how to use psexec
to run a remote command in another machine. I created a Execute Command stage and the command is:
'D:\Lab\TestPsExec.bat'
It runs a batch file that does the following:
cd D:\Lab
psexec.exe \\remotemachine -d "D:\Lab\TestPsExec2.bat"
EXIT 0
Inside TestPsExec2.bat, it runs simply "echo 0".
Sometimes if I run it through Director, it works. But if I schedule it to run, e.g. 9 a.m, it never stop and the status is always 'Running/Restartable'.
If I run it through Designer, it has the same issue, that is, the status is always in 'Running/Restartable' status.
I am not sure how Execute Command stage interact with PSEXEC.
Thank you very much for further advice!
Rwe
OCPOracle
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
It's always better not to use interactive processes when you test something using scripts in datastage. There might not be a problem at all with your script.
I am not a pro at psexec (Just downloaded, and checked it). A few observations:
1) Is your D:\Lab\TestPsExec2.bat on the remote server?
2)
3) I don't see the login credentials being passed in the command.
4) Finally, if nothing of this works, check the user through which this script is being run in datastage director log.
I am not a pro at psexec (Just downloaded, and checked it). A few observations:
1) Is your D:\Lab\TestPsExec2.bat on the remote server?
2)
Instead of doing an echo. Try to test it using a command which is non-interactive (e.g. touch D:\Touched_by_psexec.txt). This will give you something definite to go and check on the remote server.Inside TestPsExec2.bat, it runs simply "echo 0".
3) I don't see the login credentials being passed in the command.
4) Finally, if nothing of this works, check the user through which this script is being run in datastage director log.
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
>1) Is your D:\Lab\TestPsExec2.bat on the remote server?
Yes
> 2)
Agree.
> 3) I don't see the login credentials being passed in the command.
This is the reason.
Thanks for the great help!
Yes
> 2)
> Instead of doing an echo. Try to test it using a command which is non-> interactive (e.g. touch D:\Touched_by_psexec.txt). This will give you > something definite to go and check on the remote server.Inside TestPsExec2.bat, it runs simply "echo 0".
Agree.
> 3) I don't see the login credentials being passed in the command.
This is the reason.
Thanks for the great help!
OCPOracle