Конвертер валютUSD 2,9921EUR 3,3424Моя статистикаПройдите любой тест
Все записи блога →
Последние Новости
  • Тур Хейердал — путешественник, переплывший океан на плоту
    Шесть мужчин, бальсовый плот и бескрайний Тихий океан. Тур Хейердал хотел проверить смелую идею: могли ли жители Южной Америки в древности добраться до островов Полинезии. Чтобы узнать это, он сам отправился в путь.Путь к успехуТур Хейердал родился 6 октября 1914 года в городе Ларвик в Норвегии. С детства он увлекался зоологией и дикой природой. В 1937–1938 годах Тур с женой прожил около года на острове Фату-Хива в Полинезии. Именно там, наблюдая за ветрами и течениями, он задумался о происхожде...
  • Христофор Колумб — мореплаватель, открывший Европе Америку
    Утром 12 октября 1492 года матрос с корабля «Пинта» крикнул, что видит берег. Через несколько часов три небольших судна подошли к острову, который местные жители называли Гуанахани. Экспедиция Христофора Колумба завершила первый переход через Атлантический океан, после которого мир перестал быть прежним.Путь к экспедицииКолумб родился около 1451 года в Генуе в семье ткача. Он рано ушёл в море, плавал по Средиземному и Атлантическому океанам, жил в Португалии. Он был уверен, что до Индии и Китая ...
  • Фрэнк Синатра — «Голос» века, певший по-своему
    Шляпа с лентой, небрежно накинутый плащ, бархатный баритон — Фрэнк Синатра умел превратить трёхминутную песню в маленький спектакль. Прозвище «Голос» закрепилось за ним ещё в 1940-х, и за десятилетия его мало кто смог оспорить.Путь к успехуСинатра родился в декабре 1915 года в Хобокене, штат Нью-Джерси, в семье итальянских эмигрантов. Музыкального образования он почти не получил, зато с юности пел на радио и в клубах. Первые успехи пришли в оркестрах Гарри Джеймса и Томми Дорси. В начале 194...
  • Михаил Булгаков — мастер, которого прочли после смерти
    Автор, которого при жизни почти не печатали, оказался одним из самых читаемых писателей столетия. История Михаила Афанасьевича Булгакова — это история терпения, упорства и веры в свою книгу.Путь к успехуБулгаков родился в 1891 году в Киеве, в семье преподавателя духовной академии. В 1916 году он окончил медицинский факультет Киевского университета и сразу начал работать врачом, в том числе в земской больнице в селе Никольском Смоленской губернии. Эти годы позже отразились в «Записках юного врача...
  • Дмитрий Менделеев — химик, составивший карту всех элементов
    Дмитрий Иванович Менделеев родился 8 февраля 1834 года (27 января по старому стилю) в Тобольске, в большой семье директора гимназии. Рос он в трудное время, но мать, по семейным преданиям, сделала всё, чтобы младший сын получил образование. Так будущий учёный оказался в Петербурге.Путь к успехуОкончив Главный педагогический институт, Менделеев стажировался в Европе, а в 1860-х годах стал профессором Петербургского университета. Читая курс неорганической химии, он не нашёл подходящего учебника и ...
  • Роальд Амундсен — покоритель полюсов и северо-западного прохода
    Полярные льды веками хранили свои тайны. Роальд Амундсен разгадал сразу несколько из них. Он не искал лёгкой славы: каждый его поход был итогом долгой учёбы у местных народов и внимательного расчёта.Путь к успехуАмундсен родился 16 июля 1872 года недалеко от города Борге в Норвегии. Он собирался стать врачом, но, прочитав о полярных экспедициях, выбрал другую жизнь. В 1897–1899 годах он участвовал в бельгийской экспедиции на судне «Бельжика», которая стала первой, перезимовавшей в Антарктике. Та...
  • Франциск Скорина — первопечатник Беларуси и Восточной Европы
    В 1517 году в Праге вышла небольшая книга, которую можно держать в одной руке. Это была Псалтирь, а на её страницах стояло имя издателя: «Франциск Скорина из Полоцка, в лекарских науках доктор». Так началась история восточнославянского книгопечатания.Путь к книгеТочная дата рождения Скорины неизвестна, обычно называют около 1490 года. Он родился в Полоцке в семье купца. В 1504 году его имя записано среди студентов Краковского университета. В 1512 году в итальянской Падуе он получил степень докто...
  • Марк Шагал — художник, чьи герои парят над городом
    На картинах Марка Шагала люди летают над крышами, скрипач сидит на домике, а синяя корова смотрит на зрителя человеческими глазами. Это не просто фантазия: художник всю жизнь рисовал родной Витебск, каким его хранила память, — с поэтической логикой сна.Путь к успехуМарк Шагал (при рождении Мовша Шагал) родился в 1887 году в семье бедного еврейского рабочего недалеко от Витебска и вырос в самом Витебске. Он учился у местного художника Юделя Пэна, затем уехал в Санкт-Петербург. В 191...
  • Янка Купала — народный поэт Беларуси
    Когда в начале XX века молодой поэт из деревни под Минском подписал свои стихи псевдонимом «Янка Купала», он, возможно, и не думал, что станет голосом целого народа. Но именно так и произошло.Путь к успехуИван Доминикович Луцевич родился в 1882 году в фольварке Вязынка близ Молодечно. Семья была небогатой: родители арендовали землю. Учился он в народном училище, потом работал домашним учителем, писарем, помощником провизора, много читал и рано начал писать стихи. Первое стихотворение «Мужик» нап...
  • Луи Пастер — учёный, победивший невидимых врагов
    Луи Пастер родился 27 декабря 1822 года в городке Доль на востоке Франции, в семье кожевника. Он был прилежным, но не блестящим учеником и интересовался живописью. Однако судьбу решила химия: она повела его от кристаллов к микробам и спасению жизней.Путь к успехуПервое крупное открытие Пастер сделал в 1848 году, изучая кристаллы солей винной кислоты. Он заметил, что они бывают двух зеркально отражённых форм, и тем самым заложил основы стереохимии. Позже он занялся брожением и показал, что за нег...
