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
 

 

Some interview questions.

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

New User


Joined: 10 Dec 2008
Posts: 12
Location: Bangalore

PostPosted: Tue Dec 08, 2009 4:57 pm    Post subject: Some interview questions.
Reply with quote

1. Is it possible to pass an array to a sub program from main program?
My ans: It is Possible.

2.Can subscript be used instead of index in search.

I did not know the answer.

3.Is it mandatory to use SQLCA in a program:

My ans: It is not mandatory. But if we use it, then only the sql return codes will be available for the program.

4. Can you create a timestamp error for me.
How?
I could not answer that.

Can anyone help me in finding the correct answers.

indus
Back to top
View user's profile Send private message

Lijo

New User


Joined: 24 Aug 2008
Posts: 41
Location: Cochin

PostPosted: Tue Dec 08, 2009 6:02 pm    Post subject: Reply to: Some interview questions.
Reply with quote

I don't know if this is going to be the correct answers, but just sharing my views so that I'll get to know if these are correct:
1. Yes. But you need to pass 'number occurrences of array' also to the receiving program. Then only it can read until that count and fetch individual array elements.
2. My answer is Subscript can't be used in SEARCH clause. But it can used to find an array element, for example: MOVE EMP-ARRY (EMP-NO) to WS-EMP-DETAILS. Here, EMP-NO can be a sub script.
Index is a variable which is not declared/defined anywhere in the COBOL program apart from the mention in OCCURS clause, where as subscript is normally defined in working storage section. When you use a defined variable (subscript) in OCCURS clause, you will get an error as OS try to allocate that variable again. When you do a SEARCH statement, it automatically picks up the index in OCCURS clause and starts search operation.
3. I think you must include SQLCA (SQL Communication Area) in DB2 application program. We'll be using SQLCA variables (at least SQLCODE) to check the success of a query.
4. I suppose by timestamp error you mean -818. To create a -818 (THE PRECOMPILER-GENERATED TIMESTAMP x IN THE LOAD MODULE IS DIFFERENT FROM THE BIND TIMESTAMP y BUILT FROM THE DBRM z ), after making some code changes just do a compilation and link-edit with out binding. Execute the COBOL program. You can see -818.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Dec 08, 2009 6:17 pm    Post subject:
Reply with quote

For number 2, contrary to Lijo's post, a subscript can be used for a serial search. Click on the manuals link at the top of the page, pull up the COBOL Language Reference manual, and look at section 6.2.32 on the SEARCH verb. Binary search doesn't work with a subscript, but you didn't say SEARCH ALL, just SEARCH. Further, a serial search requires an index or subscript to be specified -- it won't "automatically pick(s) up the index in OCCURS clause and starts search operation".
Back to top
View user's profile Send private message
indus

New User


Joined: 10 Dec 2008
Posts: 12
Location: Bangalore

PostPosted: Tue Dec 08, 2009 6:25 pm    Post subject:
Reply with quote

Lijo,

I have a doubt regarding SQLCA usage.
It is not mandatory to use SQLCA rt...With out sqlca also we can have a COBOL-DB2 program. But for checking for return codes we need SQLCA. But that does not mean that it is mandatory.

Just wanted to confirm this doubt...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 08, 2009 10:28 pm    Post subject:
Reply with quote

Hello,

Quote:
It is not mandatory to use SQLCA rt...With out sqlca also we can have a COBOL-DB2 program.
The db2 CALLs generated by the preprocessor refer to sqlca. Without sqlca, the compile fails (at least on the systems i currently support). . . I ran a little test to be sure icon_smile.gif
Back to top
View user's profile Send private message
indus

New User


Joined: 10 Dec 2008
Posts: 12
Location: Bangalore

PostPosted: Tue Dec 08, 2009 10:33 pm    Post subject:
Reply with quote

Thank you very much for that clarification Dick
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 08, 2009 11:02 pm    Post subject: Reply to: Some interview questions.
Reply with quote

You're welcome icon_smile.gif

d
Back to top
View user's profile Send private message
Lijo

New User


Joined: 24 Aug 2008
Posts: 41
Location: Cochin

PostPosted: Wed Dec 09, 2009 1:47 pm    Post subject: Reply to: Some interview questions.
Reply with quote

Thanks Robert for the clarification on point 2.
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 Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
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


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