View previous topic :: View next topic
|
Author |
Message |
sreekanth1984
New User
Joined: 23 Mar 2010 Posts: 22 Location: Bangalore
|
|
|
|
Following questions are asked in an interview. I posted along with my answers.... Please correct me......
Question 1. A new column is added to DB2 table which is having data. COBOL program is reading the DB2 table and
writing output to a file. What are the changes that we need to do on DB2 part and COBOL part and in JCL….?
My Ans:
On DB2 part thru ALTER statement we need to add the column, apart from that no other changes. On COBOL part if we
want to use new added column we need to change the cursor statement to include the column in select statement and
precompile and bind the program. On RUN JCL there is no change, if the file has enough space to accumulate new
column.
Interviewer is not convinced with this answer.....and expecting some more changes on DB2 part....
My concern:
If the new column is added to DB2 table, is the existing data gets invalidated? Do we need to DROP the existing table
and then create the table with new column?
But I have tested this scenario, I have added new column to the existing table. But the data is not get
invalidated/corrupted. I have run the COBOL program which was using this table with out any changes done to the
program. It has completed successfully. I didn't precompile and rebound the program as I am not done changes to this
program.
Question 2.In a COBOL DB2 program, only COBOL statements are changed do we need bind the program?
My Ans:
Yes we need to bind the programm. Reason is as COBOL statements are changed, we need to compile the program. New
time stamps are generated for DBRM and COBOL load module and we need to bind the program.
Question 3. How to specify RESTART in a JCL?
My Ans: On the Job card RESTART=STEPNAME
Question 4.Difference between MAXCC and RETURN?
My Ans: MAXCC lists the maximum completion codes of all steps in JCL and RETURN will give last step completion
code. Assumed similar to LASTCC
Question 5. By looking into COBOL code updo procedure division, how will we know whether file used in the program is
PS or VSAM file?
My Ans: By looking SELECT statement we can say the file is VSAM or PS. Based on the Key, access mode.
My doubt is processing VSAM ESDS file and PS file is same, we can't distinguish between them.
Question 6: Can we write PROC inside a PROC in JCL?
My Ans: Yes
Question 7.In a COBOL-DB2-CICS program, how will CICS know about the DB2 table and about the VSAM file that has been
used in the program?
My Ans: In RCT DB2 table will be defined, which is done through binding process. In FCT we will define file
attributes.
Question 8. What are the entries in PPT?
My Ans: Mapset and Program.....Interviewer was expecting more details....
Thanks.... |
|
Back to top |
|
|
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
Question 1: Null's need to be handled
Question 5: ESDS should have ORGANIZATION IS SEQUENTIAL
PS should not have an organization type mentioned in COBOL
Ouestion 6: Nested proc's are possible but restart and overrides become difficult
Question 8 : Program name, Language and Status should be enough. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Elixir wrote: |
Question 1: Null's need to be handled
|
In what way would NULLs need to be handled? |
|
Back to top |
|
|
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
New_Column_name Type NOT NULL
Also put some values to new column based on some condition if required. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
If the new column is not null then you have to provide a default value when you define it. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
The part of this I'll never understand, is why do these questions bounce around between such disparate topics so often? I can understand where a position for a COBOL/CICS/DB2 role might need to know some of these, but what's the point of questions 3,4,5 & 6 for someone applying for that role? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
My doubt is processing VSAM ESDS file and PS file is same, we can't distinguish between them. |
Actually, if you click on the manuals link at the top of this page, find the COBOL Language Reference manual, and read section 4.2.3 -- you will find that you CAN tell the difference between a VSAM ESDS and sequential file as the ASSIGN must be in the format AS-ddname for a VSAM ESDS file. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but what's the point of questions 3,4,5 & 6 for someone applying for that role? |
At nearly every site i've supported, even the "junior" (not to be confused with trainee/fresher/rookie/etc) developers are expected to understand these concepts. Most expect the code developers to also be able to test what they've written. These "disciplines" are needed by those who write their own batch test jobs. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
As an interviewee how would you make sure that you get a perfect Interviewer for the job you are applying for - go by politically correct version of my signature, Kevin, and you'll understand why such question might come.
In a way you are correct Kevin - however, these days, I observe a trend of employing a "generic candidate" instead of "master-of-something-candidate". They need labour not the programmers or analyst. |
|
Back to top |
|
|
db2sysdba.zos
New User
Joined: 04 Oct 2011 Posts: 25 Location: INDIA
|
|
|
|
Hi sreekanth1984,
Quote: |
Interviewer is not convinced with this answer.....and expecting some more changes on DB2 part.... |
I hope your interviewer was expecting this answer.
When you add a column to a table, the table space is placed into advisory
REORG-pending status.
So you need to reorg the tablespace. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
When you add a column to a table, it is generally a good idea to update the DCLGEN that is customarily used to declare the table. You do not *have* to do this, but you will get extra credit from the interviewer if you point this out. You should also recompile all programs that use the DCLGEN, even if they don't refer to the new column. Again, you don't *have* to, but it is a good practice. YMMV. |
|
Back to top |
|
|
chaky
New User
Joined: 28 May 2009 Posts: 20 Location: Bangalore
|
|
|
|
Apart from all other things explained earlier, adding one more thing.
For adding a new column into DB2 table, one should unload the data and then load it again after the new column is added into the table. By doing this we will not be atleast making sure that data is not hampered by any kind of operation. |
|
Back to top |
|
|
|