МатематикаМоя статистика

Тест по COBOL

100 вопросов в 20 темах (лёгкий — 30, средний — 50, сложный — 20). Выберите темы, уровень и количество вопросов — к каждому ответу есть объяснение.

Структура программы и дивизионы, PICTURE и USAGE, уровни и 88-условия, MOVE и арифметика, условия и PERFORM, таблицы, строки, файлы и FILE STATUS, подпрограммы, COPY, SORT, функции, редактирование, мейнфрейм (JCL, CICS, DB2) и современный COBOL. Вопросы на английском.

Все вопросы теста 100

Нажмите на вариант ответа, чтобы проверить себя, или «Показать ответ».

Program structure5
1Лёгкий
In which order must the four divisions of a COBOL program appear?
  1. IDENTIFICATION, ENVIRONMENT, DATA, PROCEDURE
  2. IDENTIFICATION, DATA, ENVIRONMENT, PROCEDURE
  3. ENVIRONMENT, IDENTIFICATION, DATA, PROCEDURE
  4. Any order, as long as PROCEDURE is last
2Лёгкий
In fixed-format source, what is column 7 used for?
  1. Sequence numbers
  2. The start of Area A, where paragraph names begin
  3. The indicator area: * or / for a comment, - for a continuation line, D for a debugging line
  4. Nothing; it must always be blank
3Средний
In fixed-format source, which of these must begin in Area A (columns 8-11)?
  1. A MOVE statement
  2. A paragraph name such as MAIN-PARA.
  3. A level-05 data item
  4. The ELSE of an IF statement
4Средний
A subprogram called with CALL executes STOP RUN. What happens?
  1. Control returns to the statement after the CALL in the calling program
  2. Only the subprogram is cancelled; the caller continues from its first statement
  3. It is a compile error: STOP RUN is allowed only in the main program
  4. The whole run unit ends, and control never returns to the caller
5Сложный
In fixed-format source, a long literal runs from column 40 to column 78 of a line. What happens to the characters in columns 73-78?
  1. They are kept, because literals may extend to column 80
  2. The compiler wraps them onto the next line automatically
  3. They are ignored, because columns 73-80 are the program identification area
  4. They are treated as a comment only if column 7 contains *
Data division and PICTURE5
6Лёгкий
What does PIC X(5) describe?
  1. A numeric item with 5 digits
  2. An alphanumeric item of 5 characters
  3. An alphabetic item that accepts only letters
  4. A 5-byte binary number
7Средний
How many bytes does this item occupy?
01 WS-PRICE PIC 9(3)V99 VALUE 123.45.
  1. 6
  2. 3
  3. 7
  4. 5
8Средний
What value does WS-A hold after this statement?
01 WS-A PIC 9(3).
...
    COMPUTE WS-A = 5 - 8
  1. 3, because the item has no S and keeps only the absolute value
  2. -3
  3. 997
  4. 0, because a negative result is replaced by zero
9Средний
What kind of item is WS-AMT?
01 WS-AMT PIC 9(3).99.
  1. A numeric item with an implied decimal point, usable in any arithmetic
  2. An invalid declaration: a PICTURE cannot contain a period
  3. A numeric-edited item of 6 characters: it can receive results, but cannot be an operand in arithmetic
  4. An alphanumeric item, so MOVE to it is not allowed
10Сложный
What numeric value does X hold after the MOVE?
01 X PIC 99PPP.
...
    MOVE 12345 TO X
  1. 12345
  2. 12000
  3. 45
  4. 12
USAGE and storage5
11Лёгкий
If no USAGE clause is written for an elementary item, what USAGE does it have?
  1. DISPLAY
  2. COMP (BINARY)
  3. COMP-3 (PACKED-DECIMAL)
  4. It depends on whether the PICTURE contains S
12Лёгкий
How does USAGE COMP-3 (PACKED-DECIMAL) store a number?
  1. As a two's-complement binary integer
  2. As a floating-point value
  3. As one character per digit, with the sign in the last byte
  4. Two decimal digits per byte, with the sign in the last half-byte
13Средний
How many bytes does this item occupy?
01 WS-TOTAL PIC S9(7) COMP-3.
  1. 7
  2. 4
  3. 3
  4. 8
