COBOL面试1—30题答案

合集下载

宝洁面试经典八大问题(附答案范例)

宝洁面试经典八大问题(附答案范例)

宝洁面试经典八大问题(附答案范例)宝洁公司在中国高校招聘采用的面试评价测试方法主要是经历背景面谈法,即根据一些既定考察方面和问题来收集应聘者所提供的事例,从而来考核该应聘者的综合素质和能力。

宝洁的面试由8个核心问题组成。

宝洁公司招聘题号称由高级人力资源专家设计,无论您如实或编造回答, 都能反应您某一方面的能力。

核心部分的题如下:Please provide concise examples that will help us better understand your capabilities.(1)Describe an instance where you set your sights on a high/demanding goal and saw it through completion. (请你举一个具体的例子,说明你给自己确定了一个很高的目标,然后达到这个目标。

)问题分析:这个问题的考察应聘者制定高目标的勇气及完成高目标的执行力。

关键词为:demanding goal、saw it through。

回答范例:(记住,采用“What+STAR+Key Words法则”来回答)What:Designed a show to celebrate the Anniversary of Xiamen University, and won 2nd Prize out of 12 teams.Situation(Key Word:demanding)On the anniversary night, there was a huge celebration party, where songs, dances and dramas were played. Each school should design five shows, and our class volunteered to design one. It was a demanding goal as it was very close to the end of the term when most students were busy preparing for final exams.Task:As a sophomore student I was in charge of my class performance, which was a drama. I had to deal with the pressure from study, my classmates’ disinterest in acting, and my role as the king in th e drama.Actions:(Key Words:how I saw it through)First, as there were only 20 students in my class, I distributed at least one task to each student; either a role, or making tools or costumes.Second, since at the end of the term each member was busy with study, the rehearsal schedule should be reasonable and periodic. All team members cooperated well because of the low frequency and short duration of each rehearsal.Third, music and scenery were added into rehearsal in order to get close to the circumstances of the party.In addition, I emphasized the value of time and ordered every actor to respect other partners.Result:In the end, our performance was very successful. Not only did I act the “king” wonderfully, but also got good marks on the final exam.(2)Summarize a situation where you took the initiative to get others on an important task or issue, and played a leading role to achieve the results you wanted. (请举例说明你在一项团队活动中如何团结他人,并且起到领导者的作用,并带领团队最终获得所希望的结果。

cobol 面试题

cobol 面试题

cobol 面试题COBOL面试题COBOL(Common Business Oriented Language)是一种广泛应用于商业和金融领域的编程语言。

对于招聘COBOL开发人员的公司来说,面试是选拔合适候选人的重要环节。

本文将为您提供一些常见的COBOL面试题,以帮助您准备和了解COBOL编程语言。

1. COBOL中如何声明一个变量?在COBOL中,可以使用“01”关键字来声明一个变量,示例如下:01 CUSTOMER-INFO.05 CUSTOMER-NAME PIC X(20).05 CUSTOMER-AGE PIC 99.05 CUSTOMER-ADDRESS PIC X(50).2. COBOL中如何进行文件读取操作?COBOL提供了READ语句用于读取文件中的数据记录。

以下是一个示例:READ FILE-NAME INTO RECORD-NAME.3. COBOL中如何进行条件判断?COBOL使用IF语句来进行条件判断。

下面是一个简单的例子:IF TOTAL-SALES > 10000DISPLAY "High sales!"ELSEDISPLAY "Low sales!"END-IF.4. COBOL中如何进行循环操作?COBOL中的循环语句包括PERFORM和GO TO语句。

下面是一个使用PERFORM的例子:PERFORM UNTIL COUNTER > 10ADD 1 TO COUNTERDISPLAY COUNTEREND-PERFORM.5. COBOL中如何处理异常?COBOL使用异常处理块来处理异常情况。

以下是一个TRY...ON...END TRY结构的例子:TRYDIVIDE NUM1 BY NUM2 GIVING RESULT.ON EXCEPTIONDISPLAY "Error: Division by zero."END TRY.6. COBOL中如何进行字符串操作?COBOL提供了一系列用于字符串操作的函数和语句。

COBOL面试1—30题

COBOL面试1—30题

Q1) Name the divisions in a COBOL program ?.Q2) What are the different data types available in COBOL?Q3) What does the INITIALIZE verb do? - GSQ4) What is 77 level used for ?Q5) What is 88 level used for ?Q6) What is level 66 used for ?Q7) What does the IS NUMERIC clause establish ?Q8) How do you define a table/array in COBOL?Q9) Can the OCCURS clause be at the 01 level?Q10) What is the difference between index and subscript? - GSQ11) What is the difference between SEARCH and SEARCH ALL? - GSQ12) What should be the sorting order for SEARCH ALL? - GSQ13) What is binary search?Q14) My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not abend. What is wrong with it?Q15) How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning. - GSQ16) How do you define a sort file in JCL that runs the COBOL program?Q17) What is the difference between performing a SECTION and a PARAGRAPH? - GSQ18) What is the use of EV ALUATE statement? - GSQ19) What are the different forms of EV ALUATE statement?Q20) How do you come out of an EV ALUA TE statement? - GSQ21) In an EVALUA TE statement, can I give a complex condition on a when clause?Q22) What is a scope terminator? Give examples.Q23) How do you do in-line PERFORM? - GSQ24) When would you use in-line perform?Q25) What is the difference between CONTINUE & NEXT SENTENCE ?Q26) What does EXIT do ?Q27) Can I redefine an X(100) field with a field of X(200)?Q28) Can I redefine an X(200) field with a field of X(100) ?Q31)2 What do you do to resolve SOC-7 error? - GSQ32) How is sign stored in Packed Decimal fields and Zoned Decimal fields?Q33) How is sign stored in a comp-3 field? - GSQ34) How is sign stored in a COMP field ? - GSQ35) What is the difference between COMP & COMP-3 ?Q36) What is COMP-1? COMP-2?Q37) How do you define a variable of COMP-1? COMP-2?Q38) How many bytes does a S9(7) COMP-3 field occupy ?Q39) How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ? Q40) How many bytes will a S9(8) COMP field occupy ?Q41) What is the maximum value that can be stored in S9(8) COMP?Q42) What is COMP SYNC?Q43) What is the maximum size of a 01 level item in COBOL I? in COBOL II? Q44) How do you reference the following file formats from COBOL programs:Q45) What are different file OPEN modes available in COBOL?Q46) What is the mode in which you will OPEN a file for writing? - GSQ47) In the JCL, how do you define the files referred to in a subroutine?Q48) Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?Q49) What is file status 92? – GSQ50) What is file status 39 ?Q51) What is Static and Dynamic linking ?Q52) What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? (applicable to only MVS/ESA Enterprise Server).。

