IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

XPEDITER Interview questions


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
samchris

New User


Joined: 31 May 2005
Posts: 26
Location: pune

PostPosted: Wed Mar 22, 2006 2:39 pm
Reply with quote

in xpediter i marked "b" in 15 where its starts debugging?

cobol:
write binary search code using indexs ?can anyone give me some code example ?

db2:
how to calulate second highest salary in employee table?
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Wed Mar 22, 2006 2:51 pm
Reply with quote

hi samchris,

if you are given "b" in 15 also it starts debuging from first line onward's then u press f12 means then only it will goes to that line.


for db2:

select sal from emp a where 2 = (select count(*) from emp b where a.emp <= b.emp)


thank's
thanooz.
Back to top
View user's profile Send private message
samchris

New User


Joined: 31 May 2005
Posts: 26
Location: pune

PostPosted: Thu Mar 23, 2006 10:02 am
Reply with quote

hello sir,
thanks for ur reply sir.

regards
chris
Back to top
View user's profile Send private message
bright_skull

New User


Joined: 22 May 2006
Posts: 7
Location: Bangalore

PostPosted: Mon Jul 17, 2006 8:28 pm
Reply with quote


icon_exclaim.gif

For DB2:


I tried executing the query provided by Thanooz and verified it. The Query worked but took very long time compared to my query.

I also happened to come across the same question in one of the interviews I appeared.

Definitely I couldn't answer properly, but had come half way thru' and the interviewer was keen on getting a 'single' second highest value and not the sequence in desc order. The Query is some what simple also. I've tested this properly.

Here it goes:

SELECT EMPSAL FROM EMPTABLE
WHERE EMPSAL <
(SELECT MAX(EMPSAL) FROM EMPTABLE)
ORDER BY EMPSAL DESC
FETCH FIRST ROW ONLY


Explanation of the Query:


The Inner Query will return the Max value for Empsalary and the Outer Query will provide 'any' value less than the Max value in Descending order. So in order to limit it to one value that's the second highest, Use Fetch first row only.
Back to top
View user's profile Send private message
sureshchoudey

New User


Joined: 16 Sep 2005
Posts: 12

PostPosted: Wed Jul 19, 2006 8:21 pm
Reply with quote

SELECT EMPSAL FROM EMPTABLE
WHERE EMPSAL <
(SELECT MAX(EMPSAL) FROM EMPTABLE)
Back to top
View user's profile Send private message
Muthukumar.PLindia

New User


Joined: 03 Jul 2006
Posts: 51
Location: Chennai

PostPosted: Thu Jul 20, 2006 1:25 am
Reply with quote

Hi thanooz,
Could you please explain ur query
Back to top
View user's profile Send private message
bright_skull

New User


Joined: 22 May 2006
Posts: 7
Location: Bangalore

PostPosted: Thu Jul 20, 2006 8:57 am
Reply with quote


Hi Suresh,

What does your query do.... It will fetch all the rows of the EMPSAL column which are less than the Max EMPSAL. But do you know the requirement?? icon_question.gif We need to get only the second Maximum EMPSAL...

icon_exclaim.gif Also Thanooz please explain how you got that query???
Back to top
View user's profile Send private message
bright_skull

New User


Joined: 22 May 2006
Posts: 7
Location: Bangalore

PostPosted: Wed Jul 26, 2006 9:09 am
Reply with quote


Hi All,

icon_biggrin.gif I was thinking about the above questions again and again and came up with this simple logic.

The logic that I'll be putting down here can be used to get only the 3rd or 4th Max easily.. but this might eat up the resources as the joins are more.

For getting the second Max.

SELECT MAX(EMPSAL) FROM EMPTABLE
WHERE EMPSAL < (SELECT MAX(EMPSAL) FROM EMPTABLE).


Isn't this query simple compared to the previous 2 posted here??? icon_question.gif
Back to top
View user's profile Send private message
Niranjan B Manjappa

New User


Joined: 02 Jan 2007
Posts: 2
Location: Pune

PostPosted: Tue Apr 10, 2007 3:08 pm
Reply with quote

Can any one tell me how to set a break point in the middle of the perform

Eg perform i varying from 1 by 1 untill i>1000
I want top see the value of i =152.
I dnt want to press 152 times f9 and the value of i152
depends on the previous occurence.Do we hae any option for this
Back to top
View user's profile Send private message
ragganga

New User


Joined: 22 Jan 2007
Posts: 18
Location: bangalore

PostPosted: Tue Apr 10, 2007 6:41 pm
Reply with quote

Hi Niranjan,

Just overide(change) the I value in the Top screen when the value is 1 to 152.

Regards
Raghu
Back to top
View user's profile Send private message
Niranjan B Manjappa

New User


Joined: 02 Jan 2007
Posts: 2
Location: Pune

PostPosted: Wed Apr 11, 2007 3:40 pm
Reply with quote

Hi ,
Thanks for your reply.
I got the answer.

We can even use when i= 152 to set the break point.

Cheers
Niranjan
Back to top
View user's profile Send private message
azshukla

New User


Joined: 31 May 2006
Posts: 9
Location: Pune

PostPosted: Wed Apr 25, 2007 1:33 pm
Reply with quote

And how would you do that niranjan??
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Apr 25, 2007 3:09 pm
Reply with quote

First one(B) is unconditional break point and second one is conditional break point which can be applied by keying in WHEN in the command line and supplying the variable name and the value for which you want to break.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Comp interview questions Mainframe Interview Questions 5
No new posts Interview Questions on Cobol DB2 program Mainframe Interview Questions 5
No new posts Xpediter: STEP OVER cobol section Compuware & Other Tools 1
No new posts The Last Two Question For You To Ask ... Mainframe Interview Questions 0
No new posts Mainframe Interview Questions CICS,CO... Mainframe Interview Questions 6
Search our Forums:

Back to Top