Focal Point
Use Maintain to execute a job on iSeries

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8551041803

November 20, 2008, 04:52 PM
jwilson
Use Maintain to execute a job on iSeries
Good Afternoon,

I looked around the forum, but couldn't seem to find anything close to what I'm trying to do. Let me give you a little background info about what I'm trying to achieve. We are running JDE World on iSeries/OS400. I'd like to create a nice web interface to insert data in to a DB2 file on the 400. After I'm done writing records to the file I want to issue a command to OS400 to run a job that reads my db2 file to populate all the necessary JDE files. Creating the interface to populate the DB2 file is a piece of cake with maintain, but the kicker is I'd like to have a way to tell OS400 to execute the JDE update program using maintain, so I don't have to use a DB trigger or make this a batch process. With all that being said is there a way via maintain to send commands to OS400?

Thanks in advance!
Jim Wilson


WebFOCUS 7.6.5
Windows Server 2003
November 20, 2008, 06:38 PM
Dave Ayers
Jim,

You can create a focexec and embed the OS commands in it, then EXEC the .fex from within your maintain. you can even pass parameters into the .fex and use &vars to make the commands dynamic, if needed.


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
November 21, 2008, 09:59 AM
jwilson
Thanks for the response Dave. I'm pretty new to this, so if you could briefly explain how this works it would be greatly appreciated. My set up is the WebFOCUS server is running on Windows and my IWay Server is running on OS400. How would I issue a command in a focexec to OS400 when my WebFOCUS server is on an Intel box? I saw an example in another post using ! CALL PGM(library/programname), but I received an error stating PGM is not recognized as an internal or external command, operable program or batch file.

Thanks,
Jim


WebFOCUS 7.6.5
Windows Server 2003
November 21, 2008, 10:33 AM
Dave Ayers
Jim,

In the appropriate place in your maintain program add a line:

Exec Drop oscmdfex

Where oscmdfex(.fex) is the focexec containing the OS400 commands you need to execute, using the proper Focus syntax to route them from Focus to the OS.

The 'Exec' will start a separate agent to process the focexec. In this case we are not passing any parameters, and/or expecting any return data, but that could be done. The 'Drop' will end the agent after processing, since we don't expect to use it again (at least, I assume so).

Now that you have added the additional requirement that the OS is on a different server, you will need to setup your deployment scenario to deploy that focexec to the iWay server machine, in addition to deploying your maintain components to the Windows box, and the web components to wherever they belong.

That will compile the maintain to point to the proper servers, and move the files to them, when you do your deployment.

This message has been edited. Last edited by: Dave Ayers,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
November 24, 2008, 10:57 AM
Maintain Wizard
Just a small correction. It's:
EXEC oscmdfex DROP

The DROP follows the procedure name, and isn't always necessary.

Mark