DSExecute

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
GABRIEL
Participant
Posts: 1
Joined: Mon Nov 03, 2003 9:28 am

DSExecute

Post by GABRIEL »

With DataStage on a NT server.
I use the DSExecute command.
To run a shell script on a UNIX server.

DSExecute Command = rsh hpserv -l user test

shell script test = echo "end"

In the return of the command DSExecute
Output="Terminel handle"

I do not obtain the message return from test script " End "


Thanks
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Post by Amos.Rosmarin »

Hi,

Can you run your command from a cmd window ? if so, there should be no problem doing the same from DSExecute.... it worked for me.

To run RSH you must do some things in the unix like have an entry in the .hosts etc....


Amos
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

You have to first test that the command works. I recommend wrapping it all in a single script local to the DataStage server. Avoid as much command line full syntax execution as possible, because you will have difficulty passing strings with quotes from DataStage to the command line.

Run the command line shell script that does the rsh logic. You must keep in mind that your telnet session has to happen from the DataStage server, as well as be done under the logic of the userid from which the job executes.

Once you have this working, the last piece in the puzzle will be the environment issues that separate a command line execution from a DataStage issuing the command line execution.

Good luck!
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

To be more helpful, we would need to see the exact syntax of your call to DSExecute, along with prior statements that assign values to any variables used within the call, and subsequent statements that access values returned by subroutine arguments.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mfortuna
Participant
Posts: 11
Joined: Mon Nov 03, 2003 12:38 pm
Location: Tampa, FL
Contact:

Post by mfortuna »

you will also need a Call before the DSExecute.

I typically use the same invocation of DSExecute all the time:
First, test your command in unix. Then in your routine, paste the following lines for your invocation, with your tested command in the quotes (use escape chars for embedded quotes):


cmd = "rsh hpserv -l user test"
Call DSExecute("UNIX", cmd, output, systemreturncode)

ErrorCode = systemreturncode ;* optional to return value
Michael Fortuna
Solutions Architect
mobile: 781.316-5718
mailto: michaelfortuna696@hotmail.com
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Try:

cmd = 'rsh "hpserv -l user test" '

Kim.
Mamu Kim
mfortuna
Participant
Posts: 11
Joined: Mon Nov 03, 2003 12:38 pm
Location: Tampa, FL
Contact:

Post by mfortuna »

on Solaris the rsh syntax is:

rsh -l user hpserv test

I think it is the same on HP. It will error out if you put the user param after the host.
Michael Fortuna
Solutions Architect
mobile: 781.316-5718
mailto: michaelfortuna696@hotmail.com
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Post by Amos.Rosmarin »

Your datastage server is running on a WINDOWS NT system so your DSExecute command should look like this:


cmd = "rsh hpserv -l user test"
Call DSExecute("NT", cmd, output, systemreturncode)

RSH (in this case) is a windows command.


Amos
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
After all the replies from all the nice people,
a reply to your question :!:
the command you run is rsh there for the only thing you will get is the output and return code of the rsh command itself and nothing from the scripts/commands or whar ever rsh runs.

If you need to get info on them try to transfer the things you want into files (simple redirection might not be so simple) once you have the data you need in files simply check them after rsh finishes.


IHTH (I Hope This Helps)
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
Post Reply