View previous topic :: View next topic
|
Author |
Message |
mohanrao
New User
Joined: 11 Jun 2005 Posts: 13 Location: bangalore
|
|
|
|
I have attended IBM interview today and was asked these below questions.
Request you to kindly give your inputs on the same.
1) In a test jcl if I want to use a step say step number 5 from a cataloged procedure how will I code the same in my test jcl?
2) In my cobol program in the working storage section I have defined my tabel structure as below
01 employee
05 empno pic 9(5)
05 doj pic x(8)
05 esal pic 9(4)v9(2)
Now what if I want to perform a search -a)on empno and doj b) all the three fields ideally I will be searching the values from my data base (table) that means I will check the data from my table and those against the working -storage fields
Hence for this which search is highly effective?- Is it linear or binary?
3.In a flat file I have 100 records length of each record is 80 bytes
now in my ouput file
I want to write first 50 records on the lefthand side wherein my records will be spillted say 1st 40 bytes on one line and remaining on the next line this how 50 records are to be written on LHS and 51- 100 are to be wriiten on Refthandside in the same manner
Can you please provide a link for interview questions in specific to GDG in VSAM.
Thanks for your patience in reading my lengthy mail.
My sincere apologies for the mistakes from my side
Mohan |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you post your answers to those questions and people here will tell how you did
Quote: |
a link for interview questions in specific to GDG in VSAM. |
I believe there is none. . . |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
Your questions are very difficult to understand. I believe they are paraphrased from your memory. You need to be more precise if you expect any answers after you have given us your answers as Dick has asked. |
|
Back to top |
|
|
mohanrao
New User
Joined: 11 Jun 2005 Posts: 13 Location: bangalore
|
|
|
|
Hi All,
Sorry for the inconvienence caused. I am rephrasing the questions and also providing my answers to them request you to please provides your inputs
1) There is a cataloged procedure say consisting of 10 steps.
If I want to use 5th step of that proc in my testjcl( jcl which I have developed) how will I refer that 5th step in my test jcl?
My answer to the above question : I will use procstep.stepname in my JCL
2) In the working storage section a table structure is defined as below
Code: |
01 EMPLOYEE
05 EMPNAME PIC X(20).
05 EMPSAL PIC 9(4)V9(2).
05 DOF PIC X(8) |
If I want to perform a search on
1) on all the three fields
2)on EMPNAME and DOJ
Which search I will opt for ?
( here search will done against to the values that are aleardy there in the table)
That’s what the interviewer replied ,
My answer : I will declare a cursor , from the console I will accept the values for Empname, Empsal, Doj and I will do a fetch and compare the values in the table and my host variables that would be linear search
3.
Code: |
A=3
Evaluate true
When A<1
Move 2 to B
When A>5
Move 3 to B
When A=3
Move 5 to B
End-evaluate |
What would be the value of B ?
My answer : 5
4) I have a flat file of 100 records of record length 80 byres.
In the ouput file I would like to have as below
(on the left hand side 1- 40 bytes of first record and on the right handside 1-40 bytes 0f 51st record)
1--40 bytes of first record 1-40 bytes of 51st record
41-80 bytes of first record 41-80 bytes of 51st record
1--40 bytes of second record 1—40 bytes of 52nd record
41-80 bytes of second record 41-80 bytes of 52nd record .
...
.
.
.
1--40 bytes of 50th record 1-40 bytes of 100th record
41-80 bytes of 50th record 41-80 bytes of 100th record
I got confused for this and did not answer
Thanks,
Mohan |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
For 4th question I would have used ICETOOL SPLICE.
Put seq. number from 1 to 50 for first 50 rec, seq. number from 1 to 50 for last 50 rec and do splice on seq number.
if you are putting seq. number at 81,2,zd then your splice statement would be
SPLICE FROM(IN) TO(OUT) ON(81,2,CH) WITH(41,40) USING(CTL1)
In CTL1CNTL you can remove seq. number in output. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Sorry for the inconvienence caused. |
Not to worry - we will work with you to get your topics the way you want them to be. May take a couple of iterations, but we'll get there
It looks like you have a good start on your questions. I made some minor formating changes to your post for alignment and readability. If i've changed anything that is not what you want, just let me know and i'll fix it. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
2. What you've defined is not a table. Tables require an OCCURS clause. See Table Handling.
3. Correct. What would be the value of B if A=4? (Extra credit ). See EVALUATE statement in the Language Reference manual. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Maybe a database table. . .? |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
Because of the reference to WORKING STORAGE section, and "linear" and "binary" searches in the question, and because of the interviewer's answer, it looks like a COBOL table question, not a data base table question. Can you clarify, Mohan? |
|
Back to top |
|
|
mohanrao
New User
Joined: 11 Jun 2005 Posts: 13 Location: bangalore
|
|
|
|
Hi Terry,
Interviewer asked me like this...
The table structure is like the below
01 EMPLOYEE
05 EMPNAME PIC X(20).
05 EMPSAL PIC 9(4)V9(2).
05 DOJ PIC X(8)
and he wants to perform a search (linear/binary) from these working storage variables in to the emp table (db2) and find out the best suitable option.
Please let me know if I am not clear in making you understand the question.
Regards,
Mohan |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
To retrieve the data from the db2 table, you would use 2 different select statements for the 2 different requirements. Your code should not have anything to do with a linear or binary search. . .
Both selects should be driven by using keys/indexes in the table. If the predicates for the select statements are not keys, a full table traversal would be required (possibly what the interviewer meant by "linear"). |
|
Back to top |
|
|
mohanrao
New User
Joined: 11 Jun 2005 Posts: 13 Location: bangalore
|
|
|
|
Hi Dick,
Thank you so much for the reply. Request you to kindly provide your inputs on the remaining questions.
Regards,
Mohan |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You're welcome
The other questions have already been answered (unless i've missed something). If there is something that is not clear, post what is not clear and someone will be able to clarify. |
|
Back to top |
|
|
|