谷歌面试题及答案

谷歌面试题及答案

谷歌面试题及答案谷歌面试题及答案第一题:多少只高尔夫球才能填满一辆校车?(职位:产品经理)解析:通过这道题,谷歌希望测试出求职者是否有能力判断出解决问题的关键。

网友的答案:我想,一辆标准大小的校车约有8英尺宽、6英尺高、20英尺长——我能知道这些数字完全是因为我曾经无数次被堵在校车后面。

据此估算,一辆校车的容积约为960立方英尺,也就是160万立方英寸。

一个高尔夫球的半径约为0.85英寸,我认为一个高尔夫球的体积约为2.6立方英寸。

用校车的容积除以高尔夫球的体积,得到的结果是66万。

不过,由于校车里面还有座位等等各种东西,而且高尔夫球的形状使得不同的球之间会有不少空隙。

我的最终估算结果是50万。

这听起来有些荒唐。

如果我直接猜的话,我给出的答案肯定是10万以下,不过我相信我的数学水平。

当然,如果这里的校车是小布什当年坐过的那种,结果还要除以2,差不多是25万个。

第二题:让你清洗西雅图所有的玻璃窗,你的报价是多少?(职位:产品经理)答案:这一题我们可以玩点花招,我们的答案是“每扇窗10美元”。

第三题:有一个人们只想生男孩子的国家,他们在有儿子之前都会继续生育。

如果第一胎是女儿,他们就会继续生育直到有一个儿子。

这个国家的男女儿童比例是多少?(职位:产品经理)答案:这一题引发了不少争议,不过我们发现,这一题的解答步骤如下:1、假设一共用10对夫妻,每对夫妻有一个孩子,男女比例相等。

(共有10个孩子,5男5女);2、生女孩的5对夫妻又生了5个孩子,男女比例相等。

(共有15个孩子,男女儿童都是7.5个);3、生女孩的2.5对夫妻又生了2.5个孩子,男女比例相等。

(共有17.5个孩子,男女儿童都是8.75个);4、因此,男女比例是1:1。

第四题:全世界共有多少名钢琴调音师?(职位:产品经理)答案:我们的回答是“要看市场情况。

如果钢琴需要每周调音一次,每次调音需要1个小时,且每个调音师每周工作40个小时。

我们认为每40台钢琴就需要一名调音师。

谷歌面试题及参考答案

谷歌面试题及参考答案

谷歌面试题及参考答案谷歌的面试会根据面试者的应聘岗位不同而出不一样的题目。

对面试题目的回答会直接影响谷歌的面试成效。

下面是由分享的谷歌面试题及参考答案,希望对你有用。

谷歌面试题及参考答案(一)应聘职位:软件工程师假设你在衣橱里挂满衬衫,很难从中挑出某一件来。

请问你打算怎样整理一下,使得它们容易挑选?答案:此题没有固定答案。

考验的是被面试者在解决问题方面的想象力和创造性。

我们觉得读者”Dude”的这个答案可能会给Google留下深刻印象:把它们按布料的种类进行哈希(HASH)组合。

然后每类再按2-3-4树或红黑树(都是计算机算法)排序。

应聘职位:软件工程师给你一副井字棋(Tic Tac Toe)。

你来写一个程序,以整个游戏和一个玩家的名字为参数。

此函数需返回游戏结果,即此玩家是否赢了。

首先你要决定使用哪种数据结构处理游戏。

你还要先讲出使用哪种算法,然后写出代码。

注意:这个游戏中的某些格子里可能是空的。

你的数据结构需要考虑到这个条件。

答案:所需要的数据结构应为二元字符数列。

调用此函数检查6种条件,判断是否有赢家。

其中第6种条件就是看是否还有空格。

如果有赢家,则字符判断玩家是X还是O。

因此你需要一个旗标。

如果有赢家则返回此值并结束游戏,如果没有则继续游戏。

应聘职位:软件工程师为1万亿个数排序需要多长时间?请说出一个靠谱的估计。

答案:这又是一个没有标准答案的题目。

目的是考察被面试者的创造性。

我们倾向于两位读者给出的简单答案:用归并排序法(Merge Sort)排序。

平均情况下为O(1,000,000,000,000 Log 1,000,000,000,000)。

最差情况下为O(1,000,000,000,000 Log 1,000,000,000,000)。

现在可以做到每秒10亿次的运算,所以大约应需要3000秒。

应聘职位:软件工程师请设计一个“蛙跳”游戏的算法,并写出方案的代码。

答案:这个游戏的目标是引导一个青蛙避开来往车辆,横穿一条繁忙的公路。

JCL.Cobol.DB2.CICS面试题

JCL.Cobol.DB2.CICS面试题

JCL:1 简单描述一下DISP 的使用,它有哪些参数?DISP 参数用来告诉系统要使用的数据集的状态是什么并且告诉系统当本作业步执行完毕后如何处理这个数据集。

你可以为作业步正常结束和非正常结束时分别指定不同的处理方法。

DISP= ( [NEW] [,DELETE ] [,DELETE ] )为空时也表示这个。

[OLD] [,KEEP ] [,KEEP ][SHR] [,PASS ] [,CATLG ][MOD] [,CATLG ] [,UNCATLG][, ] [,UNCATLG]2什么是 PROCEDURE ,有哪几种 PROCEDURE ,简述区别有 2中 PROCEDURE,一种是 CATALOG的 PROCEDURE,是把过程的JCL 语句写在一个编目的数据集里,该数据集必须是PDS 或PDSE里的一个成员,能够同时被多个JCL调用。

