The NullSearch utility identifies null-value fields in custom record classes passed to Enterprise Server at runtime. Null-value fields are invalid, preventing the runtime from executing.
If even one null-value field in a custom record mapping is passed to Enterprise Server, the run-time returns the following generic error message:
Sorry cannot have a null as value. Run the NullSearch utility.
The NullSearch utility identifies which fields have a null value, and can be especially helpful when your custom record mapping contains a large number of fields. For example, suppose customer record A has an inner class B that contains an array of 1000 elements of type String. One of those String elements has a value of null, triggering the above-referenced error message at run time. Without the NullSearch utility, you would have to manually identify the offending field.
We provide the NullSearch utility as a Java .jar file named nullSearch.jar, which is called from a Java program. nullSearch.jar is located by default in your %ProgramFiles(x86)%\Micro Focus\Visual COBOL\javaee (Windows) or /javaee (UNIX) directory.
To use nullSearch.jar:
Extended Class | .jar File |
---|---|
com.microfocus.cobol.connector.cci.CustomRecord | mfejblib.jar |
com.microfocus.cobol.lang.CustomRecord | mfcobolpure.jar |
public class testSearch { public static void main(String[] args){ custom_record field = new custom_record(); Object[] params = field.getParameters(); com.microfocus.tools.NullSearch search = new com.mf.NullSearch(); search.parseFields(params); } }
Field 0 is: classA$classB Field 0.20 is: classA$classB$classC Field 0.24 is: classA$classB$classD Field 1 is: classA$classE Field 1.0 is: [LclassF$classG$classH; Field 1.0.2 is null