14Средний
In IBM Enterprise COBOL, how many bytes does PIC S9(9) COMP (BINARY) occupy?
  1. 9
  2. 2
  3. 4
  4. 8
15Сложный
On IBM Enterprise COBOL compiled with TRUNC(STD), what is the key difference between PIC S9(4) COMP and PIC S9(4) COMP-5?
  1. COMP-5 values are limited by the binary field size, not by the PICTURE, so it can hold 32767
  2. COMP-5 is packed decimal, COMP is binary
  3. COMP-5 is always 8 bytes long
  4. COMP-5 cannot be signed
Level numbers5
16Лёгкий
What is a level-88 entry?
  1. A data item that is always 88 bytes long
  2. A constant that cannot be changed
  3. An item that renames part of a record
  4. A condition name: a named test for whether its parent item has one of the listed values
17Средний
Which statement about FILLER is true?
  1. FILLER items take no storage
  2. A FILLER item can be referenced by qualifying it, e.g. FILLER OF PRINT-LINE
  3. A FILLER item cannot be referenced by name in procedure statements
  4. FILLER can only be used at level 01
18Средний
What does DISPLAY WS-MM print?
01 WS-DATE      PIC X(8) VALUE '20261102'.
01 WS-DATE-R REDEFINES WS-DATE.
   05 WS-YYYY   PIC 9(4).
   05 WS-MM     PIC 99.
   05 WS-DD     PIC 99.
...
    DISPLAY WS-MM
  1. 02
  2. 11
  3. 26
  4. Nothing, because a REDEFINES item has no VALUE
19Средний
What do A and B contain after the MOVE?
01 G.
   05 A PIC 9(3).
   05 B PIC 9(3).
...
    MOVE 5 TO G
  1. A = '5' followed by two spaces, B = spaces: a group move is alphanumeric
  2. A = 005, B = 000
  3. A = 000, B = 005
  4. A = 005, B = 005
20Сложный
Which statement about a level-66 RENAMES entry is correct?
  1. It may appear anywhere in WORKING-STORAGE and rename any item
  2. It allocates new storage initialised from the renamed items
  3. It may rename a level-01 record or a level-88 condition
  4. It must follow the last entry of its record and cannot rename level 01, 66, 77 or 88 items
MOVE and data conversion5
21Лёгкий
What does WS-CODE contain after the MOVE?
01 WS-CODE PIC X(5).
...
    MOVE 'ABC' TO WS-CODE
  1. ' ABC' (right-justified)
  2. 'ABC ' (left-justified, padded with spaces)
  3. 'ABC00'
  4. 'ABC' followed by two low-values
22Лёгкий
What does WS-N contain after the MOVE?
01 WS-N PIC 9(3).
...
    MOVE 12345 TO WS-N
  1. 123
  2. 999
  3. 345
  4. A runtime error is raised
23Средний
What value does WS-N hold after the MOVE?
01 WS-N PIC 9(4)V99.
...
    MOVE 123.456 TO WS-N
  1. 0123.45
  2. 0123.46
  3. 1234.56
  4. 0012.34
24Средний
What does WS-OUT contain after the MOVE?
01 WS-OUT PIC **,**9.99.
...
    MOVE 45.5 TO WS-OUT
  1. '00,045.50'
  2. '**,*45.50'
  3. '***45.50'
  4. '****45.50'
25Сложный
Which fields of OUT-REC receive data from MOVE CORRESPONDING IN-REC TO OUT-REC?
01 IN-REC.
   05 CUST-ID  PIC 9(5).
   05 NAME     PIC X(20).
   05 AMOUNT   PIC 9(5)V99.
01 OUT-REC.
   05 NAME     PIC X(30).
   05 FILLER   PIC X(2).
   05 CUST-ID  PIC Z(4)9.
   05 TOTAL    PIC Z(5)9.99.
  1. All four fields, matched by position
  2. NAME and CUST-ID only
  3. NAME only, because CUST-ID is in a different position
  4. None, because the two groups have different layouts
Arithmetic5
26Лёгкий
After ADD A TO B, which item holds the sum?
  1. A
  2. Both A and B
  3. B
  4. Neither; a GIVING phrase is required
27Средний
What are Q and R after this statement?
01 Q PIC 99.
01 R PIC 99.
...
    DIVIDE 5 INTO 17 GIVING Q REMAINDER R
  1. Q = 0, R = 5
  2. Q = 3, R = 5
  3. Q = 2, R = 3
  4. Q = 3, R = 2
28Средний
What value does X hold?
01 X PIC 9.
...
    COMPUTE X ROUNDED = 10 / 4
  1. 3
  2. 2
  3. 2.5
  4. 0
29Сложный
What is displayed, and what is X afterwards?
01 X PIC 99 VALUE 95.
...
    ADD 10 TO X
        ON SIZE ERROR
            DISPLAY 'OVER'
        NOT ON SIZE ERROR
            DISPLAY X
    END-ADD
  1. 05 is displayed; X = 05
  2. OVER is displayed; X stays 95
  3. OVER is displayed; X = 05
  4. OVER is displayed; X = 99