另一种是INSTREAM的 PROCEDURE,流 PROCEDURE,写在一个JCL 里面 , 以PROC开头,以 PEND字句结束。

3.什么是 GDG 数据集, GDG 数据集的每一代数据集是否可以是不同类型的 ? 定义 GDG 数据集有 3 个重要的参数: LIMITNOEMPTY SCRATCH 各表示什么含义?定义 GDG BASE 之后要必须定义什么?答: GDG 数据集是一组名字相似,时间和功能相关的数据集。

GDG 数据集是 MVS 中的世代数据集,通过IDCAMS 来创建。

GDG 数据集的每一代可以是不同类型的。

3 个重要的参数LIMIT表示这个世代数据集最多可以有多少代; NOEMPTY 表示不清空, SCRATCH 表示最老的一代是被删除掉的。

定义 GDG BASE 之后必须定义 GDG DSCB 才能生效。

4.COND 参数是什么意思?如果我需要作业步 3,只在作业步 2 返回码是 0 或者 4 的时候才执行,如何写COND 参数?答: COND 参数是 CONDITION 参数,表示什么情况下作业步被执行 /不被执行。

COBOL试题答案

COBOL试题答案

一、选择题(15分)(含多项选择)1、不属于COBOL程序的部的是:(B )A.过程部。

B.程序部。

C.数据部D.环境部2、COBOL程序中的数据在哪个部中定义?(C )A.过程部。

B.环境部。

C.数据部D.标识部3、COBOL程序中如果有环境部的话,应置于:(C )A.过程部之后标识部之前。

B.标识部之后过程部之前。

C.标识部之后数据部之前。

D.数据部之后过程部之前。

4、标识部中不可缺少的段名是:(A )A.PROGRAM-IDB.AUTHORC.FILE SECTIOND.PROGRAM5、COBOL程序中一般变量在哪里定义?(D )A.标识部B.环境部C.数据部的FILE SECTIOND.数据部的WORKING-STORAGE SECTION6、下列关于过程部的说法正确的是:(C )A.过程部中可以不定义节但是必须定义段B.过程部中可以不定义段但是必须定义节C.过程部中可以不定义节和段,节和段是根据需要定义的D.所有程序都是在过程部中以STOP RUN来结束的7、下面是COBOL合法数据名的是:(ABD )A.W ANGB.TAN-1C.12345D.END-OFE.PROGRAMF.GROSS-$G.SECTION8、关系运算符的优先顺序正确的是(A )A.NOT > AND > ORB.OR> NOT > ANDC.AND > NOT > ORD.NOT > OR > AND9、下记语句表示A/B=>C的是(B )A.DIV A INTO B GIVING C.B.DIV A BY B GIVING C10、下记哪些方法可以显示出‘ABCD’六个字符(A,C )A. PIC X(6) VALUE "'ABCD'". 说明:V ALUE后依次为空格双引号单引号ABCD单引号双引号B. PIC X(6) V ALUE ''ABCD''.说明:V ALUE后依次为空格单引号单引号ABCD单引号单引号C. QUOTE ’ABCD’ QUOTE11、COBOL对文件的操作以为单位的(B )A.整个文件B.记录C.字段12、PIC 9(3) COMP-3在内存中占几BYTE?(A )A、2BYTEB、3BYTEC、6BYTE二、判断题(10分)1、在写COBOL程序时,数据名称可以随意写,只要合乎语法就行。

赛维面试

赛维面试

1、comp comp-3的区别什么时候使用display格式
答:comp是定点二进制;comp-3是内部压缩十进制;
Comp多用于计算,comp-3。

Comp显示出来是0101……;comp-3是乱码。

Display用于对数据、变量的输出操作
2、66层77层88层
66用于重定义,需包含一个Renames从句
77用于标示一个独立的初等项,它不属于其它组合项
88用于标示一个条件变量。

3、五个区几个部作用最多写几个字符
JCL标名操参备,标明JCL的开始、名字、指明用什么操作符、位置参数或者键子参数、用于书写备注
COBOL的五个区是标号区(01—06列)、DEBUG区(07为注释区或者debug区)、注释区、A区(08—11列,程序中的部名、节名、段名、描述符《FD》01层和77层在该区书写)B 区(程序正文部分,过程部语句必须从该区开始书写)
COBOL标示部,环境部,数据部,过程部;标示部用来为程序设定标志,以便于识别,PROGRAM-ID 最多30个字符,但工作中要求不超过8个字符。

环境部
4、go to contine 的区别
5、静、动态的调用区别
6,read一个文件需什么环境
7、cobol和db2怎么连接
对cobol源代码进行处理,将cobol的源代码进行连接编译,将执行模块放入load库中8、你认为cobol是一种什么样的语言?特点?
答:计算型语言,最主要的程序设计语言,稳定、不断发展更新,扩展性强
9、调用程序怎样互传参数?
10、怎样调用数据库。

COBOL面试题黄金版

COBOL面试题黄金版

TSO1、什么是TSO?答:TSO(Time Sharing Option)一个模块,是MVS的基本组件、充当命令输入器。

提供主机用户(TSO ID)与系统之间的接口。

用户在TSO终端上,用命令形式操纵和管理计算机的资源和应用。

2、我们在配置PCOM时需要设置哪些参数?答:链路参数和会话参数3、TSO的签到方式?方法一:1、画面命令行输入‘TSO ’,‘确定’显示签到画面2、在签到画面Password栏位后输入用户密码方法二:1、画面输入‘TSO USERID’, ‘确定’显示签到画面2、在签到画面Password栏位后输入用户密码4、TSO的签退方式?方法一:1、在签到后的第一屏(标记有“ISPF Primary Option Menu ”的屏幕)输入‘X’,退出ISPF 2、画面出现READY,在下面输入LOGOFF方法二1、在签到第一屏,点击功能键'F3' ,2、如果系统画面出现READY ,在下面输入‘LOGOFF’3、如果系统画面出现'退出选项提示' 选择‘2’确定,来到READY 画面,之后输入LOGOFF5、以下账号有哪些权限?SYSUSER:具有对z/OS操作系统基本产品的操作功能DBAUSER:具有对z/OS操作系统基本产品和数据管理产品的操作功能TIVUSER:具有操作Tivoli产品的功能TSOUSER:具有存取TSO READY提示信息下的使用功能6、简述一下ISPF/PDF界面?ISPF/PDF:Interactive System Productivity Facility /Program Development Facility菜单(Panel)式的操作界面,为用户提供数据集管理、程序开发、作业(JOB)提交和监控等功能。

