I am trying to make use of the ISO2002 option and ISO 2002 style program prototypes. I’m running in to two, perhaps unrelated, issues.
- Even when I specify $set repository"update on checking on", no external repository file appears to be created.
- If I, in a separate calling program, code a program prototype for the called program, it appears to check for call parameter conformance correctly, but with a correctly coded call statement I end up with a fatal error, shown below.
* Options: NOLIST NOASM
* 912-S **
** Internal error - Dictionary invalid r/w . Please contact Rocket Technical Support.
I have three source files below:
- f1.cbl contains a function named f1.
- This compiles fine and writes the f1.rdf external repository file.
- p1.cbl contains a program named p1.
- p1, among other things, uses the f1 user defined function from above. No function prototype is required because it is “read” from the external repository.
- This compiles fine, but does not write an external repository file, even though I’ve specified the option to do so.
- p0.cbl contains a program prototype for the p1 program above, and then program p0.
- p0 calls p1
- The error shown above (“Internal error - Dictionary invalid r/w .”) occurs during compile
Below are the three source files (inline; it wouldn’t let me attach a .cbl file).
f1.cbl
$set sourceformat"free"
$set iso2002
$set repository"update on checking on"
function-id. f1.
linkage section.
01 x pic x(10).
01 n binary-long.
01 r binary-short.
procedure division using x optional n returning r.
if x is not omitted
display x
end-if
if n is not omitted
display n
end-if
move 1 to r
goback.
end function f1.
p1.cbl
$set sourceformat"free"
$set iso2002
$set repository"update on checking on"
program-id. p1 as 'p1'.
environment division.
configuration section.
repository.
function f1.
linkage section.
01 x pic x(10).
01 n binary-long.
procedure division using x returning n.
display x
compute n = f1(x omitted)
goback.
end program p1.
p0.cbl
$set sourceformat"free"
$set iso2002
$set repository"update on checking on"
program-id. p1 as 'p1' is prototype.
linkage section.
01 x pic x(10).
01 n binary-long.
procedure division using x returning n.
end program p1.
program-id. p0.
environment division.
configuration section.
repository.
program p1.
data division.
working-storage section.
01 x10 pic x(10).
01 results binary-long.
01 bad pic x(80).
procedure division.
call p1 using x10 returning results
goback.
end program p0.