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 Question at Accenture

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

New User


Joined: 02 Dec 2005
Posts: 4

PostPosted: Wed Aug 22, 2007 4:49 pm    Post subject: Interview Question at Accenture
Reply with quote

Q.1) HOW CAN WE SEE COMP3 VALUES,BCZ THAT STORED IN PACKED
DECIMAL FORM ?

Q.2) HOW TO SET THE RESTART LOGIC IN DB2?

Q.3) WHAT IS INDEX IN DB2 ? HOW ACTUALY IT WORKS INTERNALLY.

Q.4) WHAT IS STORED PROCEDURE IN DB2, WHAT R THE ADVANTAGES USING THE SP INSTEAD OF COBOL-DB2 PROGRAM?

Q.5) WHAT IS CALL BY REFERENCE AND CALL BY CONTENT, KINDLY CAN
U TELL THE CODE FOR ABOVE TWO?

Q.6) IF I AM DOING UNCATLOG SOME DATA SET ? THEN IT WILL REMOVE THE ENTRY FROM SYSTEM CATLOG , AFTER THIS CAN I ACCES THIS DATA SET IN 3.4 OR IF I WANT TO USE IN SOME JCL THEN HOW CAN WE REFER TO UNCATLOG DATA SETS.

Q.7) FOR CONCATENATION PDS OR PS WHAT UTILITY WE USE
PGM = ??????

Q.8) QUERY FOR FIND THE MAXIMUM SALARY COLUMN FORM THE TABLE WHICH HAS 1000 ROWS , BUT I NEED ONLY 100 ROWS WHICH HAS MAX SALARY ?

Warning: Caps On
Back to top
View user's profile Send private message

kumaresh.M

New User


Joined: 17 Feb 2006
Posts: 64
Location: Bangalore

PostPosted: Wed Aug 22, 2007 5:27 pm    Post subject:
Reply with quote

Hi Majid,

I think you are trying for a job hardly,I give you a simple suggestion.
If you didnt know any answers for a question plz follow this,

"DONT LOOK FOR EXACT ANSWERS.LOOK FOR WHERE I CAN GET THE ANSWERS"
All the best,

Cheers,
kumaresh.M

.1) HOW CAN WE SEE COMP3 VALUES,BCZ THAT STORED IN PACKED
DECIMAL FORM ?

Q.2) HOW TO SET THE RESTART LOGIC IN DB2?

Q.3) WHAT IS INDEX IN DB2 ? HOW ACTUALY IT WORKS INTERNALLY.

Q.4) WHAT IS STORED PROCEDURE IN DB2, WHAT R THE ADVANTAGES USING THE SP INSTEAD OF COBOL-DB2 PROGRAM?

Q.5) WHAT IS CALL BY REFERENCE AND CALL BY CONTENT, KINDLY CAN
U TELL THE CODE FOR ABOVE TWO?

for above questions please read COBOL & DB2 Developers guide.its avilable in the Download area of the website.

.6) IF I AM DOING UNCATLOG SOME DATA SET ? THEN IT WILL REMOVE THE ENTRY FROM SYSTEM CATLOG , AFTER THIS CAN I ACCES THIS DATA SET IN 3.4 OR IF I WANT TO USE IN SOME JCL THEN HOW CAN WE REFER TO UNCATLOG DATA SETS.
Catalog is nothing but indexing.IF u know the whole dataset name type fully in the 3.4,and u can get it.
FOR CONCATENATION PDS OR PS WHAT UTILITY WE USE
PGM = ??????

Refer JCL Reference Guide.

Q.8) QUERY FOR FIND THE MAXIMUM SALARY COLUMN FORM THE TABLE WHICH HAS 1000 ROWS , BUT I NEED ONLY 100 ROWS WHICH HAS MAX SALARY ?
First using the subquery FETCH FIRST 100 ROWS ONLY in the result table.and use the MAX function to find out the Maximum salary.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Aug 22, 2007 5:46 pm    Post subject:
Reply with quote

