Autosys unable to set the job to the status of FAILED

Hi

The Autosys job that call DOS batch file which in turn calls java and this java program has successful completion though there are series of exception occurred in the data it handles and want the job to be set to Fail in its autosys, how could it be done?

a.bat
{

java sample.class

}//end of a.bat

public class sample{
public static void main(String[] args) {

int a[2];

try{

a[3]=34;

}
catch(Exception e){
System.out.println("Exception occurred");
}

}// end of main method
}// end of class sample

I want to fail the Autosys job running this java program on seeing ArrayIndexOutOfBounds exception, please let me know how do I do it?

If you dont mnd I will move you thread to a (hope ! ) more suitable forum...