identification division.
program-id. t1.
data division.
working-storage section.
01 block1.
03 mypic1 pic x(10).
01.
03 mypic2 pic x(10).
procedure division.
a-main section.
display 'hello world'.
call 't2'
stop run.
identification division.
program-id. t2
common.
data division.
working-storage section.
01 block1.
03 mypic1 pic x(10).
01.
03 mypic2 pic x(10).
procedure division.
a-main section.
move 'FOO' to mypic2
display 'sub program!'
display mypic2
goback.
end program t2.
end program t1.
But when preprocessed:
cobc t4.cbl
t4.cbl:24: error: PICTURE clause required for 'FILLER'
t4.cbl: in section 'a-main':
t4.cbl:28: error: 'mypic2' is not defined
t4.cbl:39: error: syntax error, unexpected GO, expecting FUNCTION-ID or PROGRAM-ID
Because the preprocessor has for some reason commented out a variable:
gixpp -v -d -C -e -i t4.cob -o t4.cbl
Following program runs if compiled with cobc:
But when preprocessed:
Because the preprocessor has for some reason commented out a variable:
gixpp -v -d -C -e -i t4.cob -o t4.cbl