100 pts.
 Run Remote Job
Greetings from New Jersey, USA. I hope you can help me find a way to run a job on a UNIX server from the AS/400. The situation is that Job A runs on the AS/400 and after it completes, a Job B has to run on the UNIX machine. At present we have an employee on the late shift who monitors Job A on the AS/400 and on it?s completion, signs on to the UNIX server, cuts the command from a WORD document and pastes it on the UNIX command line. The same command is run every night without any variation. I want to automatically run Job B on the UNIX machine as soon as Job A on the AS/400 completes. Thanks for your advice. Ash

Software/Hardware used:
ASKED: June 14, 2006  12:03 PM
UPDATED: June 20, 2006  5:22 AM
  Help
 Approved Answer - Chosen by TomLiotta

You can try to use the RUNRMTCMD in your Job A program.

Example:
RUNRMTCMD CMD('/as400dir/scripts/bjk1.csh') +
RMTLOCNAME(UNIXNAME *IP) +
RMTUSER('USERNAME') RMTPWD('PASSWORD')

User name and password are case sensitive so you have to use quotes.
Make sure that the user is set up on the Unix side.

Hope this helps!

ANSWERED:  Jun 15, 2006  8:28 AM (GMT)  by TomLiotta

 
Other Answers:

I’m not sure if it will help you or not, but, the AS400 has a telnet CL command. It’s likely you could add a call to the end of your first job to a program that would telnet in to the unix box, and type the necessary commands, and then disconnect.

Last Wiki Answer Submitted:  June 14, 2006  1:16 pm  by  MODMOD   0 pts.
Latest Answer Wiki Contributors:  MODMOD   0 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Rather than telnet, wich I thnik is designed only as an interactive process, i suggest FTP, which can be used in batch at the end of you process to submit commands on you UNIX system.

Rgs

 0 pts.

 

Sounds like your shop should have a scheduling package. Check with the vendor of that package. Many have reactive jobs and know how to send commands to other platforms. If you don’t have a scheduling package…check them out. Almost all of them will automate enough you can rest easy at night knowing the jobs are running.


 

Sounds like your shop should have a scheduling package. Check with the vendor of that package. Many have reactive jobs and know how to send commands to other platforms. If you don’t have a scheduling package…check them out. Almost all of them will automate enough you can rest easy at night knowing the jobs are running.


 

Hi ashnirody,

As MODMOD suggested, you can accomplish the task with telnet/rsh client; however novadays odds are high your Unix server is running ssh server instead of telnet/rsh server… better get ssh client for AS/400, you can run any command on the remote side specifying it on the ssh command line.

BR

Petko

 3,120 pts.

 

The RUNRMTCMD option will work if you have rexecd running on the Unix box.

Other yet unmentioned techniques include:

Set up a web server with cgi on unix and get/post to it from as400 using a utility like geturi.

mount from the as400 to a nfs volume, place a file when the as400 task ends, and a simple cron job can monitor for the file existence.

mount from unix to as400, place a file when the as400 task ends, and a simple cron job can monitor for the file existence.

If the unix hosts a database, then you can insert to it via jdbc from the as400 and start a trigger or a stored procedure.

Cheers,
ShalomC

 25 pts.