Hi All,
Getting this error. I ran it through the debugger and I see that it is taking an error on the second field billingUnit = record.substring(9,4);. See how the String is greater than the substring I am indexing. I don't understand how it is taking such an error.
10:22:24.158 COL I main: *************** Exception occurred **************
10:22:24.158 COL I main: toString: java.lang.StringIndexOutOfBoundsException: String index out of range: -5
10:22:24.158 COL I main:
10:22:24.158 COL I main: getMessage: String index out of range: -5
10:22:24.158 COL I main:
10:22:24.158 COL I main: StackTrace:
java.lang.StringIndexOutOfBoundsException: String index out of range: -5
groupSORDateExtract = new GroupSORDate(detailSORExtract);
public class GroupSORDate {
private String group = null;
private String billingUnit = null;
private String accountNumber = null;
private String enrollmentDate = null;
private String billingDate = null;
private String status = null;
public GroupSORDate(String record) {
group = record.substring(0,9);
billingUnit = record.substring(9,4);
accountNumber = record.substring(13,7);
enrollmentDate = record.substring(20,8);
billingDate = record.substring(28,8);
status = record.substring(36);
}
Record:
tctttt tttttctttt 0101200904202009R