Mainframe Interview Questions

Q:

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.

Answer

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-2


GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.


 


file-1 is the sort workfile 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 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 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.

Report Error

View answer Workspace Report Error Discuss

0 1767
Q:

What guidelines should be followed to write a structured COBOL program ?

Answer

Following guidelines to be following while writing Cobol program:


- Use ? EVALUATE ? statement for constructing cases.


- Use scope terminators for nesting.


- Use in-line Perform statement for writing ?do? constructions.


- Use Test Before and Test After in the Perform statement while writing Do-While statements.

Report Error

View answer Workspace Report Error Discuss

0 1724
Q:

What is COPY PENDING status?

Answer

- A status occurs when image copy on a table needs to be taken


- The table is available only for queries and can not be updated


- COPY PENDING status can be removed by taking away the image copy or by using REPAIR utility

Report Error

View answer Workspace Report Error Discuss

0 1690
Q:

What is meant by index cardinality?

Answer

The number of distinct values for a column is called index cardinality. DB2's RUNSTATS utility analyzes column value redundancy to determine whether to use a tablespace or index scan to search for data.

Report Error

View answer Workspace Report Error Discuss

0 1669
Q:

What is the self-referencing constraint?

Answer

A31. The self-referencing constraint limits in a single table the changes to a primary key that the related foreign key defines. The foreign key in a self referencing table must specify the DELETE CASCADE rule.

Report Error

View answer Workspace Report Error Discuss

0 1662
Q:

How will u send data from a cobol file to db2 table?

Answer

USING HOST VARIABLE we can pass data from COBOL to DB2

Report Error

View answer Workspace Report Error Discuss

0 1656
Q:

What is the CICS LOAD command ?

Answer

The LOAD command retrieves an object program from disk and loads it into main storage - it's primarily used for a constant table that will be available system-wide.


 

Report Error

View answer Workspace Report Error Discuss

0 1651
Q:

What is the difference between the enter key, the PF keys and the PA keys?

Answer

The enter and PF keys transmit data from the screen; the PA keys tell CICS that a terminal action took place, but data is not transmitted.

Report Error

View answer Workspace Report Error Discuss

0 1649