30Средний
Which of these statements is invalid?
  1. MULTIPLY 10 BY A
  2. ADD A B GIVING C
  3. MULTIPLY A BY 10
  4. SUBTRACT A FROM B GIVING C
Conditions5
31Лёгкий
For an item WS-IN PIC X(4), what does IF WS-IN IS NUMERIC test?
  1. That the value is greater than zero
  2. That the item was declared with PIC 9
  3. That at least one character is a digit
  4. That every character is a digit 0-9
32Лёгкий
What does WS-STATUS contain after the SET?
01 WS-STATUS PIC X VALUE 'Y'.
   88 ST-OK    VALUE 'Y'.
   88 ST-FAIL  VALUE 'N'.
...
    SET ST-FAIL TO TRUE
  1. 'N'
  2. 'Y'
  3. 'T'
  4. '1'
33Средний
Inside an IF, what is the difference between NEXT SENTENCE and CONTINUE?
  1. They are synonyms
  2. CONTINUE skips to the next loop iteration; NEXT SENTENCE ends the loop
  3. CONTINUE does nothing and execution goes on after END-IF; NEXT SENTENCE jumps past the next period
  4. NEXT SENTENCE does nothing; CONTINUE jumps to the next paragraph
34Средний
BAL is 100 when this code runs. What is BAL afterwards?
    IF BAL < 0
        DISPLAY 'NEGATIVE'.
        MOVE 0 TO BAL
    ADD 1 TO BAL.
  1. 101
  2. 1
  3. 100
  4. 0
35Сложный
A = 5 and B = -1. What is displayed?
    EVALUATE TRUE ALSO TRUE
        WHEN A > 0 ALSO B > 0
            DISPLAY 'PP'
        WHEN A > 0 ALSO ANY
            DISPLAY 'PX'
        WHEN OTHER
            DISPLAY 'OO'
    END-EVALUATE
  1. PP
  2. PP and then PX
  3. OO
  4. PX
Loops and PERFORM5
36Лёгкий
What does PERFORM PARA-A THRU PARA-C do?
  1. Executes PARA-A, PARA-B and PARA-C in source order and then returns after the PERFORM
  2. Executes PARA-A and PARA-C only
  3. Executes PARA-A repeatedly until PARA-C is reached by a GO TO
  4. Jumps to PARA-A and never returns
37Средний
What does DISPLAY I print after the loop?
01 I PIC 99.
...
    PERFORM VARYING I FROM 1 BY 1 UNTIL I > 3
        DISPLAY 'X'
    END-PERFORM
    DISPLAY I
  1. 03
  2. 04
  3. 01
  4. 00
38Средний
How many times is the body executed?
    MOVE 10 TO N
    PERFORM WITH TEST AFTER UNTIL N > 5
        ADD 1 TO N
    END-PERFORM
  1. 0
  2. 5
  3. It loops forever
  4. 1
39Сложный
What is wrong with this loop?
01 I PIC 9.
...
    PERFORM VARYING I FROM 1 BY 1 UNTIL I > 9
        DISPLAY I
    END-PERFORM
  1. Nothing; it displays 1 to 9
  2. It displays 1 to 8 only
  3. I can never exceed 9: 9 + 1 does not fit in PIC 9, so in practice I wraps to 0 and the loop never ends
  4. It does not compile, because VARYING needs an index
40Средний
In COBOL 2002 / GnuCOBOL, what does EXIT PERFORM CYCLE do inside an inline PERFORM?
  1. Ends the current iteration and goes on with the next one
  2. Leaves the inline PERFORM completely
  3. Leaves the current paragraph
  4. Restarts the loop from the first iteration
Tables5
41Лёгкий
Given 05 WS-ITEM PIC X(10) OCCURS 20 TIMES, how do you refer to the first element?
  1. WS-ITEM(0)
  2. WS-ITEM[1]
  3. WS-ITEM(1)
  4. WS-ITEM.FIRST
42Лёгкий
A table is declared with INDEXED BY IDX. How do you make IDX point to the third element?
  1. MOVE 3 TO IDX
  2. SET IDX TO 3
  3. ADD 3 TO IDX
  4. COMPUTE IDX = 3
43Средний
What does SEARCH ALL require of the table?
  1. Nothing beyond OCCURS; it works on any table
  2. A subscript item declared PIC 9(4) COMP
  3. A VARYING phrase naming the subscript
  4. An ASCENDING or DESCENDING KEY clause, an INDEXED BY index, and data actually sorted on that key
44Средний
A serial SEARCH sometimes reports "not found" for values that are in the table. What is the likely bug?
    SEARCH WS-ITEM
        AT END
            DISPLAY 'NOT FOUND'
        WHEN WS-CODE(IDX) = WS-KEY
            DISPLAY 'FOUND'
    END-SEARCH
  1. The index is not reset with SET IDX TO 1 before the SEARCH, so it starts from a leftover position
  2. SEARCH needs an ASCENDING KEY clause
  3. AT END must come after the WHEN clause
  4. WHEN must use a subscript, not an index
45Сложный
WS-CNT is 4. What does FUNCTION LENGTH(WS-TBL) return?
01 WS-TBL.
   05 WS-CNT   PIC 99.
   05 WS-ITEM  PIC X(3)
               OCCURS 1 TO 10 TIMES DEPENDING ON WS-CNT.
  1. 32
  2. 30
  3. 14
  4. 12