他的主要功能是使用菜单方式来使用TSO 命令。

7、ISPF界面分为哪几个功能区?Action Bar(行为菜单):提供了一些系统操作的选项,光标停留其上按确认键将跳出功能菜单可供选择。

COBOL面试1—30题答案

COBOL面试1—30题答案

COBOL面试1—30题答案A1) IDENTIFICA TION DIVISION, ENVIRONMENT DIVISION, DA TA DIVISION, PROCEDURE DIVISION.Q:列举COBOL的DEVISIONA:标识部,环境部,数据部,过程部A2) Alpha-numeric (X), alphabetic (A) and numeric (9).Q:COBOL有哪些可用的数据类型A:字符型(这里指的是包含字母和数字),字母型,数字型A3) Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. FILLER , OCCURS DEPENDING ON items left untouched. Q:INITIALIZE这个词做了些什么A:将字母,字符,数字区域都置成空格(置空),将数字区置0,FILLER和OCCURS DEPENDING ON项不处理A4) Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.Q:77层有什么作用A:基本层数据项,不能用做细分别的层,也不能被细分A5) For condition names.Q:88层有什么作用A:条件逻辑层A6) For RENAMES clause.Q:66层有什么作用A:重命名层A7) IS NUMERIC can be used on alphanumeric 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用在字符项,带符号数字,浮点数,不带符号数。

cobol面试题及答案

cobol面试题及答案

cobol面试题及答案在现代信息技术的迅猛发展下,COBOL(COmmon Business-Oriented Language)作为一种面向商业应用的编程语言,仍然在许多企业和金融机构中得到广泛应用。

对于那些希望从事与COBOL相关的工作或者招聘COBOL开发人员的企业来说,面试是一个非常重要的环节。

本篇文章将介绍一些常见的COBOL面试题及其答案,帮助读者准备面试或者了解该编程语言的一些基本概念。

1. 什么是COBOL?COBOL是一种旨在处理商业数据的高级编程语言。

它于1960年代诞生,并在当时就被广泛用于大型计算机系统中。

COBOL采用英语类似的描述性语法,旨在提高可读性和可维护性。

2. COBOL的优点是什么?COBOL在商业领域中具有许多优点,包括:- 可读性高:COBOL使用自然语言类似的描述性语法,易于理解和维护。

- 跨平台兼容性:COBOL可在多个计算机平台上运行,为企业提供了更大的灵活性。

- 大规模数据处理:COBOL适用于大量数据的处理,因此被广泛应用于金融和保险等领域。

3. COBOL中的数据类型有哪些?COBOL支持以下几种数据类型:- 数字(Numeric):包括整数(整数)和浮点数(小数)。

- 字符串(Alphanumeric):用于存储文本数据。

- 日期和时间(Date and Time):用于存储日期和时间信息。

- 表(Table):用于存储多个值的集合。

4. 如何定义一个COBOL程序的入口点?在COBOL中,程序的入口点是通过IDENTIFICATION DIVISION 中的PROGRAM-ID子句来定义的。

例如:IDENTIFICATION DIVISION.PROGRAM-ID. MYPROGRAM.5. COBOL中的条件语句有哪些?COBOL中常见的条件语句包括IF语句和EVALUATE语句。

IF语句用于基于给定条件执行不同的代码块,而EVALUATE语句则用于根据不同的条件执行不同的操作。

COBOL经典面试题库

COBOL经典面试题库

