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
 

 

Diff in declaring the cursors in WSS and Procedure div

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

New User


Joined: 16 Sep 2006
Posts: 12

PostPosted: Thu Dec 21, 2006 9:08 am    Post subject: Diff in declaring the cursors in WSS and Procedure div
Reply with quote

hello everybody,

i want to know the what is the use of declaring a cursor in the working-storage section rather declaring it in the procedure division.

please help me, this is an interview question.

thanking you all,

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

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Dec 21, 2006 4:17 pm    Post subject:
Reply with quote

IIRC, declaring cursors is not a program executable process, it is needed by the database preprocessor. Putting it in working storage reduces the procedure division clutter.
Back to top
View user's profile Send private message
nasser_tice

New User


Joined: 28 Nov 2006
Posts: 19
Location: India

PostPosted: Thu Dec 21, 2006 8:29 pm    Post subject: Difference in Declaration of cursor needs clarification....
Reply with quote

Hi Thompson,

Could you please explain a little bit clearly to the most Freq. asked Question, what is the diff between declaring a cursor in Procedure Division and Working Storage section....

What happens if we declare it in Procedure Division and What happends if we declare in WS of Data Division..?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Dec 21, 2006 8:39 pm    Post subject:
Reply with quote

IIRC, nothing happens either way, it is non executable, (I think) it just needs to be visible to the precompiler prior to the cursor beiing used in the procedure division.
Back to top
View user's profile Send private message
Yuvaraj BP

New User


Joined: 12 Oct 2006
Posts: 12
Location: Bangalore

PostPosted: Sun Dec 24, 2006 7:09 am    Post subject:
Reply with quote

Hai,

To my theoritical knowledge, I think the program will execute successfully but the problem will be with the performance of your program with respect to speed of execution.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sun Dec 24, 2006 7:18 am    Post subject: Huh?
Reply with quote

Yuvaraj BP wrote:
To my theoritical knowledge, I think the program will execute successfully but the problem will be with the performance of your program with respect to speed of execution.
HUH? icon_question.gif
A lot of words with little said.....Where does the "performance" difference or problem occur in regards to where the cursor is declared? icon_rolleyes.gif
Back to top
View user's profile Send private message
Yuvaraj BP

New User


Joined: 12 Oct 2006
Posts: 12
Location: Bangalore

PostPosted: Sun Dec 24, 2006 7:25 am    Post subject:
Reply with quote

when the cursor is declared in the procedure division execution of your program will be slower than that of declaring it in the ws section
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sun Dec 24, 2006 7:33 am    Post subject:
Reply with quote

Yuvaraj BP wrote:
when the cursor is declared in the procedure division execution of your program will be slower than that of declaring it in the ws section
I admit it when I do not know the answer, but this I have never heard. Give me a source or reference to this, Please.....
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Dec 26, 2006 11:17 am    Post subject:
Reply with quote

Hi Yuvaraj ,

I don't think so & I m agree with William Declare cursor is non executable stmt it does not make any difference whether we declare it in working storage or procedure division it should be declare before open cursor stmt.
Back to top
View user's profile Send private message
nasser_tice

New User


Joined: 28 Nov 2006
Posts: 19
Location: India

PostPosted: Sun Dec 16, 2007 5:22 pm    Post subject:
Reply with quote

Yuvraj/Ekta/William,

The answers are not clear as for what happens exactly when we declare a Cursor in Procedure Division and WS Section. \

Can anybody else help on this.. :|
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: Mon Dec 17, 2007 8:44 am    Post subject:
Reply with quote

Hello,

Replying to a topic that is nearly a year old is usually not recommended.

The answer given in the replies is that it makes no difference.
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 Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am
No new posts Is possible to call subprogram from c... cmsmoon COBOL Programming 3 Fri Aug 05, 2016 6:46 pm
This topic is locked: you cannot edit posts or make replies. Stored procedure on Federated thru DB2 arif677 DB2 6 Tue May 31, 2016 11:48 pm


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