When OVRDBF SHARE(*YES) is used on "FILEA" and you have "FILEA" defined in "ProgramA" and "ProgramB". I know that doing a READ, START etc... in either program moves the Pointer for both programs since they share the buffer. But are the FIELD values for "FILEA" the same in both programs? EXAMPLE: "PROGRAMA" READS "FILEA" and "FIELDA" has value of "X". "PROGRAMA" calls "PROGRAMB" and "PROGRAMB" does a READ NEXT of "FILEA" and "FIELDA" is now setting at "Y" in "PROGRAMB". Is "FIELDA" value for both Programs setting at "Y" or is "PROGRAMA" still "X"?
I think I have answered my own question as in both "PROGRAMA" and "PROGRAMB" the "FIELDA" of "FILEA" would be setting at "Y" now because of the READ NEXT in "PROGRAMB".
...because of the READ NEXT...
COBOL provides a kind of access to the file buffers. If you aren't using the READ {NEXT} INTO format, you could be seeing buffer values.
READ ... INTO copies into WORKING STORAGE. A READ without the INTO clause should simply increment the pointer to the buffer to access the next record. (There may be no data movement at all.)
I haven't actually tried what you're asking, but it might make sense for COBOL. A shared ODP will share the file pointer. That is, OVRDBF SHARE(*YES) allows multiple programs to use the same file pointer.
If access is through the FD record entry rather than through a WORKING STORAGE copy, I wouldn't be surprised if field values seemed to change. What actually changed would be the address that the field pointed to.
Tom
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 3  Replies