我们经常用‎来复习用的‎,大多数版‎本只有英文‎,这个好像‎还是基地的‎同事们一起‎翻译出来的‎Q1)‎Name‎the ‎d ivis‎i ons ‎i n a ‎C OBOL‎prog‎r am ?‎.A1)‎IDEN‎T IFIC‎A TION‎DIVI‎S ION,‎ENVI‎R ONME‎N T DI‎V ISIO‎N, DA‎T A DI‎V ISIO‎N, PR‎O CEDU‎R E DI‎V ISIO‎N.Q:‎列举COB‎O L的DE‎V ISIO‎NA:标‎识部,环境‎部,数据部‎,过程部‎Q2) ‎W hat ‎a re t‎h e di‎f fere‎n t da‎t a ty‎p es a‎v aila‎b le i‎n COB‎O L?A‎2) Al‎p ha-n‎u meri‎c (X)‎, alp‎h abet‎i c (A‎) and‎nume‎r ic (‎9).Q‎:COBO‎L有哪些可‎用的数据类‎型A:字‎符型(这里‎指的是包含‎字母和数字‎),字母型‎,数字型‎Q3) ‎W hat ‎d oes ‎t he I‎N ITIA‎L IZE ‎v erb ‎d o? -‎GSA‎3) Al‎p habe‎t ic, ‎A lpha‎n umer‎i c fi‎e lds ‎& alp‎h anum‎e ric ‎e dite‎d ite‎m s ar‎e set‎to S‎P ACES‎. Num‎e ric,‎Nume‎r ic e‎d ited‎item‎s set‎to Z‎E RO. ‎F ILLE‎R , O‎C CURS‎DEPE‎N DING‎ONi‎t ems ‎l eft ‎u ntou‎c hed.‎Q:IN‎I TIAL‎I ZE这个‎词做了些什‎么A:将‎字母,字符‎,数字区域‎都置成空格‎(置空),‎将数字区置‎0, FI‎L LER和‎O CCUR‎S DEP‎E NDIN‎G ON项‎不处理‎Q4) W‎h at i‎s 77 ‎l evel‎used‎for ‎?A4)‎Elem‎e ntar‎y lev‎e l it‎e m. C‎a nnot‎be s‎u bdiv‎i sion‎s of ‎o ther‎item‎s (ca‎n not ‎b equ‎a lifi‎e d), ‎n or c‎a n th‎e y be‎subd‎i vide‎d the‎m selv‎e s.Q‎:77层有‎什么作用‎A:基本层‎数据项,不‎能用做细分‎别的层,也‎不能被细分‎(来源:‎h ttp:‎//www‎.newc‎o in.i‎n fo)‎Q5) ‎W hat ‎i s 88‎leve‎l use‎d for‎?A5‎) For‎cond‎i tion‎name‎s.Q:‎88层有什‎么作用A‎:条件逻辑‎层Q6‎) Wha‎t is ‎l evel‎66 u‎s ed f‎o r ?‎A6) F‎o r RE‎N AMES‎clau‎s e.Q‎:66层有‎什么作用‎A:重命名‎层Q7‎) Wha‎t doe‎s the‎IS N‎U MERI‎C cla‎u se e‎s tabl‎i sh ?‎A7) ‎I S NU‎M ERIC‎can ‎b e us‎e d on‎alph‎a nume‎r ic i‎t ems,‎sign‎e d nu‎m eric‎& pa‎c ked ‎d ecim‎a l it‎e ms a‎n d un‎s igne‎d num‎e ric ‎& pac‎k ed d‎e cima‎l ite‎m s. I‎S NUM‎E RIC ‎r etur‎n s TR‎U E if‎the ‎i tem ‎o nly ‎c onsi‎s ts o‎f 0-9‎. How‎e ver,‎if t‎h e it‎e m be‎i ng t‎e sted‎is a‎sign‎e d it‎e m, t‎h en i‎t may‎cont‎a in 0‎-9, +‎and ‎- .Q‎:IS N‎U MERI‎C这个子句‎怎么确定(‎也就是说确‎定句子的真‎值)A:‎I S NU‎M ERIC‎用在字符项‎,带符号数‎字,浮点数‎,不带符号‎数。

COBOL习题

COBOL习题

COBOL习题COBOL语言测试试卷二一、选择题(共20分)1.关于COBOL语言,正确的是()A.COBOL非常适合用于科学计算B.可以用COBOL写操作系统内核程序C.COBOL追求类自然英语,因此保留字较多D.COBOL程序非常强调数据类型2.关于COBOL程序结构,下面错误的是()A.COBOL程序一般由定义部、环境部、数据部和过程部组成B.COBOL程序的某个部下面不一定有节,但至少应该有一个段C.过程部里可以直接包含语句,而不必要有节或段D.COBOL程序也有顺序、分支和循环等结构3.下面变量名错误的是()A.-class B.class-1 C.SPACED.class1-4.下面不是COBOL保留字的是()A.IDENTIFICATIONB.ZEROC.ALLD.begin5.关于PIC语句,下面叙述不正确的是()A.普通PIC语句刻画了变量的数据类型及尺寸B.PIC语句可以通过VALUE短语给变量付初值C.PIC语句只出现在数据部中D.PIC语句不能定义数据的显示和打印格式6.关于记录缓冲器,下面说法正确的是()A.COBOL程序用到的每个输入或输出文件都必须有独立的记录缓冲器B.COBOL程序用到的每个输入或输出文件可以有多个记录缓冲器C.如果COBOL程序用到的多个输入或输出文件的记录内容和格式完全相同,则它们可以共用记录缓冲器D.COBOL程序用到的输入或输出文件可以没有记录缓冲器7.关于COBOL的顺序文件处理,正确的是()A.COBOL程序可以直接使用输入或输出文件的文件名B.COBOL程序只能通过内部文件名来使用输入或输出文件C.内部文件名和外部文件名之间的指代关系在数据部里说明D.用到输入或输出文件的COBOL程序可以没有环境部8.下面IF语句中的条件部分隐含的主体是()IF VarA>VarB AND VarC AND VarDDISPLAY“VarA is the Greatest”END-IFA.VarAB.VarBC.VarCD.VarA>9.关于Edited Picture语句,不正确的是()A.它极大地满足了我们对财务数据的格式化要求B.它不能包含A、9、X、V、S等普通符号C.它定义的变量不能参与四则运算D.它定义的变量可以接受四则运算结果10.关于Table和Group,不正确的是()A.Table实际上可以看成有多个同名子项目的GroupB.Table的元素可以是GroupC.Group的子项目可以是TableD.Group的子项目不能是Table二、填空题1.A变量的值及B变量的定义如下,在执行MOVEA TO B后,B的值各是多少?(20分)A的值B的定义B的值85PIC ZZZ.99_________________13PIC ZZZ.ZZ_________________120138PIC99/99/99_________________2.58PIC-*(3).99_________________5000PIC9(4)_________________-5000PIC9(4)C_________________1024PIC9999._________________123.5PIC-9(3).9_________________123.5PIC+9(3).9_________________2.58PIC$Z(3).99_________________2.要写一个COBOL程序从一个文件中输入客户信息,然后将每个客户信息分行输出到另一个文件中作为客户报告,其中输入的每一个客户输入记录包含以下数据:COLUMNS CONTENTS ――――――――――――――――――――――――――――――――――――1-6Customer Number(5digits plus1letter)7-26Customer Name27-46Street Address47-61City62-63Z-letter State Addreviation64-73Zip code(fromat:99999-9999)74-77Year of last purchase78-80unused要求输出文件中的客户报告格式如下所示(每行80字符,各项之间空2格):――――――――――――――――――――――――――――――――――――JOE SCHMOE199612345S314COLLECE DRIVEDEKALB IL601115-1342KELLY ANDERSON199412354A723420TH STREETBYRON IL61113-4218ANN WILSON199721345W2345WILSHIRE BLVDCHICAGO IL61234-21345填空完成以下COBOL程序,以达到上述目的。

COBOL面试问题大全

COBOL面试问题大全

COBOL面试问题大全 the divisions in a COBOL program.IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION.1. What are the different data types available in COBOL?Alpha-numeric (X), alphabetic (A) and numeric (9).2. What does the INITIALIZE verb do? –Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES.Numeric, Numeric edited items set to ZERO.FILLER , OCCURS DEPENDING ON items left untouched.3. What is 77 level used for ?Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.4. What is 88 level used for ?For condition names.5. What is level 66 used for ?For RENAMES clause.6. What does the IS NUMERIC clause establish ?IS NUMERIC can be used on alphanumeric items, signed numeric & pa cked decimal items and usigned numeric & packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if th e item being tested is a signed item, then it may contain 0-9, + and - .7. What does the IS NUMERIC clause establish ?IS NUMERIC can be used on alphanumeric items, signed numeric & pa cked decimal items and usigned numeric & packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if th e item being tested is a signed item, then it may contain 0-9, + and - .8. Can the OCCURS clause be at the 01 level?No.9. What is the difference between index and subscript?Subscript refers to the array occurrence while index is the displaceme nt (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET.Need to have index for a table in order to use SEARCH, SEARCH ALL.10. What is the difference between SEARCH and SEARCH ALL? SEARCH - is a serial search.SEARCH ALL - is a binary search & the table must be sorted ( ASCEN DING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL11. What should be the sorting order for SEARCH ALL?It can be either ASCENDING or DESCENDING. ASCENDING is default.If you want the search to be done on an array sorted in descending o rder, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).12. What is binary search?Search on a sorted array. Compare the item to be searched with the i tem 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.13. My program has an array defined to have 10 items. Due to a bug,I find that even if the program access the 11th item in this array, th e program does not abend. What is wrong with it?Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.14. How do you sort in a COBOL program? Give sort file definition, so rt statement syntax and meaning.Syntax:SORT file-1 ON ASCENDING/DESCENDING KEY key....USING file-2GIVING file-3.USING can be substituted by INPUT PROCEDURE IS para-1 THRU para -2GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU p ara-2.file-1 is the sort workfile and must be described using SD entry in FIL E SECTION.file-2 is the input file for the SORT and must be described using an F D entry in FILE SECTION and SELECT clause in FILE CONTROL.file-3 is the outfile from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause 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 R ELEASEd to the sort work file from the input procedure.OUTPUT PROCEDURE is executed after all records have been sorted. R ecords from the sort work file must be RETURNed one at a time to th e output procedure.15. How do you define a sort file in JCL that runs the COBOL program?Use the SORTWK01, SORTWK02,..... dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a min imum of 3 is required.16. What are the two ways of doing sorting in a COBOL program? Give the formats.See question 16.17. Give the format of USING and GIVING in SORT statement. What a re the restrictions with it?See question 16. Restrictions - Cannot massage records, canot select r ecords to be sorted.18. What is the difference between performing a SECTION and a PARA GRAPH?Performing a SECTION will cause all the paragraphs that are part of t he section, to be performed.Performing a PARAGRAPH will cause only that paragraph to be perfor med.19. What is the use of EVALUATE statement?Evaluate is like a case statement and can be used to replace nested If s. The difference between EVALUATE and case is that no 'break' is req uired for EVALUATE i.e. control comes out of the EVALUATE as soon a s one match is made.20. What are the different forms of EVALUATE statement? EVALUATE EVALUATE SQLCODE ALSO FILE-STATUSWHEN A=B AND C=D WHEN 100 ALSO '00'imperative stmt imperative stmtWHEN (D+X)/Y = 4 WHEN -305 ALSO '32'imperative stmt imperative stmtWHEN OTHER WHEN OTHERimperative stmt imperative stmtEND-EVALUATE END-EVALUATEEVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE WHEN 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-EVALUATE21. How do you come out of an EVALUATE statement?After the execution of one of the when clauses, the control is automat ically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code.22. In an EVALUATE statement, can I give a complex condition on a when clause?Yes23. What is a scope terminator? Give examples.Scope terminator is used to mark the end of a verb e.g. EVALUATE, E ND-EVALUATE; IF, END-IF.24. How do you do in-line PERFORM?PERFORM ... ...END PERFORM25. When would you use in-line perform?When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM paraname rather than in-line perfor m.26. What is the difference between CONTINUE & NEXT SENTENCE ?CONTINUE is like a null statement (do nothing) , while NEXT SENTENC E transfers control to the next sentence (!!) (A sentence is terminated by a period)27. What does EXIT do ?Does nothing ! If used, must be the only sentence within a paragraph.28. Can I redefine an X(100) field with a field of X(200)?Yes. Redefines just causes both fields to start at the same location. Fo r example:01 WS-TOP PIC X(1)01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).If you MOVE '12' to WS-TOP-RED,DISPLAY WS-TOP will show 1 whileDISPLAY WS-TOP-RED will show 12.30. What do you do to resolve SOC-7 error?Basically you need to correcting the offending data.Many times the reason for SOC7 is an un-initialized numeric item. Exa mine that possibility first.Many installations provide you a dump for run time abends ( it can be generated also by calling some subroutines or OS services thru asse mbly language). These dumps provide the offset of the last instruction at which the abend occurred. Examine the compilation output XREF li sting to get the verb and the line number of the source code at this o ffset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYS ABOUT etc ) in the JCL.If none of these are helpful, use judgement and DISPLAY to localize t he source of error.Some installtion might have batch program debugging tools. Use them.31. How is sign stored in Packed Decimal fields and Zoned Decimal fie lds?Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage.Zoned Decimal fields: As a default, sign is over punched with the num eric value stored in the last bite.32. How is sign stored in a comp-3 field?It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the n umber is -102 etc...33. How is sign stored in a COMP field ?In the most significant bit. Bit is on if -ve, off if +ve.34. What is the difference between COMP & COMP-3 ?COMP is a binary storage format while COMP-3 is packed decimal form at.35. What is COMP-1? COMP-2?COMP-1 - Single precision floating point. Uses 4 bytes.COMP-2 - Double precision floating point. Uses 8 bytes.36. How do you define a variable of COMP-1? COMP-2?No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.37. How many bytes does a S9(7) COMP-3 field occupy ?Will take 4 bytes. Sign is stored as hex value in the last nibble.General formula is INT((n/2) + 1)), where n=7 in this example38. How many bytes does a S9(7) SIGN TRAILING SEPARATE field occ upy ?Will occupy 8 bytes (one extra byte for sign).39. How many bytes will a S9(8) COMP field occupy ?4 bytes40. What is the maximum value that can be stored in S9(8) COMP? 9999999941. What is COMP SYNC?Causes the item to be aligned on natural boundaries. Can be SYNCHR ONIZED LEFT or RIGHT.For binary data items, the address resolution is faster if they are locat ed at word boundaries in the memory. For example, on main frame th e memory word size is 4 bytes. This means that each word will start f rom an address divisible by 4. If my first variable is x(3) and nextone is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. Yo u might see some wastage of memory, but the access to thiscomputational field is faster.42. What is the maximum size of a 01 level item in COBOL I? in COB OL II?In COBOL II: 1677721543. How do you reference the following file formats from COBOL progr ams:Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDIN G MODE IS F, BLOCK CONTAINS 0 .Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDI NG MODE IS F, do not use BLOCK CONTAINSVariable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECOR DING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECOR DING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length will be max rec length in pg m + 4.ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL.KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY ISRRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY ISPrinter File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING M ODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).44. What are different file OPEN modes available in COBOL?Open for INPUT, OUTPUT, I-O, EXTEND.45. What is the mode in which you will OPEN a file for writing? OUTPUT, EXTEND46. In the JCL, how do you define the files referred to in a subroutine ?Supply the DD cards just as you would for files referred to in the mai n program.47. Can you REWRITE a record in an ESDS file? Can you DELETE a re cord from it?Can rewrite(record length must be same), but not delete.48. What is file status 92?Logic error. e.g., a file is opened for input and an attempt is made to write to it.49. What is file status 39 ?Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pg m & the JCL (or the dataset label). You will get file status 39 on an O PEN.50. What is Static,Dynamic linking ?In static linking, the called subroutine is link-edited into the calling pr ogram , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).A statically called subroutine will not be in its initial state the next tim e it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.51. What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? ( applicable to onlyMVS/ESA Enterprise Server).These are compile/link edit options.AMODE - Addressing mode. RMODE - Residency mode.AMODE(24) - 24 bit addressing. AMODE(31) - 31 bit addressing. AMO DE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE. RMODE(24) - Resides in virtual storage below 16 Meg line. Use this fo r 31 bit programs that call 24 bit programs. (OS/VS Cobol pgms use 24 bit addresses only).RMODE(ANY) - Can reside above or below 16 Meg line.52. What compiler option would you use for dynamic linking? DYNAM.53. What is SSRANGE, NOSSRANGE ?These are compiler options w.r.t subscript out of range checking. NOS SRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.54. How do you set a return code to the JCL from a COBOL program?Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.55. How can you submit a job from COBOL programs?Write JCL cards to a dataset with//xxxxxxx SYSOUT=(A,INTRDR) where 'A' is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file.56. What are the differences between OS VS COBOL and VS COBOL II?OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bit addressing modes.Report writer is supported only in OS/VS Cobol.USAGE IS POINTER is supported only in VS COBOL II.Reference modification eg: WS-VAR(1:2) is supported only in VS COB OL II.EVALUATE is supported only in VS COBOL II.Scope terminators are supported only in VS COBOL II.OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds.Under CICS Calls between VS COBOL II programs are supported57. What are the steps you go through while creating a COBOL progra m executable?DB2 precompiler (if embedded sql used), CICS translator (if CICS pg m), Cobol compiler, Link editor.If DB2 program, create plan by binding the DBRMs58. Can you call an OS VS COBOL pgm from a VS COBOL II pgm ? In non-CICS environment, it is possible. In CICS, this is not possible.。

