Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I run SQL and pass the result of "STOP or "GO" to tMap and then tContextLoad:
tTeradataInput > tMap > tContextLoad
˅
OnSubjobOK
˅
tJava
The tJava code is:
System.out.println( "Context variable value is:"+context.myCHECK);
globalMap.put("myCHECK", context.myCHECK);
System.out.println( "Global variable value is:"+globalMap.get("myCHECK"));
if(globalMap.get("myCHECK")=="STOP"){System.exit(99);}else{ System.out.println("START GOING NOW");}
System.out.println("FAILED TO STOP");
The result is correct when the context variable is GO:
Context variable value is:GO
Global variable value is:GO
START GOING NOW
FAILED TO STOP
But when the context variable is STOP the exit command doesn't trigger:
Context variable value is: STOP
Global variable value is: STOP
START GOING NOW
FAILED TO STOP
Any ideas how to make the if else statement actually exit the job?
Hi,
Replace the "if" statement like this:
if(((String)globalMap.get("myCHECK")).equals("STOP")) System.exit(99); System.out.println("START GOING NOW"); // no else require
Hi,
Replace the "if" statement like this:
if(((String)globalMap.get("myCHECK")).equals("STOP")) System.exit(99); System.out.println("START GOING NOW"); // no else require