PDA

View Full Version : Output from OS/400 programs



RandyA
03-13-2003, 07:31 PM
InstallShield executes OS/400 commands and programs via distributed program call support. This support allows applications to call iSeries programs and pass parameters (input and output). After the program runs on the iSeries server, the output parameter values return to the client application. How do I get these return values into IS 5.0? I have already tried using the SNDPGMMSG command and this places an entry in the LOG.TXT file, but this seems very tedious. There has got to be an easier way.

Thanks,
Randy

William
03-13-2003, 08:29 PM
Correct me if I'm wrong, but I'm assuming that you are using the "OS400Service.runCLCommand()" method to trigger these calls. I'm also assuming that the messages you are referring to are can normally be obtained from "CommandCall.getMessageList()" after a call to "CommandCall.run()" is made. If that is the case, you can either call the OS400Service method signature that returns the AS400Message array or call the version that does not and follow it with a call to "OS400Service.getLastMessages()".

If, on the other hand, you wish to manage the entire interaction yourself, you could always call the "OS400Service.getAS400()" method to obtain the AS400 object attached to the target machine and utilize it directly when making your program and command calls.

RandyA
03-14-2003, 11:47 AM
Thanks William,

I am using the OS/400 Program Wizard Bean to make the calls. I didn't see any other Wizard beans to retrieve OS/400 messages.

William
03-14-2003, 11:59 AM
Gotcha... The messages should probably be stored as a property within that bean (I'll put a feature request in for that for you).

However, there is a work-around and you can still get your hands on those messages through the OS400Service as long as you obtain them immediately after the WizardBean completes. One way to do this would be to use a custom WizardAction (ie. we'll call it "OS400StoreLastMessages") immediately after the OS400Command wizard bean. Within the OS400StoreLastMessages bean make a call to the "OS400Service.getLastMessages()" method. Since the last command call made would have been the one triggered by the OS400Command bean, you should be retrieving the messages you are looking for and you would be able to store them as a property within the OS400StoreLastMessages bean (or as a global variable, if you prefer). You would then be able to obtain the messages from other locations within the install. Basically, you would use the combination of the "OS400Command" and the "OS400StoreLastMessages" as a more descriptive OS400 command operation.

Does this help any?

RandyA
03-18-2003, 03:38 PM
William,

I added a "Exec Wizard Action" and it needs an executable to run.
I'm guessing this is where I should plug-in my java pgm to retrieve the messages from the AS/400.