COBOL语言测试试卷(一)

COBOL语言测试试卷(一)

COBOL语言测试试卷(一)COBOL语言测试试卷(一)一、选择题(共10分)1、关于COBOL语言,下述描述中正确的是:()A.COBOL可以用于开发操作系统。

B.COBOL还可以用于开发编译器。

C.COBOL主要用于编写面向商业的应用程序。

D.如今比较少用COBOL开发应用程序。

2、不属于COBOL程序的部的是:()A.过程部。

B.程序部。

C.数据部D.环境部3、COBOL代码中最小的单位是:()A. DivisionB. SectionC. SentenceD. Statement4、COBOL程序中的数据在哪个部中定义?()A.过程部。

B.环境部。

C.数据部D.定义部5、COBOL程序中如果有环境部的话,应置于:()A.过程部之后定义部之前。

B.定义部之后过程部之前。

C.定义部之后数据部之前。

D.数据部之后过程部之前。

6、定义部中不可缺少的段名是:()A.PROGRAM-IDB.AUTHORC.FILE SECTIOND.PROGRAM7、COBOL程序中一般变量在哪里定义?()A.定义部B.环境部C.数据部的FILE SECTIOND.数据部的WORKING-STORAGE SECTION8、在过程部中,可以没有的是:()A.SECTIONB.PARAGRAPHC.SENTENCED.STATEMENT9、当一个COBOL编译器区分A区和B区的时候,必须从B区开始的是:()A.段名B.节名和01级数据C.部名D.过程部里的Sentences。

