From: Hakan on

This is in a sense OT as it deals with a DOS/Windows scheduling issue.
However, it arises from a Java application so I feel that it might be a
good place to post my question. It might be that some of you has seen
this problem.

In order to run a SAS job from a Java program, we are using a simple
runtime.getruntime.exec({"C:/Program
Files/sas.exe","myloc/myfile.sas"}).
That works great, but my boss wants to have it run with a set lower
priority so that it doesn't interrupt other tasks on the server. How do
I do that?

Thanks in advance.



--
Newsoffice.de - Die Onlinesoftware zum Lesen und Schreiben im Usenet
Die Signatur l��t sich nach Belieben anpassen ;-)
From: Ian Shef on
Hakan <H.L(a)softhome.net> wrote in news:1275913595.04(a)user.newsoffice.de:

<snip>
> In order to run a SAS job from a Java program, we are using a simple
> runtime.getruntime.exec({"C:/Program
> Files/sas.exe","myloc/myfile.sas"}).
> That works great, but my boss wants to have it run with a set lower
> priority so that it doesn't interrupt other tasks on the server. How do
> I do that?
<snip>

Your example has bad capitalization and will not compile. However...

I have not tried this, but I am going to guess that the solution involves the
"start" command. If you have Windows XP, you might try:

Runtime.getRuntime.exec({"C:/WINDOWS/system32/cmd.exe", "/C", "START",
"/BELOWNORMAL", "C:\\Program Files\\sas.exe", "myloc/myfile.sas"}) ;


I have turned some forward slashes into double backslashes. Backslashes are
needed to meet the expectations of the START command, and doubling is
required for Java strings.

I don't have the right environment to try this, but perhaps it is close
enough to give someone an idea. Perhaps there is an easier way.

Good luck!



From: Daniel Pitts on
On 6/7/2010 12:41 PM, Ian Shef wrote:
> Hakan<H.L(a)softhome.net> wrote in news:1275913595.04(a)user.newsoffice.de:
>
> <snip>
>> In order to run a SAS job from a Java program, we are using a simple
>> runtime.getruntime.exec({"C:/Program
>> Files/sas.exe","myloc/myfile.sas"}).
>> That works great, but my boss wants to have it run with a set lower
>> priority so that it doesn't interrupt other tasks on the server. How do
>> I do that?
> <snip>
>
> Your example has bad capitalization and will not compile. However...
>
> I have not tried this, but I am going to guess that the solution involves the
> "start" command. If you have Windows XP, you might try:
>
> Runtime.getRuntime.exec({"C:/WINDOWS/system32/cmd.exe", "/C", "START",
> "/BELOWNORMAL", "C:\\Program Files\\sas.exe", "myloc/myfile.sas"}) ;
>
>
> I have turned some forward slashes into double backslashes. Backslashes are
> needed to meet the expectations of the START command, and doubling is
> required for Java strings.
>
> I don't have the right environment to try this, but perhaps it is close
> enough to give someone an idea. Perhaps there is an easier way.
>
> Good luck!
>
>
>
Sounds reasonable, although I would suggest wrapping the whole thing in
a BAT file, to separate the "priority" of the running app from the
concern of the runner app.

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
From: Ian Shef on
Daniel Pitts <newsgroup.spamfilter(a)virtualinfinity.net> wrote in
news:XUfPn.140043$0M5.115193(a)newsfe07.iad:

> On 6/7/2010 12:41 PM, Ian Shef wrote:
>> Hakan<H.L(a)softhome.net> wrote in
>> news:1275913595.04(a)user.newsoffice.de:
>>
>> <snip>
>>> In order to run a SAS job from a Java program, we are using a simple
>>> runtime.getruntime.exec({"C:/Program
>>> Files/sas.exe","myloc/myfile.sas"}).
>>> That works great, but my boss wants to have it run with a set lower
>>> priority so that it doesn't interrupt other tasks on the server. How
>>> do I do that?
>> <snip>
>>
>> Your example has bad capitalization and will not compile. However...
>>
>> I have not tried this, but I am going to guess that the solution
>> involves the "start" command. If you have Windows XP, you might try:
>>
>> Runtime.getRuntime.exec({"C:/WINDOWS/system32/cmd.exe", "/C", "START",
>> "/BELOWNORMAL", "C:\\Program Files\\sas.exe", "myloc/myfile.sas"}) ;
>>
>>
>> I have turned some forward slashes into double backslashes.
>> Backslashes are needed to meet the expectations of the START command,
>> and doubling is required for Java strings.
>>
>> I don't have the right environment to try this, but perhaps it is close
>> enough to give someone an idea. Perhaps there is an easier way.
>>
>> Good luck!
>>
>>
>>
> Sounds reasonable, although I would suggest wrapping the whole thing in
> a BAT file, to separate the "priority" of the running app from the
> concern of the runner app.
>
Even better than my solution. I like it!