Embedded null characters in variables
When you use IBM® COBOL for Linux® on x86 to compile source code that contains a variable with embedded null characters, null characters will be removed.
See the output of
MY-DATA
in the following example. The null characters are
removed.$ cat tcBlankReplaceNull.cbl
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. "TEST-CASE".
000030 ENVIRONMENT DIVISION.
000040 CONFIGURATION SECTION.
000050 DATA DIVISION.
000060 WORKING-STORAGE SECTION.
000080 77 MY-DATA PIC X(5) VALUE X"4F4E00004E".
000120 PROCEDURE DIVISION.
000125 DISPLAY MY-DATA "<-".
000130 STOP RUN.
$ cob2 tcBlankReplaceNull.cbl IBM COBOL for Linux 1.2.0 compile started
End of compilation 1, program TEST-CASE, no statements flagged.
$ a.out
ONN<-