没有合适的资源?快使用搜索试试~ 我知道了~
IBM大型机语言COBOL面试复习题库
需积分: 0 20 下载量 25 浏览量
2011-09-28
12:25:14
上传
评论 1
收藏 623KB DOC 举报
温馨提示
试读
12页
IBM大型机语言COBOL面试复习题库,COBOL面试复习法宝。 这是是COBOL面试考官常问的问题锦集。
资源推荐
资源详情
资源评论
COBOL Interview Quesons
01. Name the divisions in a COBOL Program.
The four divisions in a COBOL Program are IDENTIFICATION DIVISION, ENVIRONMENT
DIVISION, DATA DIVISION and PROCEDURE DIVISION.
02. Tell us briefly about each division.#
IDENTIFICATION DIVISION is used to establish the Identity of the program, and assigns a
unique name to the Program.
ENVIRONMENT DIVISION tells the environment – SOURCE-COMPUTER and OBJECT-
COMPUTER on which the COBOL Program would run. It also declares the Input and Output
file-names, accessed by the COBOL Program.#
DATA DIVISION is the place in the COBOL Program, that creates Storage areas(COBOL
Variables) for storing Data. Generally, COBOL Programs read data-records from Input-File, or
Write records to Output-file. When the data-record from the Input-file is read, there's got to be
a place in the COBOL Program, where the Input File Data arrives, its received and it has to be
stored. COBOL Programs may do some rough-work. Such variables which act like a
temporary scratch-pad, where you could do some rough-work, and which are there only as
long as the COBOL Program runs are called WORKING-STORAGE Areas.
PROCEDURE DIVISION is the starting-point of the COBOL Program, where the Program
begins to run. You code the Instructions that you to perform one-by-one in the PROCEDURE
DIVISION.
03. What are the different data-types in COBOL?
Alpha-numeric (X), alphabetic (A) and numeric (9).
04. What does the INITIALIZE Verb do?
Alphabetic, Alpha-numeric fields and alpha-numeric edited items are initialized to SPACES.
Numeric and Numeric-edited items are set to ZEROES. FILLER and OCCURS Clause items
are left untouched.
In the above code, WS-NAME variable would be filled up with SPACES. WS-PHONE variable
would be zeroed out. The output of the above code is shown in the picture below.
05. What is 77 level used for ?
Say, that you want to store the details about the Employees working in the Company. Each
EMPLOYEE-RECORD detail is generally 56 characters. To store Employee data in the
COBOL Program, I create an EMPLOYEE-RECORD Storage Area as follows.
I know that, EMPLOYEE-RECORD data contains the Name of the Employee(30 chars) and
the address of the employee(26 chars). I break down EMPLOYEE-RECORD into NAME and
EMP-ADDRESS Fields as follows.
But, the name itself consists of First-name(10), Middle-name(10) and Last-name(10).
Employee-Address Data consists of Street(10), City(10) and Pin-code(06). I can provide an
extra-level of detailed breakup.
This way, you can take a 01-Level Data-item, and break it down further into smaller storage-
areas, depending on the granularity-of-detail, you wish to capture.
#
77-level storage-areas are independent data-items, they cannot be broken down further into
smaller storage areas. Moreover, they cannot participate under a bigger storage area.
If EMPLOYEE-RECORD were to be an 77-Level Independent Variable, it would look like this.
Note that, now you can’t chop it!
06. Is there a difference between PIC 9.9 and PIC 9V9?
When you use PIC 9V9, COBOL assumes a decimal-point, and treats the number as a
real(fractional) number with Integer-part before the decimal-pt and Fractional-part after the
decimal-pt in all Arithmetic-Operations.#
When you use PIC 9.9, COBOL does not treat it like a Real(Decimal) Number. The decimal-
Point is merely used for display-formatting purposes, the '.' character is simply force-inserted
in between the 2-digits. It does not tell COBOL to treat the number as Decimal-number.
剩余11页未读,继续阅读
资源评论
llxiaocao1002
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功