Strings5
46Лёгкий
WS-NAME PIC X(8) contains 'ABCDEFGH'. What is WS-NAME(3:4)?
  1. 'CDEFGH'
  2. 'CDEF'
  3. 'DEFG'
  4. 'CD'
47Средний
What does WS-OUT contain after the STRING?
01 WS-FIRST PIC X(10) VALUE 'JOHN'.
01 WS-LAST  PIC X(10) VALUE 'SMITH'.
01 WS-OUT   PIC X(20).
...
    MOVE SPACES TO WS-OUT
    STRING WS-FIRST DELIMITED BY SPACE
           ', '     DELIMITED BY SIZE
           WS-LAST  DELIMITED BY SPACE
      INTO WS-OUT
    END-STRING
  1. 'JOHN , SMITH' followed by spaces
  2. 'JOHN,SMITH' followed by spaces
  3. 'JOHN SMITH' followed by spaces
  4. 'JOHN, SMITH' followed by spaces
48Средний
What does DISPLAY WS-LEN print?
01 WS-X   PIC X(10) VALUE '  AB C'.
01 WS-LEN PIC 99.
...
    MOVE FUNCTION LENGTH(FUNCTION TRIM(WS-X)) TO WS-LEN
    DISPLAY WS-LEN
  1. 04
  2. 10
  3. 03
  4. 06
49Средний
What does WS-B contain after the UNSTRING?
01 WS-IN PIC X(20) VALUE 'RED,GREEN,BLUE'.
01 WS-A  PIC X(4).
01 WS-B  PIC X(4).
01 WS-C  PIC X(4).
...
    UNSTRING WS-IN DELIMITED BY ','
        INTO WS-A WS-B WS-C
    END-UNSTRING
  1. 'GREEN'
  2. 'REEN'
  3. 'GREE'
  4. Spaces, because the value is too long to fit
50Сложный
What is WS-CNT after the INSPECT?
01 WS-S   PIC X(6) VALUE 'BANANA'.
01 WS-CNT PIC 99 VALUE 0.
...
    INSPECT WS-S TALLYING WS-CNT FOR ALL 'ANA'
  1. 2
  2. 1
  3. 0
  4. 3
File handling5
51Лёгкий
Which file ORGANIZATION lets a program read a record directly by the value of a key field such as a customer number?
  1. ORGANIZATION IS LINE SEQUENTIAL
  2. ORGANIZATION IS INDEXED
  3. ORGANIZATION IS SEQUENTIAL
  4. ORGANIZATION IS RELATIVE with a RECORD KEY clause
52Средний
A program must read records from a SEQUENTIAL file and change some of them in place with REWRITE. In which mode must the file be opened?
  1. OPEN INPUT
  2. OPEN OUTPUT
  3. OPEN EXTEND
  4. OPEN I-O
53Средний
What does OPEN EXTEND do for an existing sequential file?
  1. Positions the file after its last record, so new WRITEs are added at the end
  2. Clears the file and starts writing from the first record
  3. Opens the file for reading and writing at the current position
  4. Enlarges the record length so longer records can be written
54Лёгкий
The file CUST-FILE is described by an FD whose record is CUST-REC. Which pair of statements is written correctly?
  1. READ CUST-REC and WRITE CUST-FILE
  2. READ CUST-REC and WRITE CUST-REC
  3. READ CUST-FILE and WRITE CUST-REC
  4. READ CUST-FILE and WRITE CUST-FILE
55Сложный
An indexed file is opened with ACCESS MODE IS DYNAMIC. What happens after this START succeeds?
MOVE 'M' TO CUST-NAME-KEY
START CUST-FILE KEY IS NOT LESS THAN CUST-NAME-KEY
    INVALID KEY DISPLAY 'NOTHING FROM M ON'
END-START
  1. The first record with a key of 'M' or higher is read into the record area
  2. The file is only positioned there; a following READ ... NEXT returns that record
  3. All records with keys below 'M' are skipped and deleted from the file
  4. Nothing, because START is allowed only with ACCESS MODE IS RANDOM
File status and errors5
56Лёгкий
After a sequential READ, the FILE STATUS field contains '10'. What does it mean?
  1. The end of the file was reached and no record was read
  2. The record was read successfully and it is the tenth one
  3. The file was not found
  4. The program tried to read after the end-of-file condition had already been returned
57Средний
A program executes OPEN INPUT on a file that does not exist; the SELECT has no OPTIONAL clause. Which FILE STATUS is returned?
  1. 10
  2. 23
  3. 39
  4. 35
58Средний
CUST-FILE is indexed, opened INPUT with ACCESS MODE IS RANDOM, and has no record with key 'C999'. What happens?
MOVE 'C999' TO CUST-ID
READ CUST-FILE
    INVALID KEY     DISPLAY 'NO CUSTOMER'
    NOT INVALID KEY DISPLAY CUST-NAME
