COBOL-JCL Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Rg.sharma0912
R
Rg.sharma0912
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,909
Questions: 29 | Attempts: 1,909

SettingsSettingsSettings
COBOL-JCL Quiz - Quiz

Batch T77 Cobol-JCL Quiz.


Questions and Answers
  • 1. 

    The following statement WRITE OUT-REC. Which one of the following modes of operating the Sequential file is not true?

    • A.

      OPEN INPUT

    • B.

      OPEN INPUT-OUTPUT

    • C.

      OPEN EXTEND

    • D.

      OPEN OUTPUT

    Correct Answer
    A. OPEN INPUT
    Explanation
    The correct answer is OPEN INPUT. This is not a valid mode of operating a sequential file. The OPEN INPUT statement is used to open a file for reading data from it, but it does not allow for writing or modifying the file. Therefore, it is not true that OPEN INPUT can be used to operate a sequential file in all modes.

    Rate this question:

  • 2. 

     The UNSTRING verb is used to transfer data from several sources to one receiving field.

    • A.

      YES

    • B.

      NO

    Correct Answer
    B. NO
    Explanation
    The UNSTRING verb is used to split a string into multiple fields based on a delimiter. It does not transfer data from several sources to one receiving field. Therefore, the correct answer is NO.

    Rate this question:

  • 3. 

    Indicate which of the following is true about the 88 level entry.

    • A.

      it is used for individual data item in working-storage section.

    • B.

      It is used for items with rename clause.

    • C.

      It is used for a data item which redefines another data item.

    • D.

      It is used for a condition name which can have either a true or false.

    Correct Answer
    D. It is used for a condition name which can have either a true or false.
    Explanation
    The 88 level entry in COBOL is used for a condition name which can have either a true or false value. It is typically used in the PROCEDURE DIVISION to test the condition and execute different sections of code based on the result. This allows for more efficient and readable code as the condition name can be used instead of writing out the full condition each time it is tested.

    Rate this question:

  • 4. 

     IF NOT AGE LESS THAN 30 AND 40 GO TO PARA-AGE-MIDDLES. The controls will go to the paragraph named PARA-AGE-MIDDLE.

    • A.

      If AGE is greater than or equal to 40.

    • B.

      If AGE is greater than or equal to 30.

    • C.

      If AGE is greater than or equal to 30 but less than 40.

    • D.

      If AGE is less than or equal to 30.

    Correct Answer
    C. If AGE is greater than or equal to 30 but less than 40.
    Explanation
    The given correct answer suggests that if the age is greater than or equal to 30 but less than 40, the controls will go to the paragraph named PARA-AGE-MIDDLE. This means that if the age falls within this range, a specific set of instructions or actions will be executed in the PARA-AGE-MIDDLE paragraph.

    Rate this question:

  • 5. 

     IF A = 1 OR 2 OR 3 NEXT SENTENCE ELSE MOVE A TO B.

    • A.

      IF A NOT = 1 OR 2 OR 3 MOVE A TO B.

    • B.

      IF NOT A = 1 AND 2 AND 3 MOVE A TO B.

    • C.

      IF A NOT = 1 AND 2 AND 3 MOVE A TO B.

    • D.

      IF A NOT = 1 OR A NOT = 2 OR A NOT = 3 MOVE A TO B.

    Correct Answer
    C. IF A NOT = 1 AND 2 AND 3 MOVE A TO B.
    Explanation
    The correct answer is "IF A NOT = 1 AND 2 AND 3 MOVE A TO B." This answer correctly represents the condition where if A is not equal to 1 and is also not equal to 2 and 3, then A should be moved to B. The other options either use incorrect syntax or do not accurately represent the given condition.

    Rate this question:

  • 6. 

     Determine the total number of bytes in the following. 01 REC-1. 02 FIRST-GROUP.      03 A1 PIC X(4).      03 A2 PIC 99. 02 B1 REDEFINES FIRST-GROUP.      03 A3 PIC 999.      03 A4 PIC 999. 02 THIRD-GROUP.     03 A5 OCCURS 5 TIMES PIC 99.

    • A.

      22

    • B.

      16

    • C.

      12

    • D.

      14

    Correct Answer
    B. 16
    Explanation
    The correct answer is 16 because there are a total of 16 bytes in the given structure. Each level 01 entry takes up 4 bytes (REC-1 and THIRD-GROUP), each level 02 entry takes up 2 bytes (FIRST-GROUP and B1), and each level 03 entry takes up 2 bytes (A1, A2, A3, A4, and A5). Therefore, the total number of bytes is 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 = 16.

    Rate this question:

  • 7. 

     The association between a filename and corresponding file medium is done in

    • A.

      Date-compiled paragraph, identification division

    • B.

      Object-computer paragraph, configuration section and environment division

    • C.

      File-control paragraph, I-O Section and environment division

    • D.

      I-O control paragraph, I-O Section and environment division.

    Correct Answer
    C. File-control paragrapH, I-O Section and environment division
    Explanation
    The correct answer is File-control paragraph, I-O Section and environment division. This is because the association between a filename and corresponding file medium is defined in the File-control paragraph, which is part of the I-O Section in the environment division.

    Rate this question:

  • 8. 

    Indicate which one of the following is incorrect

    • A.

      SUBTRACT A FROM B GIVING D E F.

    • B.

      SUBTARCT A FROM D, B FROM E, C FROM F.

    • C.

      SUBTARCT A B C FROM D E GIVING F G.

    • D.

      SUBTRACT A B C FROM D E F.

    Correct Answer
    B. SUBTARCT A FROM D, B FROM E, C FROM F.
    Explanation
    The correct answer is "SUBTARCT A FROM D, B FROM E, C FROM F." This statement is incorrect because the word "SUBTARCT" is misspelled. The correct spelling is "SUBTRACT."

    Rate this question:

  • 9. 

    Which of the following statement is incorrect.

    • A.

      Subscripting enables us to write a more compact code in the procedure division.

    • B.

      Subscripting enables us to refer to any element of a table by the same data name with the facility of identifying the particular element through the values of subscript.

    • C.

      Subscripting reduces the number of entries to be included in the data division.

    • D.

      Subscripting enables us to use loops in the procedure division.

    Correct Answer
    D. Subscripting enables us to use loops in the procedure division.
    Explanation
    The given statement is incorrect because subscripting enables us to use loops in the procedure division. Subscripting allows us to refer to any element of a table by the same data name with the facility of identifying the particular element through the values of subscript. It also helps in writing more compact code in the procedure division. Additionally, subscripting does not reduce the number of entries to be included in the data division.

    Rate this question:

  • 10. 

    The following is Data Division entry 01 EMP-RECORD. 02 EMP-NAME. 04 FIRST-PART. 05 FIRST-NAME PIC X (10). 05 MIDDLE-NAME PIC X (10). 04 SURNAME PIC X(20).

    • A.

      It is correct.

    • B.

      It is not correct because first-name and middle name contain the same PIC Clauses

    • C.

      Not correct because the PIC Clause is missing for the first three data items.

    • D.

      Not correct because the level number 03 is missing

    Correct Answer
    A. It is correct.
    Explanation
    The given answer is correct because the Data Division entry is properly structured according to the COBOL programming language syntax. The EMP-RECORD is defined as a group item with two sub-items, EMP-NAME and SURNAME. EMP-NAME is further divided into two sub-items, FIRST-PART and MIDDLE-NAME, each with a PIC clause specifying the data type and length. The code follows the correct hierarchy and includes all necessary PIC clauses, making the entry correct.

    Rate this question:

  • 11. 

    Determine the size of the data item -9(4). 99

    • A.

      6

    • B.

      7

    • C.

      8

    • D.

      4

    Correct Answer
    C. 8
    Explanation
    The answer 8 refers to the size of the data item -9(4). This indicates that the data item is a signed numeric value with a length of 4 digits, including the sign. The negative sign occupies one digit, leaving 3 digits for the actual numeric value. Therefore, the size of the data item is 8 bytes.

    Rate this question:

  • 12. 

    To describe a record the level numbers may be chosen from

    • A.

      01 to 77

    • B.

      01 to 49 and 77

    • C.

      All odd numbers from 01 to 49

    • D.

      01 to 49

    • E.

      All of Above

    Correct Answer
    D. 01 to 49
    Explanation
    The correct answer is "01 to 49." This is because level numbers in COBOL can range from 01 to 49. These level numbers are used to describe the structure and hierarchy of data records in a COBOL program.

    Rate this question:

  • 13. 

    The following is a Procedure division statement READ IN-FILE INTO IN-REC AT END CLOSE IN-FILE STOP RUN. Where IN-REC is the record-name of IN-FILE. Which one of the following is Correct?

    • A.

      The AT END path is followed if any record becomes shorter than the record Definition.

    • B.

      The statement is correct since IN-REC is the record name of the IN-FILE

    • C.

      The statement is incorrect since AT END should be followed by GO TO statement

    • D.

      The AT END path is taken if all the records have been read and the current read encounters the end of file.

    Correct Answer
    D. The AT END path is taken if all the records have been read and the current read encounters the end of file.
    Explanation
    The statement is correct because the AT END path is taken when all the records have been read and the current read encounters the end of the file.

    Rate this question:

  • 14. 

    The Cobol compiler at the time of compilation indicates the error in the following Statement MULTIPLY 0.1 BY A. Which of the following had given the correct clause?

    • A.

      A has the PICTURE CLAUSE 9(4) V99.

    • B.

      A has the PIC CLAUSE ZZZ9.9

    • C.

      The Giving Option is missing

    • D.

      A is declared in the file section and not in the working storage section

    Correct Answer
    B. A has the PIC CLAUSE ZZZ9.9
    Explanation
    The correct answer is A has the PIC CLAUSE ZZZ9.9. This is because the MULTIPLY statement is trying to multiply a decimal value (0.1) with a numeric value (A), but A is declared with a picture clause that does not match the expected format. The ZZZ9.9 picture clause allows for a signed numeric value with three digits before the decimal point and one digit after the decimal point. Therefore, the compiler indicates an error because the picture clause of A does not match the expected format for the MULTIPLY statement.

    Rate this question:

  • 15. 

    In DATA DIVISION the entries are 01 BILL. 02 A PIC 99. 02 FILLER PIC X(7). Indicate which one of the following statement in the Procedure division is correct

    • A.

      MOVE ‘AB’ TO A.

    • B.

      MOVE SPACES TO A.

    • C.

      MOVE ZEROS TO A.

    • D.

      MOVE SPACE TO FILLER.

    Correct Answer
    C. MOVE ZEROS TO A.
    Explanation
    In the given DATA DIVISION, the entry "01 BILL" declares a data item named BILL. It has two sub-items: "02 A PIC 99" which is a numeric data item with a length of 2, and "02 FILLER PIC X(7)" which is a character data item with a length of 7.

    In the Procedure division, the statement "MOVE ZEROS TO A" is correct. This statement will initialize the numeric data item A to zero. Since A is declared as PIC 99, it can only hold numeric values. Therefore, the statement "MOVE ZEROS TO A" is the correct way to initialize it.

    Rate this question:

  • 16. 

    The picture of RAFFLES IS 02 RAFFLES PIC 999V99 What will be the content of raffles when the following data is named to it? 7892^23

    • A.

      78922

    • B.

      89223

    • C.

      78900

    • D.

      89223

    Correct Answer
    B. 89223
  • 17. 

    How many number of bytes involved in S9(11) COMP3?

    • A.

      6 bytes

    • B.

      10 bytes

    • C.

      12 bytes

    • D.

      5 bytes

    Correct Answer
    A. 6 bytes
    Explanation
    S9(11) COMP3 is a data type in COBOL that represents a signed decimal number with a maximum length of 11 digits. COMP3 uses a packed decimal format, where each digit is stored in half a byte (nibble). Since each byte consists of 2 nibbles, the total number of bytes required can be calculated by dividing the number of digits by 2. In this case, 11 digits divided by 2 equals 5.5 bytes. However, since bytes cannot be divided into halves, the result is rounded up to the nearest whole number, which is 6. Therefore, the correct answer is 6 bytes.

    Rate this question:

  • 18. 

    Four data-names VAR-1, VAR-2, VAR-3 and VAR-4 are defined as following         Data-name           PIC clause    Value Initialized to         VAR-1               999            015         VAR-2               999            005         VAR-3               999            000         VAR-4               999            000       On executing the PROCEDURE DIVISION statement         DIVIDE VAR-1 INTO VAR-2 GIVING VAR-3                REMAINDER VAR-4       these data-names will respectively assume values:

    • A.

      15, 0, 0, 5

    • B.

      15, 5, 3, 0

    • C.

      3, 5, 3, 0

    • D.

      15, 5, 0, 5

    Correct Answer
    D. 15, 5, 0, 5
    Explanation
    The DIVIDE statement divides the value of VAR-1 by the value of VAR-2 and stores the quotient in VAR-3 and the remainder in VAR-4. In this case, VAR-1 is initialized to 015 and VAR-2 is initialized to 005. When VAR-1 is divided by VAR-2, the quotient is 3 and the remainder is 0. Therefore, VAR-3 will have the value 3 and VAR-4 will have the value 0.

    Rate this question:

  • 19. 

    Which one out of the following is incorrect?

    • A.

      RENAME is used to regroup elementary items in a group.

    • B.

      Renamed elementary items must be contiguous memory

    • C.

      A Special level number 66 is used with RENAME clause

    • D.

      RENAME clause can regroup a 01, 77, 88 or 66 entry.

    Correct Answer
    D. RENAME clause can regroup a 01, 77, 88 or 66 entry.
  • 20. 

    EDITED PICTURE ITEMS can not  HAVE VALUE CLAUSE.

    • A.

      True

    • B.

      FALSE

    • C.

      None of above

    Correct Answer
    A. True
    Explanation
    The statement is saying that edited picture items cannot have a value clause. This means that when a picture is edited, it cannot have a clause that specifies its value. In other words, the value of an edited picture cannot be determined or specified. Therefore, the correct answer is True.

    Rate this question:

  • 21. 

    PERFORM UPDATE-INPUT UNTIL DONE       Irrespective of the context in which it is given, it may be said that

    • A.

      DONE is a data-name whose value gets defined in an exception handling section

    • B.

      DONE is a condition-name

    • C.

      DONE is a data-name whose value gets decremented at each exit of the paragraph

    • D.

      DONE is a data-name whose value gets decremented at each entry of the paragraph.

    Correct Answer
    B. DONE is a condition-name
    Explanation
    In the given question, it is stated that "DONE is a condition-name." A condition-name is a user-defined identifier in COBOL that represents a condition or a set of conditions. It is used in conditional statements to evaluate whether a condition is true or false. Therefore, in the context of the given question, "DONE" is being referred to as a condition-name.

    Rate this question:

  • 22. 

    Consider the following PROCEDRE DIVISION statement:         IF VAR1 LESS THAN VAR2 WRITE REC-1         ELSE WRITE REC-2       If, before executing this statement, VAR1 contains alphanumeric       Literal 'l' and VAR2 contains alphanumeric literal 'A', then

    • A.

      REC-1 is always written

    • B.

      REC-2 is always written

    • C.

      Action depends on the computer system on which the program runs

    • D.

      Compiler error results

    Correct Answer
    A. REC-1 is always written
    Explanation
    The given IF statement checks if VAR1 is less than VAR2. If VAR1 contains the alphanumeric literal 'l' and VAR2 contains the alphanumeric literal 'A', then 'l' is less than 'A' in alphanumeric comparison. Therefore, the condition VAR1 LESS THAN VAR2 is true, and as a result, REC-1 is always written.

    Rate this question:

  • 23. 

    The record description of EMPLOYEE-RECORD is given in four different ways below.  The only correct choice is:  A) 01 EMPLOYEE-RECORD. 10  EMP-CODE   PIC X(6). 10  EMP-NAME   PIC X(25). 10  FILLER     PIC X(60). B) 01 EMPLOYEE-RECORD    PIC X(91) USAGE COMP. 10  EMP-CODE       PIC X(6). 10  EMP-NAME       PIC X(25). 10  FILLER          PIC X(60). C) 01 EMPLOYEE-RECORD. 05  EMP-CODE       PIC X(6). 10  EMP-NAME       PIC X(25). 15  FILLER          PIC X(60). D) 01 EMPLOYEE-RECORD    PIC X(91). 10  EMP-CODE       PIC X(6). 10  EMP-NAME       PIC X(25). 10  FILLER.

    • A.

      B

    • B.

      A

    • C.

      C

    • D.

      D

    Correct Answer
    B. A
  • 24. 

     In order to continue a job after a return code of 12 in step1, what the step2 EXEC statement include?

    • A.

      COND = (12,LE)

    • B.

      COND = (12,NE)

    • C.

      COND = (12,GE)

    • D.

      COND = (12,EQ)

    Correct Answer
    B. COND = (12,NE)
    Explanation
    The correct answer is COND = (12,NE). This means that the job will continue to execute step2 if the return code of step1 is not equal to 12. The "NE" in the COND parameter stands for "not equal", so it ensures that the job will proceed if the return code is anything other than 12.

    Rate this question:

  • 25. 

     How can values be passed from the job stream to an executable program?

    • A.

      Through the PARM keyword

    • B.

      Through the VALUE parameter

    • C.

      Through the PGM parameter

    • D.

      All of the above

    Correct Answer
    A. Through the PARM keyword
    Explanation
    Values can be passed from the job stream to an executable program through the PARM keyword. The PARM keyword allows for the specification of values that will be passed as parameters to the program. This allows for flexibility and customization in the execution of the program based on the values passed through the job stream.

    Rate this question:

  • 26. 

    What parameter directs the output of the job log dataset

    • A.

      JOBLOG

    • B.

      MSGCLASS

    • C.

      MSGLEVEL

    • D.

      SYSLOG

    Correct Answer
    B. MSGCLASS
    Explanation
    The parameter that directs the output of the job log dataset is MSGCLASS. This parameter specifies the class of messages that are written to the job log dataset. By setting the MSGCLASS parameter, you can control the type of messages that are included in the job log dataset, allowing you to filter and organize the output based on your needs.

    Rate this question:

  • 27. 

     If both the JOBLIB & STEPLIB statements are coded in a step, which will be executed?

    • A.

      JOBLIB

    • B.

      STEPLIB

    • C.

      JCL ERROR " Object module present in both library "

    • D.

      Both the statements will be executed in sequence

    Correct Answer
    B. STEPLIB
    Explanation
    If both the JOBLIB and STEPLIB statements are coded in a step, the STEPLIB statement will be executed. This is because the STEPLIB statement takes precedence over the JOBLIB statement. The STEPLIB statement is used to specify the libraries that contain the load modules for the program being executed in the step, while the JOBLIB statement is used to specify the libraries that contain the load modules for the entire job. Therefore, the STEPLIB statement is more specific to the current step and will be executed first.

    Rate this question:

  • 28. 

    Input file have below record layout. 01  Input-Record.     05  Name       PIC X(20).     05  EMP-ID     PIC 9(06). Which is correct verb to exclude specific EMP-ID using SORT job.

    • A.

      OMIT COND

    • B.

      INREC COND

    • C.

      EXLCUDE COND

    • D.

      INCLUDE COND

    Correct Answer
    A. OMIT COND
    Explanation
    The correct verb to exclude specific EMP-ID using SORT job is OMIT COND. This verb is used in the SORT job control statements to exclude records based on specified conditions. It allows the user to specify a condition that, if true, will cause the record to be omitted from the output. In this case, the user can specify a condition to exclude specific EMP-ID values from the output file.

    Rate this question:

  • 29. 

    What is COND=EVEN ?

    • A.

      Means execute this step even if any of the previous steps, terminated abnormally.

    • B.

      Means execute this step even if any of the previous steps, terminated normally.

    • C.

      In all situation step will execute.

    • D.

      Step will bypass.

    Correct Answer
    A. Means execute this step even if any of the previous steps, terminated abnormally.
    Explanation
    COND=EVEN means that the step should be executed even if any of the previous steps terminated abnormally. This means that regardless of whether the previous steps completed successfully or not, the current step will still be executed. It ensures that the current step is not dependent on the success or failure of the previous steps.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Sep 01, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 31, 2013
    Quiz Created by
    Rg.sharma0912
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.