什么是控制中断? (COBOL) [英] What is a control break? (COBOL)

查看:94
本文介绍了什么是控制中断? (COBOL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我现在正在上在线COBOL课程,本周的内容是控制中断和控制领域...对于以前的讲座,我很容易理解,但是我不知道该讲座在谈论什么。什么是控制字段?用途是什么?谢谢。



以下是演讲网站:



http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u1/index.html



http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u2/index.html



http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u3/index.html

解决方案

控制字段是指示如何对数据进行分组的字段。 相同的所有控制字段值相同。控制字段值不包含其他值。



一个典型的示例可能是客户编号。出于某种目的(相同的未完成订单总数,什么),可以将同一客户编号的数据逻辑分组。



包含另一位客户的数据是不合逻辑的在您当前正在处理的客户中。



控制字段值更改时,这是控制中断。在报告中,这是时候做一些区别于其他客户的时候了,在此示例中:打印总计,指出一些不同的行/页间距,以使用户易于看到中断。 / p>

您可以有多个控制字段。当较高的控制字段发生变化(例如,公司)时,在该控制字段下方的每个控制字段中都有一个中断,从最低级别的控制字段开始,依次为向上。



数据通常将在控制字段上排序(实际上,您将看到称为控制字段的SORT键),但这不是必须的,只要具有相同控制值的所有数据都是连续的即可。



文件可以具有控制字段和控制中断,可以用不同的记录类型表示,这些记录类型包含该中断级别的摘要信息。



报表通常会具有控制字段,其中包含要在控制中断上执行的特定操作。

  01。 1111 
02.1111
03.1111
04.1111
05.2222

在上面,记录编号05导致控制中断。在可以处理记录编号05之前,必须先进行控制值1111的处理。



控制处理至少需要控制字段(通常也称为密钥)要存储的上一个记录。通常,其他数据必须存储或累积。



有时候,在读取下一条记录之前,您不知道如何处理记录,因此会存储整个输入(或其中的所有必填字段),并且



永远记住的一件事是,文件结尾会导致最终的控制中断,这是最高的,并且必须从最低处开始进行所有控制中断处理。


OK so I'm taking an online COBOL class now and this week the content is control break and control field... For previous lectures I can understand easily but I have no idea what this lecture talks about. What is a control field and what's the usage? Thanks.

Here are the lecture websites:

http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u1/index.html

http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u2/index.html

http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u3/index.html

解决方案

A Control Field is a field which indicates how data is grouped. All Control Field values which are the same, "belong together". No "other values" for a Control Field value belong with it.

A typical example might be a Customer Number. Data for the same Customer Number can be logically grouped together for some purpose (total number of outstanding orders, anything).

It would not be logical to include data for another customer within the customer that you are currently processing.

When the Control Field value changes, this is a "Control Break". In a report, this is the time to do something to differentiate from the other customers, in this example: print a total, indicate some different line/page spacing to make it easy for a user to "see" the "break".

You can have multiple Control Fields. When a higher Control Field changes (say, Company) then there is a "break" in every control field below that, from the lowest-level Control Field first, "upwards" in order.

Data will typically be sorted on Control Fields (indeed, you'll see SORT keys called Control Fields), but this is not necessary, as long as all the data for the same control value is consecutive.

Files can have Control Fields and Control Breaks, which may be represented by different record types containing summary information for that "level" of break.

Reports will very often have Control Fields with specific actions to be carried out on a Control Break.

01. 1111
02. 1111
03. 1111
04. 1111
05. 2222

In the above, record number 05 "causes" the Control Break. Processing for Control Value 1111 needs to be carried out before record number 05 can be processed.

Control processing requires at the very least the Control Field (often also called "the Key") of the previous record to be stored. Often other data has to be stored or accumulated.

On occasion you don't know how to process a record until you read the next record, so the entire input (or all required fields from it) is stored, and the records are processed "one behind".

One thing to always remember is that "end of file" causes the final Control Break, and it is the highest of all, and all Control Break processing from the lowest on upwards must be done at that point.

这篇关于什么是控制中断? (COBOL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