Restriction: This applies to native code only.
You pass strings to COBOL using either the String or StringBuffer class. You can use any the following mechanisms to do this:
- Pointer class. This enables you to pass a Java string to a COBOL program without changing the COBOL source code. The Pointer class is in the
com.microfocus.cobol.lang package.
- mf-jstring. This enables you to convert a Java string to a user-defined type called mf-jstring, which is defined in javatypes.cpy. This user-defined type gives you full access to the information available from Java, this includes the data, the length of the string and the capacity of the string or string buffer.
- CobolNational. This java class enables you to create UTF-16 strings that can be passed to a COBOL PIC N(...) USAGE NATIONAL field.