0

对于家庭作业,我们正在练习文件处理中的多级控制中断。我们从输入文件中获取数据,处理每个组(在本例中:一个物业管理例程,计算办公室、建筑物和管理代理的当月总租金),然后将数据输出到一个漂亮整洁的报告文件中。我已经写了并提供了一个链接到我到目前为止所拥有的东西。这很粗糙,因为我还没有打扰输出格式,只是想确保我可以先让它运行。它在“-free”开关下以零错误或警告编译。但是,当我运行该程序时,会收到以下消息:

libcob: File sharing conflict (STATUS = 61) File : 'income-report.txt'
WARNING - Implicit CLOSE of propmanager-in-file ("prop-records.txt")

经过一番搜索,我了解到文件 I/O 的“STATUS = 61”代码通常在对已经用另一个文件连接器打开的物理文件执行 OPEN 时抛出。当时我在另一个 vi 窗口中打开了income-report.txt。我关闭它,重新编译,运行它,并得到相同的消息。我难住了。

income-report.txt 和 prop-record.txt 与程序位于同一目录中。上次编译时,我的机器上的任何地方都没有打开这两个文件,但我仍然收到上述消息。

代码链接:http: //pastebin.com/WrPuTUW9

4

1 回答 1

3

We'll be able to help you more in the discussion forums on the OpenCOBOL project at SourceForge. There we can discuss in a more free form, and not be restricted to the Question and Answer format preferred here. Not complaining about that, but I think you might benefit from a more open forum, as there may be some misunderstandings we can help with.

I have a feeling you are mistaking compile time and run time. It won't matter what data files you have open when you compile your program. The file sharing status code is a run-time error. I'm guessing you have your data files open when you execute the program.

Head to SourceForge and we'll help more if we can.

于 2012-11-23T22:02:50.177 回答