END-READ
  1. FILE STATUS is '10' and the program abends
  2. FILE STATUS is '22' and CUST-NAME of the previous record is displayed
  3. FILE STATUS is '23' and NO CUSTOMER is displayed
  4. FILE STATUS is '35' and NO CUSTOMER is displayed
59Средний
Where must a USE AFTER STANDARD ERROR PROCEDURE ON CUST-FILE section be written?
  1. In the FILE SECTION, right after the FD for CUST-FILE
  2. At the beginning of the PROCEDURE DIVISION, between DECLARATIVES and END DECLARATIVES
  3. Anywhere in the PROCEDURE DIVISION, as long as it is a separate paragraph
  4. In the ENVIRONMENT DIVISION, inside the SELECT clause
60Сложный
The first OPEN succeeds. What is in WS-STAT after the second OPEN?
SELECT IN-FILE ASSIGN TO 'in.dat'
    ORGANIZATION IS LINE SEQUENTIAL
    FILE STATUS IS WS-STAT.
...
OPEN INPUT IN-FILE
OPEN INPUT IN-FILE
DISPLAY WS-STAT
  1. 41
  2. 42
  3. 00, because reopening simply rewinds the file
  4. 35
Subprograms5
61Лёгкий
A called subprogram executes STOP RUN. What happens?
  1. Control returns to the statement after the CALL, like GOBACK
  2. Only the subprogram is removed from memory, the caller continues
  3. The whole run unit ends, and the calling program never gets control back
  4. It is a compile error, because STOP RUN is allowed only in a main program
62Средний
The caller passes WS-QTY (value 10) with CALL 'CALC' USING BY CONTENT WS-QTY. CALC adds 5 to its LINKAGE item. What is WS-QTY in the caller after the call?
  1. 15
  2. 5
  3. Undefined, because BY CONTENT items cannot be changed
  4. 10
63Средний
In a subprogram, where are the parameters listed in PROCEDURE DIVISION USING declared?
  1. In the LINKAGE SECTION, which describes storage owned by the caller
  2. In the WORKING-STORAGE SECTION with a VALUE clause for the default
  3. In the FILE SECTION as a pseudo-file
  4. Nowhere: parameters are accessed by position as USING-1, USING-2
64Средний
COUNTER is called three times by the same main program, with no CANCEL in between. What does the third call display?
IDENTIFICATION DIVISION.
PROGRAM-ID. COUNTER.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-CALLS PIC 9(3) VALUE 0.
PROCEDURE DIVISION.
    ADD 1 TO WS-CALLS
    DISPLAY WS-CALLS
    GOBACK.
  1. 001
  2. 003
  3. 000
  4. 002
65Сложный
WS-PGM PIC X(8) contains 'PAYCALC' and the program executes CALL WS-PGM USING WS-DATA. When is the program PAYCALC located?
  1. At link time, because the linker reads the VALUE of WS-PGM
  2. At compile time, if WS-PGM has a VALUE clause
  3. Never: CALL accepts only a literal program name
  4. At run time, when the CALL executes: a CALL identifier is always a dynamic call
Copybooks and compiler directives5
66Лёгкий
When does a COPY statement take effect?
  1. At run time, each time execution reaches the COPY statement
  2. At link time, when modules are bound together
  3. At compile time: the copybook text is inserted into the source before it is compiled
  4. At program load time, when the copybook is read from the library
67Средний
The copybook CUSTREC contains the lines below. Using COBOL 2002 rules (supported by GnuCOBOL), which names are produced by COPY CUSTREC REPLACING LEADING ==CUST== BY ==SUPP==. ?
05 CUST-ID     PIC X(6).
05 CUST-NAME   PIC X(30).
  1. SUPP-ID and SUPP-NAME
  2. CUST-ID and CUST-NAME, because REPLACING matches only whole words
  3. SUPP-ID only, because only the first occurrence is replaced
  4. SUPPCUST-ID and SUPPCUST-NAME
68Средний
Why do many shops write record copybooks starting at level 05 instead of including the 01 level?
  1. Because a copybook may not contain level 01 entries
  2. Because 05-level items use less memory than 01-level items
  3. Because the compiler ignores level numbers inside copybooks
  4. So each program can place the layout under its own 01 group, for example once as an input and once as an output record
69Лёгкий
In GnuCOBOL, what does the directive >>SOURCE FORMAT IS FREE at the top of a source file do?
  1. Allows the program to run without a license
  2. Tells the compiler the following lines are free format, not bound to the fixed column areas
  3. Frees all WORKING-STORAGE memory when the program ends
  4. Turns off syntax checking for the rest of the file
70Сложный
What is the scope of a REPLACE statement such as REPLACE ==WS-MAX== BY ==100==. ?
  1. Only the next sentence of the program
  2. Only the text of the copybook named in the next COPY statement
  3. The source text that follows it, including text brought in by COPY, until another REPLACE or REPLACE OFF
  4. All occurrences of WS-MAX at run time, like a constant
Sorting and merging5
71Лёгкий
Which entry describes the work file used by a SORT statement?
  1. An FD entry with the SORT clause
  2. An SD (sort-merge file description) entry
  3. A WORKING-STORAGE table with OCCURS
  4. An RD (report description) entry
