DATA Step, Macro, Functions and more

Launch interactive Swing Application from SAS in batch mode?

Reply
Occasional Contributor
Posts: 17

Launch interactive Swing Application from SAS in batch mode?

Hello,

I am having difficulty launching a swing application (not an applet) from batch mode in a SAS data step. I am following the example found in the javaobj documentation here:

http://support.sas.com/rnd/base/datastep/dot/javaobj.html#oth

I have tested the application outside of SAS and it works as expected. I receive the following Java exception when running my data step:

java.awt.HeadlessException

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?

Thank you much!
PROC Star
Posts: 7,363

Re: Launch interactive Swing Application from SAS in batch mode?

Zelazny,

Are you on 9.2? I haven't tried it but, from the description, it appears that you should be able to get around such issues:

http://support.sas.com/rnd/base/datastep/dot/javaobj.html#oth

Art
SAS Super FREQ
Posts: 8,743

Re: Launch interactive Swing Application from SAS in batch mode?

Hi:
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.

cynthia
PROC Star
Posts: 7,363

Re: Launch interactive Swing Application from SAS in batch mode?

Cynthia,

You're probably correct, but one can always simulate pressing a button by simply sending some vb code.

Art
SAS Super FREQ
Posts: 8,743

Re: Launch interactive Swing Application from SAS in batch mode?

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.

cynthia
Occasional Contributor
Posts: 17

Re: Launch interactive Swing Application from SAS in batch mode?

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.
PROC Star
Posts: 7,363

Re: Launch interactive Swing Application from SAS in batch mode?

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.

Art
SAS Super FREQ
Posts: 8,743

Re: Launch interactive Swing Application from SAS in batch mode?

I'm convinced that everything old comes around again!

I used to write programs to simulate entering data into a CICS screen to update a file. (And if you don't know what CICS means, be thankful!)

cynthia
Occasional Contributor
Posts: 17

Re: Launch interactive Swing Application from SAS in batch mode?

I just received a reply from SAS Technical. Unfortunately, batch mode disables keyboard, mouse and monitor so it is not possible to accomplish what I was hoping. Thanks again for your responses.
Ask a Question
Discussion stats
  • 8 replies
  • 162 views
  • 0 likes
  • 3 in conversation