|
View previous topic :: View next topic
|
| Author |
Message |
sreekanth1984
New User
Joined: 23 Mar 2010 Posts: 22 Location: Bangalore
|
|
|
|
Hi All,
I've attended interview in HCL. I was asked the following questions. Please have a look and provide ur views....
1). I've two cobol programs A and B. One program is calling other. How can you find which program is calling other. Source code of A & B programs are given, but only from ID divsion upto Procedure division.
My Ans: At the time of interview I didn't say anything, but was thinking for answer, interviewer didn't give me much time.While typing this question I got an answer to mind. Using linkage section provided no other programs present in call stack.
2). What is the difference between INCLUDE and COPY statements.
My Ans: INCLUDE will be used for including the entire structure of a table and COPY is for copying copybooks. But interviewer not satisfied with this answer.
3).Based on DD statements in a JCL how can we say which data set is used for input purpose and which data set is used for output.
My ans: Using DISP parameter. Interviewer asked me based on DISP parameters how can we find the purpose. No answer from my side.
4). I've working storage variable of data type PICX(2000). How can I intialize this varibale with '*' in working storage section itself?
My Ans: Using perform statement and tried to explain logic, interviewer told me with out using procedure division statements has to done.
5). How can we check the syntax of JCL?
My Ans: TYPRUN option with SCAN. Interviewer asked me where should we specify this option. I said on JOBCARD.
6).Difference between Package and plan. Asked me package is mandatory or not?
My ans: Package is intermediate step in binding process. Package is not manadatory. And tried to explain more details and stopped me.
Thanks,
Srikanth |
|
| Back to top |
|
 |
Ajay Baghel
Active User
.jpg)
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
| Quote: |
| 4). I've working storage variable of data type PICX(2000). How can I intialize this varibale with '*' in working storage section itself? |
Ans.
If you want all the 2000Bytes to be filled with *, then
01 VAR1 PIC X(2000) VALUE ALL '*".
if only one * followed by spaces.
01 VAR1 PIC X(2000) VALUE '*".
Thanks
Ajay |
|
| Back to top |
|
 |
TS70363
New User
Joined: 07 Apr 2010 Posts: 94 Location: Bangalore, India
|
|
|
|
| Quote: |
| 1). I've two cobol programs A and B. One program is calling other. How can you find which program is calling other. Source code of A & B programs are given, but only from ID divsion upto Procedure division. |
I read your answer. It is partially correct.- Using LINKAGE SECTION.
But I even came across the same question in one of my interviews.
What if both programs A & B have a linkage section. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| sreekanth1984 wrote: |
| 1). I've two cobol programs A and B. One program is calling other. How can you find which program is calling other. Source code of A & B programs are given, but only from ID divsion upto Procedure division. |
You should have asked the interviewer, why do you want things working with such a limited information!
Well, as they say when you have eliminated the impossible, whatever remains, however improbable, must be the truth so, before you attempt to answer, you might have asked - are "we" dealing just a COBOL program or IMS or DB2 or VSAM or something else should also be considered. In the case of IMS, linkage-section might contain just the standard IO-PCB and other PCB-masks. And such a program can be stand-alone program with a linkage-section!
Most possibly, your interviewer wanted to listen about "USING" clause, because in the question s/he mentioned about "code is available upto Procedure Division". As, in a subprogram, the PROCEDURE DIVISION header includes a USING clause that lists the names of the formal arguments and, in so doing, indicates the order in which the corresponding actual arguments must be listed by the caller in making a call to the subprogram.
So, guess what your answer should be rated...
| Quote: |
| 2). What is the difference between INCLUDE and COPY statements. |
Have you searched the forum, there are enough threads on this topic.
| Quote: |
| 3).Based on DD statements in a JCL how can we say which data set is used for input purpose and which data set is used for output. |
Your answer sounds correct unless "purpose" have some hidden meaning - which you or interviewer need to tell us.
| Quote: |
| 4). I've working storage variable of data type PICX(2000). How can I intialize this varibale with '*' in working storage section itself? |
You answer is not correct as s/he asked "this to happen in working-storage". Another answer given in this thread for this is correct answer.
| Quote: |
| 5). How can we check the syntax of JCL? |
Correct.
| Quote: |
| 6).Difference between Package and plan. Asked me package is mandatory or not? |
Both Application Plans and Packages perform the same function with respect to db2 programs. They provide the connectivity between your program and the db2 database. The difference is that an Application Plan provides the connectivity for a complete program (including all of the called sub-programs) while a package can provide the connectivity for a single sub-program. Each program must have an application plan but packages are an optional component that makes maintaining the application plans much easier. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|