10、在COBOL程序中,下列用户自定义的名称有效的是:()A.This resultB.-GrosspayC.Grosspay-D.Gross-pay二、判断题(共20分)1、在写COBOL程序时,数据名称可以随意写,只要合乎语法就行。

()2、就象其它编程语言一样,COBOL允许程序员自定义常量名。

()3、COBOL程序中用到的每个变量都必须在数据部里声明。

cobol面试题

cobol面试题

JCl:1.你认为JCL是做什么的?JCL大体由几个关键语句组成?什么是作业结束的标志?作业控制语言,JCL由三个关键语句JOB EXEC DD.结束标志://*2.什么是流内数据?怎样定义流内数据?DD *和DD DATA语句有什么不同之处?3.VSAM数据集和普通的数据集相比有什么优势,如何用JCL创建,编辑,修改VSAM数据集?4.你使用过哪些系统自带的JCL utility,说一说SORT(排序用)的控制选项中include和member是做什么的?5.COND参数是做什么的,GE是什么若后面加上only参数或者even有什么不同COBOL1.外部文件和COBOL程序是如何关联起来的,读写文件是如何实现的?2.说一说COBOL中有几种数据类型,COMP COMP-3 packed是什么?如果一个13位的数据用COMP-3形式存储实际上他占了多少个位?3.如果一个大型的程序abend了或者出错了,你将采用什么方式调试排错?4.go to ;continue语句有什么区别?5.循环语句perform有四种形式,分别介绍一下。

