Recently faced mainframe cobol Interview Questions.
Moderators: Anuj Dhawan, Moderator Group
Recently faced mainframe cobol Interview Questions.
Hi,
The below are few of the interview questions I've faced recently. Appreciate if you could provide answers.
1). What happens if you add a copybook to linkage section instead of adding it to a working-storage section in a sub-program?
2). There are select queries on a table in a COBOL-DB2 program. After pre-compilation, each select query is replaced by equivalent cobol statements. If you look at them, is it possible to find out which statement belongs to which query?
3). What is the basic consideration to use static / dynamic call and justification?
4). While writing a new COBOL program, how do you decide upon whether a varaible should be declared as COMP, COMP-1, COMP-2, COMP-3? What is the basis and justification?
5). A field of a DB2 table is updated. How do you test it? What is the we exactly look in the job to know whether the field is updated properly or not?
6). There are different calls in COBOL, Call by content, Call by value and Call by reference. Is it possible that a single CALL statement have all these varieties? When do you go for each one of these? What is the basis and justification?
7). When do we use null indicator of a field? Does the usage of it have any benefits?
8 ). What are the other ways of passing data to a JCL to program? (I know passing of data using PARM, Instream data and datasets).
9). Can you have multiple indexes on a table or array? What is the advantage?
10). What are the advantages of declaring the VARCHAR in 49 level in a COBOL-DB2 program?
Please clear my doubts.
TIA.
The below are few of the interview questions I've faced recently. Appreciate if you could provide answers.
1). What happens if you add a copybook to linkage section instead of adding it to a working-storage section in a sub-program?
2). There are select queries on a table in a COBOL-DB2 program. After pre-compilation, each select query is replaced by equivalent cobol statements. If you look at them, is it possible to find out which statement belongs to which query?
3). What is the basic consideration to use static / dynamic call and justification?
4). While writing a new COBOL program, how do you decide upon whether a varaible should be declared as COMP, COMP-1, COMP-2, COMP-3? What is the basis and justification?
5). A field of a DB2 table is updated. How do you test it? What is the we exactly look in the job to know whether the field is updated properly or not?
6). There are different calls in COBOL, Call by content, Call by value and Call by reference. Is it possible that a single CALL statement have all these varieties? When do you go for each one of these? What is the basis and justification?
7). When do we use null indicator of a field? Does the usage of it have any benefits?
8 ). What are the other ways of passing data to a JCL to program? (I know passing of data using PARM, Instream data and datasets).
9). Can you have multiple indexes on a table or array? What is the advantage?
10). What are the advantages of declaring the VARCHAR in 49 level in a COBOL-DB2 program?
Please clear my doubts.
TIA.
========
Ranga...:-0)
========
Learn Which You Don't Know - Teach Others Which They Don't Know.
Ranga...:-0)
========
Learn Which You Don't Know - Teach Others Which They Don't Know.
Hi Rangab,
Please find the answer
CALL 'SUB1' USING PDTLSEG
, other variable
Please find the answer
In that case u have to pass copybook throgh main progarm suppose your copybook name is pdtlseg then u need to pass it through ur main pgm to subpgm name sub11). What happens if you add a copybook to linkage section instead of adding it to a working-storage section in a sub-program?
CALL 'SUB1' USING PDTLSEG
, other variable
It converted to equivlent CAll stmt2). There are select queries on a table in a COBOL-DB2 program. After pre-compilation, each select query is replaced by equivalent cobol statements. If you look at them, is it possible to find out which statement belongs to which query?
In case of static call load module of main & sub pgm in one .So we need to use static call when we require high speed because in static call i/o will be less to comparative dynamic call in which for every call it need to seach the load module for subpgm but if there are frequent changes in subpgm then we shd go for dynamic because in static call every time u compile subpgm u need to recompile Main program.3). What is the basic consideration to use static / dynamic call and justification?
...if you can't answer these questions then you are simply not qualified for the position... ...even if you did cheat in some way, they will find you out real quick on the job and then you are back to looking for a job... ...very risky in my mind...
Computers do exactly what they are told, never what you want.
Mr gsobier
This is not a forum for you to show off !!!! , we are here to help people who as got doubts with or without any exp!!!. I am sure there are a lot of people who even with real hands on exp may not answer all those questions correctly . why don?t u answers all those questions instead of passing comments , lets see how many u answer !!!!!!!!
Moderators please take a note of such comments and take action
This is not a forum for you to show off !!!! , we are here to help people who as got doubts with or without any exp!!!. I am sure there are a lot of people who even with real hands on exp may not answer all those questions correctly . why don?t u answers all those questions instead of passing comments , lets see how many u answer !!!!!!!!
Moderators please take a note of such comments and take action
Forum Rules
Hi All,
Please note this forum is to help all mainframe professionals ( starting from learner to advanced ) around the world. I request all members dont post any comments which hurts other members feelings.
Please read the forum rules in the following thread.
http://www.ibmmainframeguru.com/Mainfra ... ic.php?t=2
Regards,
Krishna
Admin - http://www.ibmmainframeguru.com
http://www.geocities.com/srcsinc
http://www.jacharya.com
Please note this forum is to help all mainframe professionals ( starting from learner to advanced ) around the world. I request all members dont post any comments which hurts other members feelings.
Please read the forum rules in the following thread.
http://www.ibmmainframeguru.com/Mainfra ... ic.php?t=2
Regards,
Krishna
Admin - http://www.ibmmainframeguru.com
http://www.geocities.com/srcsinc
http://www.jacharya.com
There are different calls in COBOL, Call by content, Call by value and Call by reference. Is it possible that a single CALL statement have all these varieties? When do you go for each one of these? What is the basis and justification?
we can write all combination of these in single call stms and diff is in call by value or content the value is going to the sub prog ..and it will store in another memory space..in call by ref the address of variable will send to the sub prog..
and justification i think it is related to memory allocation regarding usage clases..and i dont know about basis ..sorry.
7). When do we use null indicator of a field? Does the usage of it have any benefits?
this is the concept which is for nullable cols in table while inserting.
if u r going to insert a null value inthat col. when the value of corresponding indicator is -1 then automatically null value will store in that col.
this is the concept which is for nullable cols in table while inserting.
if u r going to insert a null value inthat col. when the value of corresponding indicator is -1 then automatically null value will store in that col.
-
- Member
- Posts: 32
- Joined: Mon Sep 12, 2011 10:50 am
- Location: Bangalore
1>
according to me it will give error...because
whatever the variables declared in linkage section of sub program ,it should be declared in working-storage section of main program in the same order , in your case its not happening according to the rule,and hence it may give soc4 error.
according to me it will give error...because
whatever the variables declared in linkage section of sub program ,it should be declared in working-storage section of main program in the same order , in your case its not happening according to the rule,and hence it may give soc4 error.
Thanks & Regards
Dev
Dev
-
- Member
- Posts: 32
- Joined: Mon Sep 12, 2011 10:50 am
- Location: Bangalore
[/quote]
In a sub-program, the variables used by the CALL are usually in the linkage section. . .
[/quote]
yes ,but in the above scenario it’s not happening
he is copying working-storage variables in linkage section.
so you need to pass these new variables(linkage section) with the actual linkage section variables,
for ex...
in main program
working-storage section.
copy main-wsVars.
.
.
procedure division.
call sub-pg using main-wsVars.
stop run.
--------------------------------------
sub program
working-storage section.
.....
.
.
linkage-section.
copy main-wsVars.
copy sub-wsVars..... (//instead of copying to working storage section he will copy to linkage section)
..
...
procedure division using main-wsVars. ..........//here instead of only giving main-wsVars ,we need to pass sub-ws-Vars and also we
need to declare it in working-storage section of main program)
if am wrong ,please correct me
In a sub-program, the variables used by the CALL are usually in the linkage section. . .
[/quote]
yes ,but in the above scenario it’s not happening
he is copying working-storage variables in linkage section.
so you need to pass these new variables(linkage section) with the actual linkage section variables,
for ex...
in main program
working-storage section.
copy main-wsVars.
.
.
procedure division.
call sub-pg using main-wsVars.
stop run.
--------------------------------------
sub program
working-storage section.
.....
.
.
linkage-section.
copy main-wsVars.
copy sub-wsVars..... (//instead of copying to working storage section he will copy to linkage section)
..
...
procedure division using main-wsVars. ..........//here instead of only giving main-wsVars ,we need to pass sub-ws-Vars and also we
need to declare it in working-storage section of main program)
if am wrong ,please correct me
Thanks & Regards
Dev
Dev
Yes, there are things wrong.
Lots of the disconnects in our topics are due to unclear posts and variable intrepretation.
Do keep in mind that this topic started more than 5 years ago. . .
Not so. Variables to be used in a called module do not need to be in working-storage . . . They may be, but this is not a COBOL rule. It might be some site-specific rule/standard.we need to declare it in working-storage section of main program
Why do you believe this? TS posted no code, so this is just an interpretation.yes ,but in the above scenario it’s not happening
he is copying working-storage variables in linkage section.
Lots of the disconnects in our topics are due to unclear posts and variable intrepretation.
Do keep in mind that this topic started more than 5 years ago. . .
Last edited by DikDude on Mon Nov 07, 2011 10:21 am, edited 1 time in total.
Have a good one
-
- Member
- Posts: 32
- Joined: Mon Sep 12, 2011 10:50 am
- Location: Bangalore
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page