COBOL and Easytrieve Programming: Data Types, SORT, and Date Functions

Tests knowledge of mainframe programming including COBOL SORT statements, COMP/COMP-3 data types, array performance, and Easytrieve date functions and report generation

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Keyword Functions are evaluated from

  1. Left to Right
  2. Right to left
  3. Middle
  4. second Character
Question 2 True/False

Is it possible to get advance/Past date values thru Keyword Parms

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

Which symbol is used to ensure whether a valid date is returned or not

  1. $
  2. #
  3. &
  4. *
Question 4 Multiple Choice (Single Answer)

If the job run in November 2010 |EZCYMFP4| will return

  1. 201006
  2. 201007
  3. 201004
  4. 201005
Question 5 Multiple Choice (Single Answer)

|EZMSDSY| will return ( give answer MM-Month DD-Date YY -Year format)

  1. MM/DD/YY
  2. MM-DD-YY
  3. DD-MM-YY
  4. DD/MM/YY
Question 6 Multiple Choice (Single Answer)

Which one among the given data type is best if u need performance (need to save more CPU) for your arithmetic computations

  1. COMP
  2. COMP-3 SIGN LEADING
  3. COMP-1 SIGN LEADING
  4. COMP-3 SIGN LEADING SEPARATE
Question 7 Multiple Choice (Single Answer)

How the data +89 is stored internally if u use the data type COMP

  1. Ox4EF5 F9
  2. OxF8F9
  3. OxC5F9
  4. Ox0059
Question 8 Multiple Choice (Single Answer)

Where do we need to declare the sorting key ACCOUNT-NO for the following syntax SORT WORK-FILE ON ASCENDING KEY ACCOUNT-NO USING FILE-NAME-1 GIVING FILE-NAME-2

  1. WORK-FILE
  2. FILE-NAME-1
  3. FILE-NAME-2
  4. No need to declare
Question 9 Multiple Choice (Single Answer)

In a sort when the control transfers to the para TEST-ACCOUNT-PARA for the following syntax SORT FILE-NAME-1 ON ASCENDING KEY ACCOUNT-NO INPUT PROCEDURE IS TEST-ACCOUNT-PARA USING FILE-NAME-2 OUTPUT PROCEDURE IS WRITE-ACCOUNT-PARA GIVING FILE-NAME-3

  1. Before sort
  2. After sort
  3. For each record in the sort
  4. For the last record
Question 10 Multiple Choice (Single Answer)

Which is more efficient search, if your number of records is more and the input is sorted

  1. Binary Search
  2. Sequential Search
  3. Both a and b
  4. None
Question 11 Multiple Choice (Single Answer)

If you need performance which is the best for your array variable

  1. Using Index to access
  2. Using subscript to access
  3. Both a and b
  4. None of the above
Question 12 Multiple Choice (Single Answer)

How many bytes will be taken if you store your data +12345 in S9(05) comp-3

  1. 3 BYTES
  2. 4 BYTES
  3. 5 BYTES
  4. 2 BYTES
Question 13 Multiple Choice (Single Answer)

The only section that is mandatory in an easytrieve program

  1. Library section
  2. Environment definition
  3. Activity definition
  4. NONE OF THE ABOVE
Question 14 True/False

The same variable name cannot be used in more than one file

  1. True
  2. False
Question 15 Multiple Choice (Single Answer)

The parameter used with the REPORT statement that can be used to sort the report based on a field

  1. SORT
  2. SEQUENCE
  3. CONTROL
  4. None of the above
Question 16 Multiple Choice (Single Answer)

The I/O statements that are used for random access

  1. READ and WRITE
  2. GET and PUT
  3. Both a and b
  4. None of the above
Question 17 True/False

Any DB2 select query which is not part of the JOB INPUT SQL statement should be used as a cursor

  1. True
  2. False
Question 18 Multiple Choice (Single Answer)

The parameter LINESIZE used with the REPORT statement should have the length

  1. Equal to lrecl of the file
  2. Greater than lrecl of the file
  3. Equal to lrecl – 1
  4. Equal to lrecl + 1
Question 19 True/False

While comparing files using MATCHED keyword, only one key field can be used

  1. True
  2. False
Question 20 Multiple Choice (Single Answer)

In case of controlled processing, the JOB statement should be defined as

  1. JOB INPUT SQL
  2. JOB INPUT NULL
  3. JOB INPUT filename
  4. None of the above