Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Interview questions i faced.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Wed May 11, 2011 12:56 pm    Post subject: Interview questions i faced.
Reply with quote

Hi All,
These are the interview questions i faced.
1) there is a table where there are 3 rows for each subject for a student like
Student no Student name History Physics Chemistry
001 AAA 98
001 AAA 97
001 AAA 96
like above and he need answer as Student no Student name student total
001 AAA 291
like this
i don't know how to write a query for this

2) Program A is calling Program B
my requirement is that Program B should be designed in such a way that it should act as a stand alone program and also like a calling program?
i said through Exit we can but the interviewer not correct

3) there is a table where we have to delete the yesterday rows and insert today s rows and there are millions of rows how can we design a program for this requirement.?
i told we can delete the rows by giving range and we can commit for every 10000 rows.

4) i am moving a numeric value to alphabetic when we compile the program will i get an error or when we run the jcl ?
i said while compiling but don't know what error will be thrown.
Back to top
View user's profile Send private message

prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Wed May 11, 2011 1:07 pm    Post subject: Re: Interview questions i faced.
Reply with quote

anandinmainframe wrote:
4) i am moving a numeric value to alphabetic when we compile the program will i get an error or when we run the jcl ?
i said while compiling but don't know what error will be thrown.

The question is senseless, in REXX and PL/I you can move numerical values to character. In REXX anything is character anyway, and in PL/I the compiler will just warn you and call a library subroutine at runtime to do the move.
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Wed May 11, 2011 1:26 pm    Post subject:
Reply with quote

I think it will only throw error in case of arithmetic operations on alphabetic variable, otherwise it looks fine to me.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed May 11, 2011 1:43 pm    Post subject: Reply to: Interview questions i faced.
Reply with quote

Quote:
4) i am moving a numeric value to alphabetic when we compile the program will i get an error or when we run the jcl ?
i said while compiling but don't know what error will be thrown.


Are You sure that the question was posed in that way ?

if the masks/pictures/lengths are reasonably consistent a plain move will be happily executed in both directions

at most You might get a warning at compile time

if like in this case <alphabetic> applies to the definition - PIC X for COBOL or CHAR for PL/1

at run time the output depends on the content of the <alphabetic> field
the move will be <generally> happily executed,
the failure might happen later, on real arithmetic oprerations
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Wed May 11, 2011 2:48 pm    Post subject:
Reply with quote

Quote:
4) i am moving a numeric value to alphabetic when we compile the program will i get an error or when we run the jcl ?
i said while compiling but don't know what error will be thrown.
In COBOL, you cannot move a PIC 9 variable to a PIC A variable -- this causes a compile error. Moving a PIC 9 variable to a PIC X variable is perfectly legal in COBOL and is not a problem.
Back to top
View user's profile Send private message
Tushar Sood

New User


Joined: 26 Oct 2008
Posts: 9
Location: New Jersey

PostPosted: Wed May 11, 2011 9:44 pm    Post subject: Reply to: Interview questions i faced.
Reply with quote

For the 1st question, i guess the following query will do -

Select Studentno, studentname,sum(marks) as TotalMarks
from studenttable
group by studentno;
Back to top
View user's profile Send private message
Bang_1

New User


Joined: 08 May 2009
Posts: 39
Location: Bangalore

PostPosted: Wed May 11, 2011 10:39 pm    Post subject:
Reply with quote

In COBOL, data type compatability error comes during the compilation.
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu May 12, 2011 9:41 am    Post subject: Reply to: Interview questions i faced.
Reply with quote

Hi All,
I have posted the same question which was asked by the Interviewer.
Tushar Sood,
AFAIK that query will not work.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu May 12, 2011 2:05 pm    Post subject:
Reply with quote

Correction:- for the 1st query
Select Studentno, studentname,sum(marks) as TotalMarks
from studenttable
group by studentno,studentname;
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu May 12, 2011 3:51 pm    Post subject: Reply to: Interview questions i faced.
Reply with quote

history,physics,chemistry is different columns there was a aligning mistake so you cannot sum with different columns
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Thu May 12, 2011 4:10 pm    Post subject:
Reply with quote

The only mistake in alignment was you not putting code tags around your example. Code tags preserve spacing and are not just for code.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 12, 2011 4:26 pm    Post subject:
Reply with quote

the way the question was posed really sucks:
Code:

Student no Student name History Physics Chemistry
001             AAA        98
001             AAA                 97
001             AAA                        96

which does not make any sense.

either you have 3 subjects per row, meaning your columns are:
  • Student no
  • Student name
  • History
  • Physics
  • Chemistry

and you have 1 row per student.
thus the sql would be
Code:

select student_no
       , student_name
       , sum(history + physics + chemistry)
from...
order by 1,2

or you have a row that includes:
  • Student no
  • Student name
  • subj code
  • mark

where possibly, there would be three rows per student, one for each subj and grade.
and the sql would be
Code:

select student_no
       , student_name
       , grade
from...
group by  student_no
       , student_name
       , grade
order by 1?2?

as Nic said, use BB code to display your design, so that someone can make sense of the topic.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts SAS Programming - Basic Questions Techelm All Other Mainframe Topics 3 Fri Mar 18, 2016 10:53 pm
No new posts Where can i find Interview questions ... Elixir Mainframe Interview Questions 4 Sat Feb 20, 2016 12:38 am
This topic is locked: you cannot edit posts or make replies. Mainframe interview on 10th Oct 2015 ... kotesh Mainframe Jobs 0 Thu Oct 08, 2015 5:21 pm
No new posts File Aid DB2 Questions niks_jude Mainframe Interview Questions 1 Mon Aug 24, 2015 5:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us