如何控制循环变量在循环前检测还是在循环后检测,如何控制循环步长?出现死循环的常见原因是什么?你怎样排除?6.静态程序调用和动态程序调用有什么不同?程序间是如何进行参数传递的?如何实现动态调用?7.如何在COBOL中使用汉字等双字节字符?CICS1.谈谈CICS是做什么用的,联机程序和批量程序有什么不同,什么是伪会话?2.一个含有CICS的程序编译连接运行,和纯粹的COBOL程序有什么不同?3.在使用一个资源前,必须采取什么步骤?4.什么是物理映像,什么是字符映像,二者有是什么关系,在SEND MAP后参数data only和map only是什么意思?5,属性skip是什么,ENQ和DEQ起什么作用?DB21,怎样在一个表里面批量插入大量数据?2,嵌入了SQL语句的程序怎样编译运行?在绑定阶段系统依据什么去识别相关的模块?3.什么是外左连结?4.如何修检索出一条记录,然后修改它?TSO1作业运行完之后,如何查看结果,如何找出程序错误和警告?2如何定义数据集,检索数据?。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

COBOL面试1—30题答案A1) IDENTIFICA TION DIVISION, ENVIRONMENT DIVISION, DA TA DIVISION, PROCEDURE DIVISION.Q:列举COBOL的DEVISIONA:标识部,环境部,数据部,过程部A2) Alpha-numeric (X), alphabetic (A) and numeric (9).Q:COBOL有哪些可用的数据类型A:字符型(这里指的是包含字母和数字),字母型,数字型A3) Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. FILLER , OCCURS DEPENDING ON items left untouched. Q:INITIALIZE这个词做了些什么A:将字母,字符,数字区域都置成空格(置空),将数字区置0,FILLER和OCCURS DEPENDING ON项不处理A4) Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.Q:77层有什么作用A:基本层数据项,不能用做细分别的层,也不能被细分A5) For condition names.Q:88层有什么作用A:条件逻辑层A6) For RENAMES clause.Q:66层有什么作用A:重命名层A7) IS NUMERIC can be used on alphanumeric 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用在字符项,带符号数字,浮点数,不带符号数。

如果目标项只含0~9则返回TRUE。

但是,如果待测项目是个带符号数,那么他就含有0-9还有+和-A8) ARRAYS.05 ARRAY1 PIC X(9) OCCURS 10 TIMES.05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEXQ:COBOL中怎么建表/数组A:如上.A9) No.Q:OCCURS 子句能用在第一层吗A:不能A10) Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET. Need to have index for a table in order touse SEARCH, SEARCH ALL.Q:索引和下标有什么区别A:下标可以指定数组中任意中位置的元素(只要知道其下标),下标只能是数字型常量或者数字型变量(但是不能在指定的时候修改,如:A(K+1)这样是不行的,要修改的话要在指定的外部改,如:ADD 1 TO K,而索引的话是从表头/数组头开始检索(以BY N的指定检索规律往后滚)再者,索引只能通过PERFORM, SEARCH 和SET来修改,如果要在一个表中使用SEARCH, SEARCH ALL,那这个表就要有索引(因为SEARCH, SEARCH ALL的参数中指定索引,所以即使其有很多限制还是得用它)A11) 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叉树的都不会陌生),在使用SEARCH ALL 前表必须有一个递增/递减的KEY,并且表已经按照其KEY值排序了,这样才能使用SEARCH ALLA12) It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (Y ou must load the table in the specified order).Q:为了使用SEARCH ALL,存贮顺序是怎么样的A:他必须是递增或者是递减的,默认地政。

如果你想在一个递减顺序存贮的表/数组使用搜索的话,那么当定义表/数组的时候你应该加一个DESCENDING KEY子句(这之前表要已经按指定的顺序排序了)A13) Search on a sorted array. Compare the item to be searched with the 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叉树的查找规律就很好理解,因为所谓的“表“本身也就是数组A14) Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.Q:我的程序有个数组定义了10项。

因为有个BUG,我发现即使访问第11项,程序也不异常终止。

那是出了什么问题A:必须使用编译器的一个选项SSRANGE,如果你想检查数组的超界问题。

默认是NOSSRANGEA15) 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 substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.Q:怎么在一个COBOL程序中排序?给出排序文件的定义,排序语法和意思A:同上A16) Use the SORTWK01, SORTWK02,….. dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required.Q:怎么在JCL中定义一个排序文件来跑这个COBOL程序A:用SORTWK01, SORTWK02,…..作为DA TA SET NAME。

用多少取决于你要排序的数量,但是至少3个。

A17) Performing a SECTION will cause 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:简单来说的话就是区的概念比段大,执行一个区就要执行其内部所有段,执行段的话只执行该段。

A18) Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EV ALUA TE and case is that no ‘break’ is required for EV ALUA TE i.e. control comes out of the EV ALUA TE as soon as one match is made.Q:EV ALUATE语句有什么作用A:EV ALUA TE就象个CASE语句(多重开关语句,学过C的总知道吧),不同点在于EV ALUA TE不需要BREAK,一旦匹配就跳出EV ALUA TE语句了A19) EV ALUA TE TRUEWHEN condition statement-1Statement-2WHEN condition statement-3Statement-4WHEN other other statementsEND-EV ALUA TE.Q: EV ALUATE语句有哪些类型?A20) After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EV ALUA TE statement. There is no need of any extra code.Q:怎么跳出一条EV ALUATE语句?A:象18题目说的那样,一旦匹配了某一个“WHEN“语句就自动跳出了,不需要什么额外的代码来跳出A21) Yes.Q:在一个EV ALUATE语句的某个WHEN分支中能否再插入复杂的情况(也就是嵌套)A:当然可以,当多个参数作为控制变量的时候1个WHEN内部可以嵌套更多的情况A22) Scope terminator is used to mark the end of a verb e.g. EV ALUA TE, END-EV ALUA TE; IF, END-IF.Q:什么是结束终止符?A:结束终止符是搭配一些范围指令的,也就是标识一些范围指令的结束。

相关文档
最新文档