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

What happen if cursor is defined in procedure Division


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

New User


Joined: 30 Jun 2006
Posts: 13

PostPosted: Tue Feb 20, 2007 4:19 pm
Reply with quote

Hi all,
Please tell me what will happen if a cursor is defined in procedure division instead of declaring in working storage section of data division???
Back to top
View user's profile Send private message
guptae

Moderator


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

PostPosted: Tue Feb 20, 2007 4:26 pm
Reply with quote

Hi There,

It 's wont effect whether the cursor is declared in working storage or procedure division but it should be declare befor open cursor stmt.

Please use search option befor posting a new thread
Back to top
View user's profile Send private message
ksikdar

New User


Joined: 30 Jun 2006
Posts: 13

PostPosted: Tue Feb 20, 2007 4:29 pm
Reply with quote

This question was asked in an interview in IBM.........Is it the corect answer???
Back to top
View user's profile Send private message
guptae

Moderator


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

PostPosted: Tue Feb 20, 2007 4:35 pm
Reply with quote

Hi There,

No I am kidding icon_confused.gif
Quote:

Is it the corect answer???


What do u mean by this?
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Tue Feb 20, 2007 9:15 pm
Reply with quote

guptae,
If ya decalring the cursor in w-s section can u call the cursor for multiple times, but instd if ya declare the cursor in PD it can be called many times.

Example From a file i am getting the Account number, and from the same i am obtaining the transaction info. for the day from the database and printing the transaction info and this process is done for n no. of records from the input file. so when the account number changes my values inside the cursor also changes, an i need to close the cursor and reopen with new value being moved to a host vaiable in the where clause of the cursor.

Thamilzan.


Thamilzan.
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 Invoke stored procedure via batch JCL. DB2 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts Cond parameter and Rc code of a proce... JCL & VSAM 5
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
Search our Forums:

Back to Top