72Средний
Inside an INPUT PROCEDURE of a SORT, which statement passes a record to the sort?
  1. RELEASE
  2. WRITE
  3. RETURN
  4. MOVE ... TO SORT-FILE
73Средний
What is wrong with this code?
OPEN INPUT IN-FILE
     OUTPUT OUT-FILE
SORT SORT-WORK
    ON ASCENDING KEY SW-CUST-ID
    USING IN-FILE
    GIVING OUT-FILE
CLOSE IN-FILE OUT-FILE
  1. ASCENDING KEY must name a field of IN-FILE, not of the SD record
  2. GIVING requires an OUTPUT PROCEDURE as well
  3. Nothing, this is the required pattern for USING/GIVING
  4. The USING and GIVING files must not be open when SORT runs: SORT opens and closes them itself
74Средний
What does WITH DUPLICATES IN ORDER guarantee in a SORT statement?
  1. Records with duplicate keys are removed
  2. The sort fails if two records have the same key
  3. Records with equal keys come out in the same order in which they went in
  4. Duplicate keys are sorted by the rest of the record
75Сложный
Which statement about MERGE is true?
  1. Its input files must already be ordered on the merge keys, and it allows an OUTPUT PROCEDURE but not an INPUT PROCEDURE
  2. It sorts each input file first, so the inputs may be in any order
  3. It allows an INPUT PROCEDURE but requires GIVING for output
  4. It can merge only two files at a time
Intrinsic functions5
76Лёгкий
Without a REPOSITORY paragraph, which statement correctly converts WS-NAME to upper case?
  1. MOVE UPPER-CASE(WS-NAME) TO WS-OUT
  2. MOVE FUNCTION UPPER-CASE(WS-NAME) TO WS-OUT
  3. CALL 'UPPER-CASE' USING WS-NAME WS-OUT
  4. COMPUTE WS-OUT = UPPER(WS-NAME)
77Лёгкий
What do the first 8 characters of FUNCTION CURRENT-DATE contain?
  1. The time as HHMMSSss
  2. The date as YYMMDD followed by two spaces
  3. The date as YYYYMMDD
  4. The date as DDMMYYYY
78Средний
What value does FUNCTION LENGTH(WS-NAME) return?
01 WS-NAME PIC X(20) VALUE 'BOB'.
  1. 3
  2. 17
  3. 0
  4. 20
79Средний
Which of these strings cannot be converted with FUNCTION NUMVAL and needs FUNCTION NUMVAL-C instead (default currency sign and decimal point)?
  1. '$1,234.50'
  2. ' -12.50'
  3. '12.50-'
  4. ' 7 '
80Сложный
WS-R is PIC S9. What does it contain after this statement?
COMPUTE WS-R = FUNCTION MOD(-7, 3)
  1. -1
  2. 2
  3. 1
  4. -2
Editing and reports5
81Лёгкий
WS-OUT is PIC ZZZ9. What does it contain after MOVE 42 TO WS-OUT?
  1. '0042'
  2. '42 '
  3. 'ZZ42'
  4. ' 42'
82Сложный
WS-AMT is PIC 9(5)V99 VALUE 1234.50 and WS-OUT is PIC $$$,$$9.99. What is in WS-OUT after MOVE WS-AMT TO WS-OUT?
  1. '$01,234.50'
  2. '$ 1,234.50'
  3. ' $1,234.50'
  4. '$$$1,234.50'
83Средний
WS-AMT is PIC S999 VALUE +25 and WS-OUT is PIC ZZ9CR. What is in WS-OUT after MOVE WS-AMT TO WS-OUT?
  1. ' 25CR'
  2. ' 25 '
  3. ' 25+ '
  4. '025DB'
84Средний
WS-OUT is PIC ***9.99. What does it contain after MOVE 12.5 TO WS-OUT?
  1. '**12.50'
  2. ' 12.50'
  3. '0012.50'
  4. '***12.5'
85Лёгкий
In what format does ACCEPT WS-DATE FROM DATE return the date?
  1. YYYYMMDD
  2. DDMMYY
  3. YYMMDD
  4. YYDDD (Julian)
Mainframe environment5
86Лёгкий
In z/OS JCL, which statement names the program a job step runs?
  1. //STEP1 DD PGM=PAYROLL
  2. //PAYJOB JOB PGM=PAYROLL
  3. //SYSOUT RUN PAYROLL
  4. //STEP1 EXEC PGM=PAYROLL
87Средний
What does DISP=(NEW,CATLG,DELETE) on a DD statement mean?
  1. Create the data set; catalog it if the step ends normally; delete it if the step abends
  2. Delete any old version, create a new one, and catalog it in all cases
  3. Open the data set for update, then catalog and delete it at job end
  4. Create the data set only if it is already cataloged
88Средний
A file sorted ascending on the mainframe (EBCDIC) contains keys starting with digits, upper-case and lower-case letters. In which order do they appear?
  1. Digits, upper case, lower case
  2. Lower case, upper case, digits
  3. Upper case, lower case, digits
  4. Digits, lower case, upper case
89Средний
No row in CUST has ID equal to WS-ID. What is SQLCODE after this statement?
EXEC SQL
    SELECT NAME INTO :WS-NAME
      FROM CUST
     WHERE ID = :WS-ID
