最新COBOL经典面试题库(中英文版).doc
《最新COBOL经典面试题库(中英文版).doc》由会员分享,可在线阅读,更多相关《最新COBOL经典面试题库(中英文版).doc(162页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-dateCOBOL经典面试题库(中英文版)COBOL经典面试题库(中英文版)COBOL经典面试题库(中英文版)Q1) Name the divisions in a COBOL program ?.A1) IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION.Q:列举C
2、OBOL的DEVISIONA:标识部,环境部,数据部,过程部Q2) What are the different data types available in COBOL?A2) Alpha-numeric (X), alphabetic (A) and numeric (9).Q:COBOL有哪些可用的数据类型A:字符型(这里指的是包含字母和数字),字母型,数字型Q3) What does the INITIALIZE verb do? - GSA3) Alphabetic, Alphanumeric fields & alphanumeric edited items are set t
3、o SPACES. Numeric, Numeric edited items set to ZERO. FILLER , OCCURS DEPENDING ON items left untouched.Q:INITIALIZE这个词做了些什么A:将字母,字符,数字区域都置成空格(置空),将数字区置0, FILLER和OCCURS DEPENDING ON项不处理Q4) What is 77 level used for ?A4) Elementary level item. Cannot be subdivisions of other items (cannot be qualified
4、), nor can they be subdivided themselves.Q:77层有什么作用A:基本层数据项,不能用做细分别的层,也不能被细分Q5) What is 88 level used for ?A5) For condition names.Q:88层有什么作用A:条件逻辑层Q6) What is level 66 used for ?A6) For RENAMES clause.Q:66层有什么作用A:重命名层Q7) What does the IS NUMERIC clause establish ?A7) IS NUMERIC can be used on alpha
5、numeric items, signed numeric & packed decimal items and unsigned numeric & packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if the item being tested is a signed item, then it may contain 0-9, + and - .Q:IS NUMERIC这个子句怎么确定(也就是说确定句子的真值)A:IS NUMERIC用在字符项,带符号数字,浮
6、点数,不带符号数。如果目标项只含09则返回TRUE。但是,如果待测项目是个带符号数,那么他就含有0-9还有+和-Q8) How do you define a table/array in COBOL?A8) ARRAYS.05 ARRAY1 PIC X(9) OCCURS 10 TIMES.05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEXQ:COBOL中怎么建表/数组A:如上.Q9) Can the OCCURS clause be at the 01 level?A9) No.Q:OCCURS 子句能用在第一层吗A:不能Q10)
7、What is the difference between index and subscript? - GSA10) Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of thearray. An index can only be modified using PERFORM, SEARCH & SET. Need to have index for a table in order touse SEARCH, SEAR
8、CH ALL.Q:索引和下标有什么区别A:下标可以指定数组中任意中位置的元素(只要知道其下标),下标只能是数字型常量或者数字型变量(但是不能在指定的时候修改,如:A(K+1)这样是不行的,要修改的话要在指定的外部改,如:ADD 1 TO K,而索引的话是从表头/数组头开始检索(以BY N的指定检索规律往后滚)再者,索引只能通过PERFORM, SEARCH 和SET来修改,如果要在一个表中使用SEARCH, SEARCH ALL,那这个表就要有索引(因为SEARCH, SEARCH ALL的参数中指定索引,所以即使其有很多限制还是得用它)Q11) What is the difference
9、between SEARCH and SEARCH ALL? - GSA11) SEARCH - is a serial search.SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL.Q:SERACH和SERACH ALL有什么区别A:SEARCH是顺序查找SERACH ALL 是2叉查找(相信数据结构学过2叉树的都不会陌生),在使
10、用SEARCH ALL前表必须有一个递增/递减的KEY,并且表已经按照其KEY值排序了,这样才能使用SEARCH ALLQ12) What should be the sorting order for SEARCH ALL? - GSA12) It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on anarray sorted in descending order, then while defining the array, you shoul
11、d give DESCENDING KEY clause. (Youmust load the table in the specified order).Q:为了使用SEARCH ALL,存贮顺序是怎么样的A:他必须是递增或者是递减的,默认地政。如果你想在一个递减顺序存贮的表/数组使用搜索的话,那么当定义表/数组的时候你应该加一个DESCENDING KEY子句(这之前表要已经按指定的顺序排序了)Q13) What is binary search?A13) Search on a sorted array. Compare the item to be searched with the
12、item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies.Q:什么是2叉查找A:将你要找的目标项与数组的正中项比较,找到就结束搜索,没找到则继续如此循环(比较下一个中值),取哪一半取决于目标值大于中值还是小于中值PS:联想2叉树的查找规律就很好理解,因为所谓的“表“本身也就是数组Q14) My program has an array defined to have 10 items.
13、Due to a bug, I find that even if the program access the11th item in this array, the program does not abend. What is wrong with it?A14) Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.Q:我的程序有个数组定义了10项。因为有个BUG,我发现即使访问第11项,程序也不异常终止。那是出了什么问题A:必须使用编译器的一个选项SSRANGE
14、,如果你想检查数组的超界问题。默认是NOSSRANGEQ15) How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning. - GSA15) Syntax: SORT file-1 ON ASCENDING/DESCENDING KEY key. USING file-2 GIVING file-3.USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2GIVING can be su
15、bstituted by OUTPUT PROCEDURE IS para-1 THRU para-2.file-1 is the sort (work) file and must be described using SD entry in FILE SECTION.file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECTclause in FILE CONTROL.file-3 is the out file from the SORT
16、and must be described using an FD entry in FILE SECTION and SELECTclause in FILE CONTROL.file-1, file-2 & file-3 should not be opened explicitly.INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure.OUTPUT PROCEDURE is executed after
17、all records have been sorted. Records from the sort work file must be RETURNed one at a time to the output procedure.Q:怎么在一个COBOL程序中排序?给出排序文件的定义,排序语法和意思A:语法就是SORT file-1 ON ASCENDING/DESCENDING KEY key. USING file-2 GIVING file-3.USING后程序的输入接口,这个地方可以替换成一个输出过程,也就是说写一个过程往USING这个接口中导数据(要在这个过程中READ,AT E
18、ND,),这个过程在将数据释放到执行排序的文件中之前执行,GIVING后是输出借口,用法类似。此例中输入文件是file-2输出文件是file3(这样个文件必须在文件区中用FD和在文件控制中用到SELECT)真正执行排序的file-1,这里需要注意的是file-1中的文件区不能用FD,应该用SD,file-2和3还是一样(用FD),具体可以看一下书上的例子Q16) How do you define a sort file in JCL that runs the COBOL program?A16) Use the SORTWK01, SORTWK02,. dd names in the st
19、ep. Number of sort datasets depends on the volume of databeing sorted, but a minimum of 3 is required.Q:怎么在JCL中定义一个排序文件来跑这个COBOL程序A:用SORTWK01, SORTWK02,.作为DATA SET NAME。用多少取决于你要排序的数量,但是至少3个。Q17) What is the difference between performing a SECTION and a PARAGRAPH? - GSA17) Performing a SECTION will c
20、ause all the paragraphs that are part of the section, to be performed.Performing a PARAGRAPH will cause only that paragraph to be performed.Q:执行一个区和一个段有什么区别A:简单来说的话就是区的概念比段大,执行一个区就要执行其内部所有段,执行段的话只执行该段。Q18) What is the use of EVALUATE statement? - GSA18) Evaluate is like a case statement and can be u
21、sed to replace nested Ifs. The difference between EVALUATE andcase is that no break is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match ismade.Q:EVALUATE语句有什么作用A:EVALUATE就象个CASE语句(多重开关语句,学过C的总知道吧),不同点在于EVALUATE不需要BREAK,一旦匹配就跳出EVALUATE语句了Q19) What are the different fo
22、rms of EVALUATE statement?A19)EVALUATE EVALUATE SQLCODE ALSO FILE-STATUSWHEN A=B AND C=D WHEN 100 ALSO 00imperative stmt imperative stmtWHEN (D+X)/Y = 4 WHEN -305 ALSO 32imperative stmt imperative stmtWHEN OTHER WHEN OTHERimperative stmt imperative stmtEND-EVALUATE END-EVALUATEEVALUATE SQLCODE ALSO
23、A=B EVALUATE SQLCODE ALSO TRUEWHEN 100 ALSO TRUE WHEN 100 ALSO A=Bimperative stmt imperative stmtWHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)imperative stmt imperative stmtEND-EVALUATE END-EVALUATEQ20) How do you come out of an EVALUATE statement? - GSA20) After the execution of one of the when claus
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新 COBOL 经典 面试 题库 中英文
限制150内