In native COBOL we could define a dictionary and that could be set as external which allowed us to access it via our external filehandler. In .NET COBOL it seems it is no longer possible to define a dictionary as external.
Can anyone suggest an alternative given that the information that can be passed to an external filehandler is limited and controlled by the run-time?
Best answer by Chris Glazier
something like this:
program-id. Program1 as "teststatic.Program1". procedure division. create type mydictionary::stringdict write type mydictionary::stringdict from "item 0" key "key0" call "subprog" perform varying key k as string through type mydictionary::stringdict declare s as string read type mydictionary::stringdict into s key k display "key = " & k & " value = " & s end-perform display "done"
goback.
end program Program1. class-id mydictionary. working-storage section. 01 stringdict dictionary[string, string] static property. end class.
program-id. subprog. procedure division.
write type mydictionary::stringdict from "item 1" key "key1".
Thanks for responding but ignorance is bliss here. Am I correct in saying I would have to define a separate class/dll which I can then reference from both the mainstream application and the external filehandler?
program-id. Program1 as "teststatic.Program1". procedure division. create type mydictionary::stringdict write type mydictionary::stringdict from "item 0" key "key0" call "subprog" perform varying key k as string through type mydictionary::stringdict declare s as string read type mydictionary::stringdict into s key k display "key = " & k & " value = " & s end-perform display "done"
goback.
end program Program1. class-id mydictionary. working-storage section. 01 stringdict dictionary[string, string] static property. end class.
program-id. subprog. procedure division.
write type mydictionary::stringdict from "item 1" key "key1".