END-EXEC
  1. 0, and WS-NAME is set to spaces
  2. -100
  3. +100
  4. -811
90Сложный
What makes a CICS transaction pseudo-conversational?
  1. It keeps the program in memory while the user types, waiting on EXEC CICS RECEIVE
  2. It runs as a batch job submitted from the terminal
  3. It uses DB2 instead of VSAM files
  4. After sending a screen it ends with EXEC CICS RETURN TRANSID(...) COMMAREA(...), and the next input starts it again with the saved state
Modern COBOL5
91Лёгкий
Which body designed the original COBOL specification in 1959?
  1. ANSI X3.23
  2. CODASYL, the Conference on Data Systems Languages
  3. IBM's System/360 design team
  4. ISO/IEC JTC 1
92Средний
Which GnuCOBOL command compiles hello.cob into a standalone executable?
  1. cobc -x hello.cob
  2. cobc hello.cob
  3. cobc -m hello.cob
  4. cobcrun hello.cob
93Лёгкий
Since COBOL 2002, which character sequence starts a comment that can follow code on the same line?
  1. //
  2. --
  3. *>
  4. An asterisk in column 7
94Средний
What does the JSON GENERATE statement (IBM Enterprise COBOL 6) do?
  1. Generates a COBOL copybook from a JSON schema at compile time
  2. Parses JSON text into a group item
  3. Sends an HTTP request with a JSON body
  4. Converts a group data item into JSON text, using data names as the JSON keys
95Сложный
A GnuCOBOL program calls a C function that expects a char * string: CALL 'greet' USING BY REFERENCE WS-NAME, where WS-NAME is PIC X(20) VALUE 'ANN'. What is the risk?
  1. None: COBOL adds a terminating NUL to every BY REFERENCE alphanumeric item
  2. C receives a pointer to 20 bytes padded with spaces and no terminating NUL, so it may read past the field
  3. C receives the value 'ANN' by value and cannot read it as a pointer
  4. The call fails at compile time because C functions need BY VALUE
Common pitfalls5
96Лёгкий
A mainframe COBOL batch job abends with S0C7. What is the usual cause?
  1. Arithmetic on a packed or zoned decimal field that contains invalid, non-numeric data
  2. A file was not found on OPEN
  3. The program ran out of CPU time
  4. Division by zero in a floating-point field
97Средний
WS-A contains 5. What is displayed?
IF WS-A > 10
    DISPLAY 'BIG'
    MOVE 'Y' TO WS-FLAG.
    DISPLAY 'FLAG SET'.
  1. Nothing
  2. BIG and FLAG SET
  3. BIG
  4. FLAG SET
98Средний
What do WS-CODE and WS-QTY contain after INITIALIZE WS-REC?
01 WS-REC.
   05 WS-CODE PIC X(3) VALUE 'ABC'.
   05 WS-QTY  PIC 9(3) VALUE 7.
...
MOVE 'XYZ' TO WS-CODE
MOVE 99 TO WS-QTY
INITIALIZE WS-REC
  1. 'ABC' and 007
  2. 'XYZ' and 000
  3. Spaces and 000
  4. Low-values in both fields
99Сложный
What is in D-NUM after MOVE SRC TO DST?
01 SRC.
   05 S-NUM PIC 9(3) VALUE 42.
01 DST.
   05 D-NUM PIC 9(5).
...
MOVE SRC TO DST
  1. 00042
  2. '042' followed by two spaces
  3. ' 042'
  4. Nothing: a compile error, because group sizes differ
100Средний
A table has OCCURS 10 TIMES and the program sets an element with subscript 11. With default compiler options (no IBM SSRANGE, no GnuCOBOL -debug or bound checks), what usually happens?
  1. No check is made: the program writes into the storage after the table, silently corrupting other data
  2. The table grows to 11 elements automatically
  3. The subscript wraps around to element 1
  4. The statement is skipped and a warning is written to SYSOUT

Как проходить тест

  • Выберите темы и уровень — лёгкий уровень проверяет определения и задачи в одно действие, средний — стандартные вычисления, сложный — многошаговые задачи и теорию.
  • Отвечайте касанием или с клавиатуры: 1–4 или A–D, Enter — следующий вопрос.
  • Читайте объяснения — после ошибки разбор открывается сразу, после верного ответа его можно раскрыть кнопкой «Почему».
  • Работайте над ошибками — «Повторить ошибки» в конце теста или режим «Только мои ошибки» потом: ответы запоминаются в этом браузере.

Незавершённый тест сохраняется — после перезагрузки страницы можно продолжить с того же вопроса.

Темы теста

  • Program structure 5
  • Data division and PICTURE 5
  • USAGE and storage 5
  • Level numbers 5
  • MOVE and data conversion 5
  • Arithmetic 5
  • Conditions 5
  • Loops and PERFORM 5
  • Tables 5
  • Strings 5
  • File handling 5
  • File status and errors 5
  • Subprograms 5
  • Copybooks and compiler directives 5
  • Sorting and merging 5
  • Intrinsic functions 5
  • Editing and reports 5
  • Mainframe environment 5
  • Modern COBOL 5
  • Common pitfalls 5