IBM Mainframes interview questions.

All sort of Mainframes Interview Questions.
Post Reply
Vibha
Registered Member
Posts: 31
Joined: Tue Jul 16, 2013 7:35 pm

IBM Mainframes interview questions.

Post by Vibha »

Hi,

I've listed below some of the questions I was asked in a recent interview and I was not sure if I got the answer correctly. At times, I just did not know the answer. Can you please have a look and advise on the answers:

1.
Interviewer: How will you split one Input file into two output files?
Me: Using SPLIT of SORT product.
Interviewer: What is you've to do it using COBOL?
Me: READ input file and start writing records in two different files alternatevely .

Interviewer did not seem convienced. Can you please guide if it was correct.

2.
Interviewer: What is the maximum value that a subscript can use?
Me: I was not sure. I said, 128 MB is limit of the Working-Storage Section and if there is no other variable that much value it can take!

Iterviewer lokked at me as if I've stolen his cheese! Can you please guide if it was correct.

3.
Interviewer: How will You change the column name in a table, explain the steps.
Me: I think with alter command we can add a column but, I think with alter command we can't change the column name. Can someone please guide here.


4.
Interviewer: How will you pass parameters from JCL to a cobol program other than parm statement & sysin dd*?
Me: I did not know the answer.


5.
Inteviewer: Two files are defined this way and beng read in a COBOL program
File-A is defined as : Lrecl=80,Blksize=800
File-B is defined as : Lrecl=80,Blksize=8000

How many bytes are read in I/O in each of the cases.
Me: Not sure. Please guide.

6.
Interviewer: I have a 80 byte string in cobol. It is having character "A". I want to replace A by B.How will i do that?
Me: Using INSPECT REPLACING.


7.
Interviewer: In a db2 program a column name is given wrong. Will I will get error during compilation time or run time?
Me: I think it is during compilation time. Is it correct ?
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: IBM Mainframes interview questions.

Post by Anuj Dhawan »

I'll try to answer slowly. I don't feel prepared for the interview.. :D
1.
Interviewer: How will you split one Input file into two output files?
Me: Using SPLIT of SORT product.
Interviewer: What is you've to do it using COBOL?
Me: READ input file and start writing records in two different files alternatevely .

Interviewer did not seem convienced. Can you please guide if it was correct.
There are couple of ways of doing. As you said - you can use SPLIT in SORT. If you know the number of records in the input file beforehand, there can be other ways too.

Your COBOL-answer seems fine to me unless there are more fillers to the question.
2.
Interviewer: What is the maximum value that a subscript can use?
Me: I was not sure. I said, 128 MB is limit of the Working-Storage Section and if there is no other variable that much value it can take!

Iterviewer lokked at me as if I've stolen his cheese! Can you please guide if it was correct.
I'll follow up on this question - this look somewhat incomplete to me. What answer the interviewer is looking forward to? Number of digits allowed in subscript declaration or something else. However, 128 MB limit does not sound logical to answer this question.
3.
Interviewer: How will You change the column name in a table, explain the steps.
Me: I think with alter command we can add a column but, I think with alter command we can't change the column name. Can someone please guide here.
The answer is - it depends and it depends on the version of DB2 in use at the shop. With DB2 9, you can use ALTER TABLE table_name RENAME COLUMN RECORD_KEY TO MY_KEY;

If you are using an older version of the DB2 - take back-up of table, drop the table, create the new table, load the table from back-up.

Rest of the questions later...
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: IBM Mainframes interview questions.

Post by William Collins »

Well, you have something with 128MB. The largest useful value would be one which could cover the maximum number of entries allowed in a table. If you consult Appendix B of the Enterprise COBOL Language Reference, you should find the maximum value for an OCCURS and that would be the maximum useful value for subscripting.

You could use this, 01 X COMP PIC 9(18), as a field to use for subscripting. That would give you 999,999,999,999,999,999 maximum as a non-native binary field. It would be pointless to have a field that size for a subscript.
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: IBM Mainframes interview questions.

Post by Anuj Dhawan »

William Collins wrote:Well, you have something with 128MB.
I agree with you Bill though I'm unsure about the intent of the question and find it confusing. Probably a question on limit of Working-Storage section might sound good but for a subscript (which indicates that a COBOL internal table is already in place and we just don't know how big it is and how many entries it might get) - the 128 limit only applied to subscript declaration becomes questionable, yes? Possibly a follow up with interviewer might have helped... :)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: IBM Mainframes interview questions.

Post by William Collins »

Yes, agreed. If a question does not make sense in itself, follow up. Sometimes that will be the reason for the question. Sometimes the interviewer has no particular knowledge, and is presenting the question approximately as given to them and expecting a "stock" answer, and does not know that phrasing the question differently/incorrectly makes it incoherent :-)
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: IBM Mainframes interview questions.

Post by Robert Sample »

For number 5, the BLKSIZE gives the amount of data each I/O will retrieve from the input device. So physically 800 and 8000 bytes, respectively, will be retrieved. HOWEVER, COBOL only returns one logical record at a time so the first READ statement will physically read 800 / 8000 bytes but only return 80 to the program. The next 9 / 99 READ statements will return data from the physical block already read, after which another I/O will occur.

Note that this is a VAST simplification of the actual process since the system can read multiple physical blocks in one operation, and actually QSAM (the sequential file access method) will read 5 blocks of data at a time since the default is 5 buffers. But for an interview, knowing that the block size defines the physical read amount, and that COBOL only returns one logical record at a time to the program, should be all you need to know.
Vibha
Registered Member
Posts: 31
Joined: Tue Jul 16, 2013 7:35 pm

Re: IBM Mainframes interview questions.

Post by Vibha »

Thank you so much for the answers. If possible, could you please help me with question 4 as well:

4.
Interviewer: How will you pass parameters from JCL to a cobol program other than parm statement & sysin dd*?
Me: I did not know the answer.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: IBM Mainframes interview questions.

Post by Robert Sample »

You can place the parameters into a sequential (or VSAM) data set and allocate a DD name -- ANY DD name -- to that data set. Open it and read the parameters in COBOL, then close it.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”