TCS COBOL Interview Questions Answers

11/01/2009 No Comment

TCS Mainframe COBOL Interview Questions Answers.

What is an explicit scope terminator?
Answer : 
A scope terminator brackets its preceding verb, eg. 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.

What are the different forms of EVALUATE statement?
Answer :
EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS
WHEN A=B AND C=D WHEN 100 ALSO '00'
Imperative stmt imperative stmt

WHEN (D+X)/Y = 4 WHEN -305 ALSO '32'
imperative stmt imperative stmt

WHEN OTHER WHEN OTHER
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE
EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE

WHEN 100 ALSO TRUE WHEN 100 ALSO A=B
imperative stmt imperative stmt

WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE

Can you use the INSPECT (with TALLYING option) Cobol verb in a CICS COBOL program?
Answer :
Yes, under COBOL II environment, but not OS/VS COBOL.

What is the significance of 'above the line' and 'below the line'?
Answer :
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 address 16 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.)

What was removed from COBOL in the COBOL II implementation?
Answer :
Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE.

Explain call by context by comparing it to other calls.
Answer :
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.

What is the difference between comp and comp-3 usage? Explain other COBOL usages.
Answer :
Comp is a binary usage, while comp-3 indicates packed decimal. The other common usages are binary and display. Display is the default. Comp is defined as the fastest/preferred numeric data type for the machine it runs on. IBM Mainframes are typically binary and AS400's are packed.'

What are the possible causes for S0C1 & S0C4 abends?
Answer :
A S0C1 occurs if the CPU attempts to execute binary code that isn't a valid machine instruction; e.g. if you attempt to execute data. A S0C4 is a memory protection violation. This occurs if a program attempts to access storage beyond the areas assigned to it.

What happens when we move a comp-3 field to an edited ( say z(9).zz-)
Answer :
The editing characters are to be used with data items with usage clause as display, which is the default. When you try displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired.

Explain what are the causes for S0C1, S0C4, S0C5, S0C7, S0CB abends?
Answer :
S0C1 - May be due to 1.Missing or misspelled DD name 2.Read/Write to unopened dataset 3.Read to dataset opened output 4.Write to dataset opened input 5.Called subprogram not found. S0C4 may be due to 1.Missing Select statement(during compile) 2.Bad Subscript/index 3.Protection Exception 4.Missing parameters on called subprogram 5.Read/Write to unopened file 6.Move data from/to unopened file.
S0C5 May be due to 1.Bad Subscript/index 2.Close an unopen dataset 3.Bad exit from a perform 4.Access to I/O area(FD) before read.
S0C7 may be due to 1.Numeric operation on non-numeric data 2.Un-initialize working-storage 3.Coding past the maximum allowed sub script. S0CB may be due to 1.Division by Zero

What would happen if you code GO BACK instead of STOP RUN in a stand-alone COBOL program i.e. a program which is not calling any other program.
Answer :
Both will give the same results when a program is not calling any other program.

What is the difference between an External and a Global Variable 's?
Answer :
Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library.
Related Posts


No comments :

 

Aired | The content is copyrighted and may not be reproduced on other websites. | Copyright © 2009-2016 | All Rights Reserved 2016

Contact Us | About Us | Privacy Policy and Disclaimer