I have tested the application outside of SAS and it works as expected. I receive the following Java exception when running my data step:
A google search of this exception yields the following:
"Thrown when code that is dependent on a keyboard, display, or mouse is called in an environment that does not support a keyboard, display, or mouse."
I can only assume that the batch environment somehow disables the input devices necessary for my swing application. Is there a way to enable input devices during batch execution? Has anyone successfully launched a swing application from SAS in batch mode?
That link contains this statement (emphasis mine):
Here the colors class is instantiated (and the UI is displayed). Then we enter a loop which is terminated when the Quit button is pressed (this action is communicated to the DATA step via the done variable).
WHO is pressing the QUIT button and interacting with the UI when the program is submitted in batch mode??? Sometimes the assumption for batch mode (such as programs submitted by Enterprise Guide) is that the code will run on a server machine which does NOT have a display terminal.
Just curious... This actually sounds like a question for Tech Support to me.
If the VB code is going to simulate the QUIT button -- then I'm guessing that the VB will also have to simulate responding to the other UI buttons/choices in the app. In which case, I'm wondering what point there is in launching the UI app from a batch SAS program at all. If the VB code is going to answer all the prompts...then the VB code is just pretending to be a user??? I thought the point of having a UI (user interface) was that there would be a user to interface with the app.
Thanks for your responses. I will submit my question to tech support. I believe all the examples with GUI's that I've come across are done in interactice mode. I can successfuly create and interact with java objects in batch mode only when they don't involve a GUI.
The following probably isn't relevant to the OP's question but, over the years, I have found UIs that already did something I wanted to accomplish in a batch job and pretending to be a user via VB was a lot easier than finding out how the code was written.
One such example was the display dde triplet UI. It provides an easy way to obtain a triplet, but wasn't built to complete the operation until the user clicks a button.