成都cobol面试题
cobol面试题
cobol面试题在计算机编程领域中,COBOL(全称为COmmon Business-Oriented Language)是一种广泛使用的高级编程语言,特别适合用于处理商业数据处理应用。
COBOL于1959年首次发布,并成为企业级应用的主要编程语言之一。
COBOL具有可读性强、易于维护和横向扩展的特点,至今仍广泛应用于金融、保险、银行等行业。
本文将为您介绍一些常见的COBOL面试题,帮助您准备面试并提高成功率。
以下是一些常见的COBOL面试题,供您参考:1. COBOL编程语言的特点是什么?COBOL编程语言具有以下特点:- 可读性强:COBOL使用英语类似的语法和词汇,代码易于理解和维护。
- 商业导向:COBOL专为商业应用程序设计,具有处理大量数据和复杂逻辑的能力。
- 文件处理:COBOL在文件处理方面非常强大,能够处理大型数据集和复杂文件结构。
- 面向记录:COBOL是一种面向数据记录的编程语言,适用于处理各种类型的记录和数据结构。
2. COBOL的数据类型有哪些?COBOL支持多种数据类型,包括:- Numeric:数值类型,包括整数(如INTEGER、COMP-3)和浮点数(如FLOAT、PACKED-DECIMAL)。
- Alphabetic:字母类型,用于处理字符和字符串数据。
- Alphanumeric:字母数字类型,包括字母、数字和特殊字符。
- DBCS(Double-Byte Character Set):双字节字符集类型,用于处理多字节字符,如中文、日文等。
3. COBOL中的文件处理方式有哪些?COBOL提供了以下文件处理方式:- Sequential:顺序文件处理,按照文件记录的顺序逐条读取和写入数据。
- Indexed:索引文件处理,使用索引键值进行数据的读取和写入。
- Relative:相对文件处理,根据记录的相对位置进行数据的读取和写入。
- Dynamic:动态文件处理,可以根据程序运行时的需求动态打开、关闭和访问文件。
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题
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).。
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个重要的参数:LIMIT NOEMPTY 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参数,表示什么情况下作业步被执行/不被执行。
COND=(4,LT,STEP2)5.IEBCOPY与IEBGENER有什么区别?IEFBR14是起什么作用的?IEBCOPY:对分区数据集进行拷贝、压缩或合并IEBGENER:拷贝顺序数据集,或将顺序数据集转为分区数据集IEFBR14实际是一个空程序,什么也不做,只是返回返回码0,但是使用它可以进行JCL 语言的各种处理,如DD 语句中创建数据集等。
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程序时,数据名称可以随意写,只要合乎语法就行。
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面试题及答案
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面试题
JCl部分:1.你认为JCL是做什么的?JCL大体由几个关键语句组成?什么是作业结束的标志?Jcl:作业控制语言,控制作业的执行。
管理系统资源和数据集。
(类似TSO交互式菜单对数据集的管理)对COBOL程序编译和执行。
(COBOL代码→JCL编译→机器码→JCL执行)Job、dd、exec、proc//2.什么是流内数据?怎样定义流内数据?DD *和DD DATA语句有什么不同之处?由DD语句,DD*,DD DATE,DD DUMY 加数据构成DD *结束符可以为//或/*而DD DATE 结束符只能为/*3.VSAM数据集和普通的数据集相比有什么优势,如何用JCL创建,编辑,修改VSAM数据集?4.你使用过哪些系统自带的JCL utility,说一说SORT(排序用)的控制选项中include和member是做什么的?IEFBR14 IEBGENER IEBCOPY SORT IDCAMS5.COND参数是做什么的,GE是什么若后面加上only参数或者even有什么不同COBOL判断作业步是否执行Only:只有当上一步作业步出现异常时,本作业才执行Even:不管上一作业步是否有异常时,本作业步继续执行COBOL部分:1.Q:外部文件和COBOL程序是如何关联起来的,读写文件是如何实现的?A:在环境部中输入输出节中建立与外部文件的关系在数据部中定义文件,然后在过程部中需要打开文件、然后再读文件、写记录,最后通过执行作业流实现读写文件2.Q:说一说COBOL中有几种数据类型,COMP COMP-3 packed是什么?如果一个13位的数据用COMP-3形式存储实际上他占了多少个位?A:常量、变量、Comp:压缩二进制Com-3:压缩十进制7位3.Q:go to ;continue语句有什么区别?A: Go to:无条件跳转到指定语句执行Continue:相当于空操作符,什么都不执行,程序执行到此处,跳过continue,执行下一句4.Q:循环语句perform有四种形式,分别介绍一下。
COBOL经典面试题库
我们经常用来复习用的,大多数版本只有英文,这个好像还是基地的同事们一起翻译出来的Q1)Namethe d ivisi ons i n a C OBOLprogr am ?.A1)IDENT IFICA TIONDIVIS ION,ENVIR ONMEN T DIV ISION, DAT A DIV ISION, PRO CEDUR E DIV ISION.Q:列举COBO L的DEV ISIONA:标识部,环境部,数据部,过程部Q2) W hat a re th e dif feren t dat a typ es av ailab le in COBO L?A2) Alp ha-nu meric (X), alph abeti c (A) andnumer ic (9).Q:COBOL有哪些可用的数据类型A:字符型(这里指的是包含字母和数字),字母型,数字型Q3) W hat d oes t he IN ITIAL IZE v erb d o? -GSA3) Alp habet ic, A lphan umeri c fie lds & alph anume ric e dited item s are setto SP ACES. Nume ric,Numer ic ed iteditems setto ZE RO. F ILLER , OC CURSDEPEN DINGONit ems l eft u ntouc hed.Q:INI TIALI ZE这个词做了些什么A:将字母,字符,数字区域都置成空格(置空),将数字区置0, FIL LER和O CCURS DEPE NDING ON项不处理Q4) Wh at is 77 l evelusedfor ?A4)Eleme ntary leve l ite m. Ca nnotbe su bdivi sions of o theritems (can not b equa lifie d), n or ca n the y besubdi vided them selve s.Q:77层有什么作用A:基本层数据项,不能用做细分别的层,也不能被细分(来源:h ttp://www.newco in.in fo)Q5) W hat i s 88level used for?A5) Forcondi tionnames.Q:88层有什么作用A:条件逻辑层Q6) What is l evel66 us ed fo r ?A6) Fo r REN AMESclaus e.Q:66层有什么作用A:重命名层Q7) What does theIS NU MERIC clau se es tabli sh ?A7) I S NUM ERICcan b e use d onalpha numer ic it ems,signe d num eric& pac ked d ecima l ite ms an d uns igned nume ric & pack ed de cimal item s. IS NUME RIC r eturn s TRU E ifthe i tem o nly c onsis ts of 0-9. Howe ver,if th e ite m bei ng te stedis asigne d ite m, th en it mayconta in 0-9, +and - .Q:IS NU MERIC这个子句怎么确定(也就是说确定句子的真值)A:I S NUM ERIC用在字符项,带符号数字,浮点数,不带符号数。
汇丰软件面试常问问题的回答1
.职业规划英语问的问题主要是关于SAP INTERNSHIP这个职位,对它的了解啊,希望能从INTERN里获得什么啊之类的Accumulate a lot of Work experience. I can learn much more knowledge about coding, software designing and so on. Do some ready for sap, communicate with the people in GLTc well问自己可以为汇丰做些什么贡献也就是你在这方面有些什么能力。
As I have participated in several projects, have accumulated a little foundation on software when I was in Collage, so I can do some coding, software design and testing, and so on..问为何考研,为何转专业做ITBecause my major is computer science ,it needs a lot of work experience ,the other hand ,my family did not allow me to, they can not afford my schooling any more, and I want to let them live better more early.“你知道如果进来汇丰后会做些什么工作吗?”“会用到些什么?”Frankly speaking, I know little about it, I just know that gltc is towards systems of bank, it will be using the COBOL and java language ,and so on,also the chance of working on mainframe“你为什么会选择汇丰”GLTC have a promising development prospect, and offer a “PATH” to IT career development., provides plenty of valuable training opportunities to employees. Also, big companies often have their own culture. Good company culture can benefit me greatly. What’s more, I have a lot of chances to improve my English, both in oral and written.“你的职业规划是什么?”Just like stud y, career plan should be accomplished step by step. In the first few years, I’m willing to work from the very bottom, for example, act as a coding programmer. Since technologies update very quickly, I will keep learning new skills without end. My study ability can guarantee my performance in the future. As time going on, I will master some advanced skills and become an experienced employee. To be a senior specialist is my dream at this moment. I believe then I can contribute more to my company. A few years later, after I have made a solid foundation in various skills, including technical and communication, I will put more concentration on project management.At that time, hope that I am able to take charge of large software projects. Of course, that’s a mu ch higher level and needs rich experience and deep foundation.二.项目结合软件工程J: Which project have you done?I participated in several projects which belong to Computer Engineering R&D Center, I think my impressive project is “College Entrance Examination register System of Guangdong”, we used java and jsp to complete this project, this system is a website, with the help of the website the examinees of Guangdong Province can register easily and the administrator also can manage the data convenientlyStrictly speaking my task is just coding, but in factForm these project experiences of the Computer Engineering R&D Center, I improved my coding ability greatly, met something new during the work, which greatly enhanced my knowledge and widen my view, obtained abundantexperience of analyzing and designing an application system, understood the process of the software development, gained ability of adapting to a new environment in a short time, also improved my ability of communication and cooperation.J: Can you tell something about software engineering?项目和技术,对软件工程的了解、项目里担当角色、项目过程这几方面面很多。
JCLCOBOLDB2CICSVASM考试题
Name: _____________ Grade: ____________
1. What is the difference between the JOBLIB and the STEPLIB statements?
The position difference.joblib adapts whole job,steplib only exec.
指定到那个proc的作业步,cond(2,eq,),nullify用even
10. How do you create a temporary dataset? Where will you use them?
Dsn=&& 参数(new,pass,delete)下去的,这样就是temporary
4. What are three major types of JCL statements? What are their functions?
Job,exec,dd statements.
5. What is the difference between catalogue procedure and In-Stream procedure?
6. What are the differences between Temporary Storage Queue (TSQ) and Transient Data Queue (TDQ)?
7. what do the following transactions do?
CEDF:
2. Name some of the JCL statements that are not allowed in PROCs.
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搜索题库
Q1) Name the divisions in a COBOL program ?.A1) IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION.Q2) What are the different data types available in COBOL?A2) Alpha-numeric (X), alphabetic (A) and numeric (9).Q3) What does the INITIALIZE verb do? - GSA3) Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. FILLER , OCCURS DEPENDING ON items left untouched.Q4) What is 77 level used for ?A4) Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.Q5) What is 88 level used for ?A5) For condition names.Q6) What is level 66 used for ?A6) For RENAMES clause.Q7) What does the IS NUMERIC clause establish ?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 - .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-INDEX.Q9) Can the OCCURS clause be at the 01 level?A9) No.Q10) 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, SEARCH ALL.Q11) What is the difference 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.Q12) 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 an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (Youmust load the table in the specified order).Q13) What is binary search?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.Q14) My program has an array defined to have 10 items. 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.Q15) 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 substituted 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 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 all records have been sorted. Records from the sort work file must be RETURNed one at a time to the output procedure.Q16) How do you define a sort file in JCL that runs the COBOL program?A16) Use the SORTWK01, SORTWK02,..... dd names in the step. Number of sort datasets depends on the volume of databeing sorted, but a minimum of 3 is required.Q17) What is the difference between performing a SECTION and a PARAGRAPH? - GS 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.Q18) What is the use of EVALUATE statement? - GSA18) Evaluate is like a case statement and can be used 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.Q19) What are the different forms of EVALUATE statement?A19)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 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 clauses, the control is automatically passed on to the next sentence after theEVALUATE statement. There is no need of any extra code.Q21) In an EVALUATE statement, can I give a complex condition on a when clause? A21) Yes.Q22) What is a scope terminator? Give examples.A22) Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE;IF, END-IF.Q23) How do you do in-line PERFORM? - GSA23) PERFORM ... <UNTIL> ...<sentences>END-PERFORMQ24) When would you use in-line perform?A24) 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 usePERFORM Para name rather than in-line perform.Q25) What is the difference between CONTINUE & NEXT SENTENCE ?A25) They appear to be similar, that is, the control goes to the next sentence in the paragraph. But, Next Sentence wouldtake the control to the sentence after it finds a full stop (.). Check out by writing the following code example, one ifsentence followed by 3 display statements (sorry they appear one line here because of formatting restrictions) If 1 > 0then next sentence end if display 'line 1' display 'line 2'. display 'line 3'. *** Note- there is a dot (.) only at the end ofthe last 2 statements, see the effect by replacing Next Sentence with Continue ***Q26) What does EXIT do ?A26) Does nothing ! If used, must be the only sentence within a paragraph.Q27) Can I redefine an X(100) field with a field of X(200)?A27) Yes. Redefines just causes both fields to start at the same location. For 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.A28) Can I redefine an X(200) field with a field of X(100) ?Q31)1 Yes.Q31)2 What do you do to resolve SOC-7 error? - GSQ31) Basically you need to correcting the offending data. Many times the reason for SOC7 is an un-initialized numeric item.Examine that possibility first. Many installations provide you a dump for run timeabend’s ( it can be generated alsoby calling some subroutines or OS services thru assembly language). These dumps provide the offset of the lastinstruction at which the abend occurred. Examine the compilation output XREF listing to get the verb and the linenumber of the source code at this offset. Then you can look at the source code to find the bug. To get capture theruntime dumps, you will have to define some datasets (SYSABOUT etc ) in the JCL. If none of these are helpful, usejudgement and DISPLAY to localize the source of error. Some installation might have batch program debuggingtools. Use them.Q32) How is sign stored in Packed Decimal fields and Zoned Decimal fields? Q32) 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 numeric value stored in the last bite.Q33) How is sign stored in a comp-3 field? - GSQ33) It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C ifyour number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc...Q34) How is sign stored in a COMP field ? - GSQ34) In the most significant bit. Bit is ON if -ve, OFF if +ve.Q35) What is the difference between COMP & COMP-3 ?Q35) COMP is a binary storage format while COMP-3 is packed decimal format.Q36) What is COMP-1? COMP-2?Q36) COMP-1 - Single precision floating point. Uses 4 bytes.COMP-2 - Double precision floating point. Uses 8 bytes.Q37) How do you define a variable of COMP-1? COMP-2?Q37) No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.Q38) How many bytes does a S9(7) COMP-3 field occupy ?Q38) 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 thisexample.Q39) How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?Q39) Will occupy 8 bytes (one extra byte for sign).Q40) How many bytes will a S9(8) COMP field occupy ?Q40) 4 bytes.Q41) What is the maximum value that can be stored in S9(8) COMP?Q41) 99999999Q42) What is COMP SYNC?Q42) Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT. For binary dataitems, the address resolution is faster if they are located at word boundaries in the memory. For example, on mainframe the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If myfirst variable is x(3) and next one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will startfrom byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4.You might see some wastage of memory, but the access to this computational field is faster.Q43) What is the maximum size of a 01 level item in COBOL I? in COBOL II? Q43) In COBOL II: 16777215Q44) How do you reference the following file formats from COBOL programs: Q44)Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F,BLOCK CONTAINS 0 .Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F,do not use BLOCK CONTAINSVariable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCKCONTAINS 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 RECORDING MODE IS V, do not useBLOCK CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length willbe max rec length in pgm + 4.ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL.KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATERECORD KEY IS RRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY IS Printer File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCKCONTAINS 0. (Use RECFM=FBA in JCL DCB).Q45) What are different file OPEN modes available in COBOL?Q45) Open for INPUT, OUTPUT, I-O, EXTEND.Q46) What is the mode in which you will OPEN a file for writing? - GS Q46) OUTPUT, EXTENDQ47) In the JCL, how do you define the files referred to in a subroutine ? Q47) Supply the DD cards just as you would for files referred to in the main program.Q48) Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?Q48) Can rewrite (record length must be same), but not delete.Q49) What is file status 92? - GSQ49) Logic error. e.g., a file is opened for input and an attempt is made to write to it.Q50) What is file status 39 ?Q50) Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the dataset label). Youwill get file status 39 on an OPEN.Q51) What is Static and Dynamic linking ?Q51) In static linking, the called subroutine is link-edited into the calling program , 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 time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.Q52) What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? (applicable to only MVS/ESAEnterprise Server).Q52) These are compile/link edit options. Basically AMODE stands forAddressing mode and RMODE for Residencymode.AMODE(24) - 24 bit addressing;AMODE(31) - 31 bit addressingAMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE. RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 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.Q53) What compiler option would you use for dynamic linking?Q53) DYNAM.Q54) What is SSRANGE, NOSSRANGE ?Q54) These are compiler options with respect to subscript out of range checking. NOSSRANGE is the default and if chosen,no run time error will be flagged if your index or subscript goes out of the permissible range.Q55) How do you set a return code to the JCL from a COBOL program?Q55) Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.Q56) How can you submit a job from COBOL programs?Q56) Write JCL cards to a dataset with //xxxxxxx SYSOUT= (A,INTRDR) where 'A' is output class, and dataset should beopened for output in the program. Define a 80 byte record layout for the file.Q57) What are the differences between OS VS COBOL and VS COBOL II?Q57) OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bitaddressing modes.I. Report writer is supported only in OS/VS Cobol.II. USAGE IS POINTER is supported only in VS COBOL II.III. Reference modification e.g.: WS-VAR(1:2) is supported only in VS COBOL II.IV. EVALUATE is supported only in VS COBOL II.V. Scope terminators are supported only in VS COBOL II.VI. OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds.VII. Under CICS Calls between VS COBOL II programs are supported.Q58) What are the steps you go through while creating a COBOL program executable?Q58) DB2 precompiler (if embedded SQL used), CICS translator (if CICS pgm), Cobol compiler, Link editor. If DB2program, create plan by binding the DBRMs.Q59) Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?Q59) In non-CICS environment, it is possible. In CICS, this is not possible.Q60) What are the differences between COBOL and COBOL II?A60) There are at least five differences:COBOL II supports structured programming by using in line Performs and explicit scope terminators, It introducesnew features (EVALUATE, SET. TO TRUE, CALL. BY CONTEXT, etc) It permits programs to be loaded andaddressed above the 16-megabyte line It does not support many old features (READY TRACE, REPORT-WRITER,ISAM, Etc.), and It offers enhanced CICS support.Q61) What is an explicit scope terminator?A61) A scope terminator brackets its preceding verb, e.g. IF .. END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, EVALUATE, SEARCH and STRING.Q62) What is an in line PERFORM? When would you use it? Anything else to say about it?A62) The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs.Q63) What is the difference between NEXT SENTENCE and CONTINUE?A63) NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II's finer implementations). It's safest to use CONTINUE rather than NEXT SENTENCE in COBOL II.Q64) What COBOL construct is the COBOL II EVALUATE meant to replace?A64) EVALUATE can be used in place of the nested IF THEN ELSE statements.Q65) What is the significance of 'above the line' and 'below the line'?A65) Before IBM introduced MVS/XA architecture in the 1980's a program's virtual storage was limited to 16 megs. Programs compiled with a 24 bit mode can only address16 Mb of space, as though they were kept under an imaginary storage line. With COBOL II a program compiled with a 31 bit mode can be 'above the 16 Mb line. (This 'below the line', 'above the line' imagery confuses most mainframe programmers, who tend to be a literal minded group.)Q66) What was removed from COBOL in the COBOL II implementation?A66) Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE.Q67) Explain call by context by comparing it to other calls.A67) The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified.Q68) What is the linkage section?A68) The linkage section is part of a called program that 'links' or maps to data items in the calling program's working storage. It is the part of the called program where these share items are defined.Q69) What is the difference between a subscript and an index in a table definition? A69) A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program's working storage. You SET an index to a value and SET it UP BY value and DOWN BY value.Q70) If you were passing a table via linkage, which is preferable - a subscript or an index?A70) Wake up - you haven't been paying attention! It's not possible to pass an index via linkage. The index is not part of the calling programs working storage. Those of us who've made this mistake, appreciate the lesson more than others.Q71) Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc.A71) An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntax’s: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort.Q72) What is the difference between comp and comp-3 usage? Explain other COBOL usage’s.A72) Comp is a binary usage, while comp-3 indicates packed decimal. The other common usage’s are binary and display. Display is the default.Q73) When is a scope terminator mandatory?A73) Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. For readability, it's recommended coding practice to always make scope terminators explicit.Q74) In a COBOL II PERFORM statement, when is the conditional tested, before or after the perform execution?A74) In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is performed before the perform.Q75) In an EVALUTE statement is the order of the WHEN clauses significant?A75) Absolutely. Evaluation of the WHEN clauses proceeds from top to bottom and their sequence can determine results.Q76) What is the default value(s) for an INITIALIZE and what keyword allows for an override of the default.A76) INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields. The REPLACING option can be used to override these defaults.Q77) What is SET TO TRUE all about, anyway?A77) In COBOL II the 88 levels can be set rather than moving their associated values to the related data item. (Web note: This change is not one of COBOL II's better specifications.)Q78) What is LENGTH in COBOL II?A78) LENGTH acts like a special register to tell the length of a group or elementary item.Q79) What is the difference between a binary search and a sequential search? What are the pertinent COBOLcommands?A79) In a binary search the table element key values must be in ascending or descending sequence. The table is 'halved' to search for equal to, greater than or less than conditions until the element is found. In a sequential search the table is searched from top to bottom, so (ironically) the elements do not have to be in a specific sequence. The binary search is much faster for larger tables, while sequential works well with smaller ones. SEARCH ALL is used for binary searches; SEARCH for sequential.Q80) What is the point of the REPLACING option of a copy statement?A80) REPLACING allows for the same copy to be used more than once in the same code by changing the replace value.Q81) What will happen if you code GO BACK instead of STOP RUN in a stand alone COBOLprogram i.e. aprogram which is not calling any other program.A81) The program will go in an infinite loop.Q82) How can I tell if a module is being called DYNAMICALLY or STATICALLY?A82) The ONLY way is to look at the output of the linkage editor (IEWL)or the load module itself. If the module is being called DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module. Calling a working storage variable, containing a program name, does not make a DYNAMIC call. This type of calling is known as IMPLICITE calling as the name of the module is implied by the contents of the working storage variable. Calling a program name literal (CALLQ83) What is the difference between a DYNAMIC and STATIC call in COBOL.A83) To correct an earlier answer: All called modules cannot run standalone if they require program variables passed to them via the LINKAGE section. DYNAMICally called modules are those that are not bound with the calling program at link edit time (IEWL for IBM) and so are loaded from the program library (joblib or steplib) associated with the job. For DYNAMIC calling of a module the DYNAM compiler option must be chosen, else the linkage editor will not generate an executable as it will expect u address resolution of all called modules. A STATICally called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module.Q84) How may divisions are there in JCL-COBOL?A84) FourQ85) What is the purpose of Identification Division?A85) Documentation.Q86) What is the difference between PIC 9.99 and 9v99?A86) PIC 9.99 is a FOUR-POSITION field that actually contains a decimal point where as PIC 9v99 is THREE- POSITION numeric field with implied or assumed decimal position.Q87) what is Pic 9v99 Indicates?A87) PICTURE 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position; the v means an implied decimal point.Q88) What guidelines should be followed to write a structured Cobol prg'm?A88)1) use 'evaluate' stmt for constructing cases.2) use scope terminators for nesting.3) use in line perform stmt for writing 'do ' constructions.4) use test before and test after in the perform stmt for writing do-whileconstructions.Q89) Read the following code. 01 ws-n pic 9(2) value zero. a-para move 5 to ws-n. perform b-para ws-n times. b-para.move 10 to ws-n. how many times will b-para be executed ?A89) 5 times only. it will not take the value 10 that is initialized in the loop.Q90) What is the difference between SEARCH and SEARCH ALL? What is more efficient? A90) SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items.Q91) What are some examples of command terminators?A91) END-IF, END-EVALUATEQ92) What care has to be taken to force program to execute above 16 Meg line?A92) Make sure that link option is AMODE=31 and RMODE=ANY. Compile option should never have SIZE(MAX). BUFSIZE can be 2K, efficient enough.Q93) How do you submit JCL via a Cobol program?A93) Use a file //dd1 DD sysout=(*, intrdr)write your JCL to this file. Pl some on try this out.Q94) How to execute a set of JCL statements from a COBOL programA94) Using EXEC CICS SPOOL WRITE(var-name) END-EXEC command. var-name is a COBOL host structure containing JCL statements.Q95) Give some advantages of REDEFINES clause.A95)1. You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memorylocation.2. By REDEFINES we can INITIALISE the variable in WORKING-STORAGE Section itself.3. We can REDEFINE a Single Variable into so many sub variables. (This facility is very useful in solving Y2000Problem.)Q96) What is the difference between static call & Dynamic callA96) In the case of Static call, the called program is a stand-alone program, it is an executable program. During run time we can call it in our called program. As about Dynamic call, the called program is not an executable program it can executed through the called programQ97) What do you feel makes a good program?A97) A program that follows a top down approach. It is also one that other programmersor users can follow logically and is easy to read and understand.Q98) How do you code Cobol to access a parameter that has been defined in JCL? And do you code the PARM parameter on the EXEC line in JCL?A98)1) using JCL with sysin. //sysin dd *here u code the parameters(value) to pass in to cobol program /* and in programyou use accept variable name(one accept will read one row)/.another way.2) in jcl using parm statement ex: in exec statement parm='john','david' in cobol pgm u have to code linkage section in that for first value you code length variable and variable name say, abc pic x(4).it will take john inside to read next value u have to code another variable in the same way above mentioned.Q99) Why do we code S9(4) comp. Inspite of knowing comp-3 will occupy less space. A99) Here s9(4)comp is small integer ,so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and sign will occupy 1/2 byte so totally it will occupy 3 bytes.Q100) The maximum number of dimensions that an array can have in COBOL-85 is ----------- ?A100) SEVEN in COBOL - 85 and THREE in COBOL– 84Q101) How do you declare a host variable (in COBOL) for an attribute named Emp-Name of type VARCHAR(25) ?A101)01 EMP-GRP.49 E-LEN PIC S9(4) COMP.49 E-NAME PIC X(25).Q102) What is Comm?A102) COMM - HALF WORD BINARYQ103) Differentiate COBOL and COBOL-II. (Most of our programs are written in COBOLII, so, it is good to know,how, this is different from COBOL)A103) The following features are available with VS COBOL II:1. MVS/XA and MVS/ESA support The compiler and the object programs it produces can be run in either24- or 31-bit addressing mode.2. VM/XA and VM/ESA support The compiler and the object programs it produces can be run in either24- or 31-bit addressing mode.3. VSE/ESA support The compiler and the object programs it produces can。
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程序,以达到上述目的。
波科面试问题
波科面试问题在波科公司的面试过程中,面试官通常会问到一些与个人能力、工作经验和技能相关的问题。
这些问题旨在评估面试者的适应能力、解决问题的能力和团队合作能力。
以下是一些常见的波科面试问题:1. 请介绍一下你自己以及你在之前的工作中的角色和成就。
在回答这个问题时,你可以简要介绍自己的个人背景,包括学历、专业和实习经验。
然后,重点谈论你在之前的工作中扮演的角色,你负责的项目以及你取得的成就。
强调与波科公司所需职位相关的经验和技能。
2. 你对波科公司的业务了解多少?你为什么对这个行业感兴趣?在回答这个问题时,你可以提前对波科公司的业务进行研究,了解他们的产品、服务和市场定位。
你可以谈论你对波科的印象和对他们业务模式的理解。
此外,你还可以分享你为什么对这个行业感兴趣,以及你认为你能为波科公司带来的价值。
3. 请描述一个你在工作中遇到的困难,并告诉我们你是如何解决它的。
通过这个问题,面试官希望了解你的解决问题的能力和应对压力的能力。
选择一个真实的例子,描述你在工作中遇到的具体困难,并解释你是如何分析问题、寻找解决方案并成功解决问题的。
强调你的决策能力和团队合作能力。
4. 请谈谈你的团队合作经验。
团队合作是波科公司非常看重的能力。
回答这个问题时,你可以举例说明你在以往的工作中如何与团队合作,分享你参与的项目和你的角色。
强调你的沟通技巧、协调能力和解决冲突的能力。
你还可以提及你在团队中面临的挑战以及你为团队的成功做出的贡献。
5. 你是如何保持自己的技能和知识的更新的?这个问题考察你的学习能力和持续进修的意愿。
你可以谈论你的自我学习能力和你在工作中学习新技能的经验。
分享你参与的培训课程、在线学习资源或专业认证的经历。
强调你的渴望学习和提升自己的能力,以适应快速发展的科技行业。
总结波科公司的面试过程中,面试官关注的是你的能力、经验和团队合作能力。
在回答问题时,要重点突出与波科公司所需职位相关的经验和技能。
通过提供具体的例子和解决问题的方法,展示你的解决问题的能力和团队合作能力。
四川科道芯国智能技术股份有限公司嵌入式面试题
四川科道芯国智能技术股份有限公司嵌入式面试题面试题一
关键字static的作用是什么?
答案
(1)在函数体,一个被声明为静态的变量在这一函数被调用过程中维持其值不变。
(2)在模块内,一个被声明为静态的变量可以被模块内所用函数访问,但不能被模块外其它函数访问。
它是一个本地的全局变量。
(3)在模块内,一个被声明为静态的函数只可被这一模块内的其它函数调用。
那就是,这个函数被限制在声明它的模块的本地范围内使用。
面试题二
关键字volatile有什么含意并给出三个不同的例子。
答案
volatile是易变的,不稳定的意思。
volatile是关键字,是一种类型修饰符,用它修饰的变量表示可以被某些编译器未知的因素更改,比如操作系统、硬件或者其他线程等。
每次使用它修饰的变量的时候必须从内存中取出它的值,而不是从寄存器或者缓存中读取,从而保证了对特殊地址的稳定访问。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
JCl部分:
1.你认为JCL是做什么的?JCL大体由几个关键语句组成?什么是作业结束的标志?
Jcl:作业控制语言,
控制作业的执行。
管理系统资源和数据集。
(类似TSO交互式菜单对数据集的管理)
对COBOL程序编译和执行。
(COBOL代码→JCL编译→机器码→JCL执行)
Job、dd、exec、proc
//
2.什么是流内数据?怎样定义流内数据?DD *和DD DATA语句有什么不同之处?
由DD语句,DD*,DD DATE,DD DUMY 加数据构成
DD * 结束符可以为//或/* 而DD DATE 结束符只能为/*
3.VSAM数据集和普通的数据集相比有什么优势,如何用JCL创建,编辑,修改VSAM数据集?
4.你使用过哪些系统自带的JCL utility,说一说SORT(排序用)的控制选项中include和member是做什么的?
IEFBR14 IEBGENER IEBCOPY SORT IDCAMS
5.COND参数是做什么的,GE是什么若后面加上only参数或者even有什么不同COBOL
判断作业步是否执行
Only:只有当上一步作业步出现异常时,本作业才执行
Even:不管上一作业步是否有异常时,本作业步继续执行
COBOL部分:
1.Q:外部文件和COBOL程序是如何关联起来的,读写文件是如何实现的?
A:在环境部中输入输出节中建立与外部文件的关系
在数据部中定义文件,然后在过程部中需要打开文件、然后再读文件、写记录,最后通过执行作业流实现读写文件
2.Q:说一说COBOL中有几种数据类型,COMP COMP-3 packed是什么?如果一个13位的数据用COMP-3形式存储实际上他占了多少个位?
A:常量、变量、
Comp:压缩二进制
Com-3:压缩十进制
7位
3.Q:go to ;continue语句有什么区别?
A: Go to:无条件跳转到指定语句执行
Continue:相当于空操作符,什么都不执行,程序执行到此处,跳过continue,执行下一句
4.Q:循环语句perform有四种形式,分别介绍一下。
如何控制循环变量在循环前检测还是在循环后检测,如何控制循环步长?出现死循环的常见原因是什么?你怎样排除?
A: 直接调用某一段,没有循环
2种循环语句 perform until; perform varying by ;
线内perform,执行过程在perform内,由end-perform
死循环原因:不满足循环终止条件
6.静态程序调用和动态程序调用有什么不同?程序间是如何进行参数传递的?如何实现动态调用?
7.如何在COBOL中使用汉字等双字节字符?
CICS部分:
1.谈谈CICS是做什么用的,联机程序和批量程序有什么不同,什么是伪会话?
2.一个含有CICS的程序编译连接运行,和纯粹的COBOL程序有什么不同?
3.在使用一个资源前,必须采取什么步骤?
4.什么是物理映像,什么是字符映像,二者有是什么关系,在SEND MAP后参数data only和map only是什么意思?
5,属性skip是什么,ENQ和DEQ起什么作用?
DB2部分:
1,怎样在一个表里面批量插入大量数据?
2,嵌入了SQL语句的程序怎样编译运行?在绑定阶段系统依据什么去识别相关的模块?
3.什么是外左连结?
4.如何修检索出一条记录,然后修改它?
TSO部分:
1作业运行完之后,如何查看结果,如何找出程序错误和警告?2如何定义数据集,检索数据?。