Mis-information.....Even I can tell that you got #5 wrong...... icon_rolleyes.gif
Back to top
View user's profile Send private message
kumaresh.M

New User


Joined: 17 Feb 2006
Posts: 64
Location: Bangalore

PostPosted: Wed Aug 22, 2007 6:27 pm    Post subject:
Reply with quote

For call sample programs please go through the link.
http://www.csis.ul.ie/COBOL/examples/default.htm
(Moderators can i post links like this,If no please remove my link and Majid send me a PM i reply to you)

Thanks,
Kumaresh.M
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Wed Aug 22, 2007 6:46 pm    Post subject: Reply to: Interview Question at Accenture
Reply with quote

1. values stored in packed decimal are not in readable format.

A) In a cobol program , if we want to print them into report, we simply move them to numeric edited-variables.
eg:
WS-TOT-ORDERS PIC 9(9) COMP-3 VALUE ZERO.

In File section record-description of report file, we describe a numeric edited variable.
05 P-COUNT PIC ZZZ,ZZZ,ZZ9.

In procedure division, we can move the comp-3 field to numeric edited field before writing report-rec.

MOVE WS-TOT-ORDERS TO P-COUNT.

B) If you are trying to display packed decimal field of a file thru jcl, you can use DFSORT'S 'outrec edit=...' feature.
eg:
//XXXX PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//INFILE DD DSN=....
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(1,60,70,8,PD,EDIT=(SIII,III,IIT),SIGNS=(+,-)
/*
Here , the packed decimal field starting at column 70 and occupying 8 bytes length is numeric edited to a readable format in the output record. 'I' shows the leading insignificant digit to be displayed as blanks if it contains zero. 'T' will display the digit as it is.

YOU can also use TO=desired_format
Following will convert the above packed decimal field to readable zonedecimal field in the output record.
OUTREC OVERLAY=(70:70,8,PD,TO=ZD)

Guys, correct me if i am wrong anywhere.

Thanks,
Ajay
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Wed Aug 22, 2007 7:10 pm    Post subject: Reply to: Interview Question at Accenture
Reply with quote

Regarding to answer to q4,

Stored procedure is program that runs on database server ( is controlled by database serve) and it can be accessed by exec sql call statement in the client pgm. Eg if stored procedure name is ABC, my client pgm can access it by:

EXEC SQL
CALL ABC(arguments)
END-EXEC

Advantages:
1. Reduces network traffic
It puts a group of sql staments on the database server. If all these statements are within the client program, it statement would require 2 trips across network ( to and from database). Putting a group of all these sql statements in stored-procedure on the database server and then calling stored procedure with arguments, would cause 2 trips for all these statements alltogether.
So, grouping SQL statements together can save on network traffic. Grouping SQL statements results in two trips across the network for each group of statements, resulting in better performance for applications.

2. Enforcement of business rules
You can use stored procedures to define business rules that are common to several applications. This is another way to define business rules, in addition to using constraints and triggers.
When an application calls the stored procedure, it will process data in a consistent way according to the rules defined in the stored procedure. If you need to change the rules, you only need to make the change once in the stored procedure, not in every application that calls the stored procedure.


Please go through below link:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/c0007033.htm
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu Aug 23, 2007 2:31 pm    Post subject:
Reply with quote

Q.1) HOW CAN WE SEE COMP3 VALUES,BCZ THAT STORED IN PACKED
DECIMAL FORM ?
Ans: Move the same to edited value field, i.e. zzzz format.

Q.2) HOW TO SET THE RESTART LOGIC IN DB2?
In most of the shop there is some restart table, so when u start the program just manke a entry on that table with ur prog name, job name, table name and counters. Now when ever you do commit, just update this table with information and in counter give the number of row that u have committed. E.g say ur table has got 200 rows and u r commiting after performing calculation for 35, so in counter give 35 and rest other info like prog name, table name and all. Once u complete the whole execution do remeber to delete this row.
One thing that u need to remeber when ever u r executing this program just read that table, if there is any entry for that particular program it means it's not the first run(i.e restart), otherwise it's fresh execution. If the entry is avilable then skip those many record which is present in counter column and do the processing of the rest.

Q.3) WHAT IS INDEX IN DB2 ? HOW ACTUALY IT WORKS INTERNALLY.
Index in DB2 is nothing but used for optimaztions of query. Say u have 5 columns and per bussiness need u know that 1,3, n 5th will be used frequently, so u create a index this helps while fetching the data from table in less DB2 cost.

Q.4) WHAT IS STORED PROCEDURE IN DB2, WHAT R THE ADVANTAGES USING THE SP INSTEAD OF COBOL-DB2 PROGRAM?
Answered already.

Q.5) WHAT IS CALL BY REFERENCE AND CALL BY CONTENT, KINDLY CAN
U TELL THE CODE FOR ABOVE TWO?
Say one program is calling another program then in that case u cann pass varaible from one program to another eithr by content or by refernce. In case of by content, if the value of the passed varibale is being changed in called program it won't be reflected in calling program where as in case of call by refernce it will.

Call B using X1, X2,X3 and Call B using X1,X2,x3 by value. First one is by refernce and other one is by COntent or value. In cobol by default it is call by refernce....(*i m lil confused plz any one cofirm)

Q.6) IF I AM DOING UNCATLOG SOME DATA SET ? THEN IT WILL REMOVE THE ENTRY FROM SYSTEM CATLOG , AFTER THIS CAN I ACCES THIS DATA SET IN 3.4 OR IF I WANT TO USE IN SOME JCL THEN HOW CAN WE REFER TO UNCATLOG DATA SETS.

In 3.4 u can't see uncateloged dataset.For the same almost every shop provides an utility to get it back. That utility is shop specific. U need to check with ur admin.


Q.7) FOR CONCATENATION PDS OR PS WHAT UTILITY WE USE
PGM = ??????

Just give PS name in sequence..e.g
X1 DD DSN=ps1, disp=<wat ever required>
DSN=ps2, disp=<wat ever required>
DSN=ps3, disp=<wat ever required>
DSN=ps4, disp=<wat ever required>

Q.8) QUERY FOR FIND THE MAXIMUM SALARY COLUMN FORM THE TABLE WHICH HAS 1000 ROWS , BUT I NEED ONLY 100 ROWS WHICH HAS MAX SALARY ?
Already answred.

Plz let me know if i am wrong any where.
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Mon Oct 08, 2007 12:35 pm    Post subject: Hi
Reply with quote

Yes, during calling the sub program you are giving syntax as Call by refference is default wat about call by value it should be call B x1,x2,x2 by content.


Regard's
Vasanth........ icon_smile.gif
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Mon Oct 08, 2007 1:44 pm    Post subject:
Reply with quote

For 8th

SELECT * FROM TABELNAME OREDER BY EMPSAL DESC FETCH FIRST 100 ROWS ONLY.
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Mon Oct 08, 2007 2:08 pm    Post subject:
Reply with quote

Nuthan,

For 8th,

SELECT * FROM TABLENAME FETCH FIRST 100 ROWS ONLY WHERE (SELECT * FROM TABLENAME EMPSAL ORDER BY HAVING MAX(EMPSAL))


If am incorrect correct me.

Regard's
Vasanth................ icon_smile.gif
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Mon Oct 08, 2007 5:34 pm    Post subject:
Reply with quote

Hi Vasanth,
You can not use SELECT after WHERE as mentioned in your query. And try the query which i have given and let me know..
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Tue Oct 09, 2007 8:56 am    Post subject: Hi
Reply with quote

Hi nuthan....


but in the question it is asked about 100 rows from 1000 rows of maximum salary.


Regard's
Vasanth.
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 QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm


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